I have a vector layer (polygon) and a raster layer. The raster layer holds values for height above bald earth in a field called "value". I'd like the vector layer to inherit either the mean or the mode values from raster cells falling within the boundaries of each polygon. I run this command in grass:
v.rast.stats nameofpolygon raster=nameofraster colprefix=height
The result is a polygon populated with all the fields you'd expect but containing all null values within these fields.
- I did receive a warning that some polygons are missing centroids at the beginning of the output.
- The raster and vector layers are within the same Grass Mapset and do occupy the same geographic space.
- I did set the region to contain both features prior to running v.rast.stats
Thanks in advance for you help!
(2011/05/10)UPDATED DETAILS: I created an entirely new GRASS Location & Mapset; Loaded both my raster and polygon features to the same Mapset; Ran v.centroids on the polygons; Ran g.region.raster; Calculated univariate statistics (v.rast.stats) from the raster based on the vector; Double checked that the raster does actually contain values, and it does in a field titled "value". The statistics are still returning NULL values. I've tried this through GRASS, GRASS-gui, and QGIS gui.