I have a shapefile with polygons. And I have a global raster file. I want to overlay the shapefile's polygons onto the raster grid and calculate the mean raster value for each polygon.
How can I do this using GDAL, writing the results to the shapefile?
Following advice I got on the gdal-dev mailing list, I used StarSpan:
starspan --vector V --raster R1 R2 ... --stats mystats.csv avg mode
The results are saved to CSV format. At that time, that was already enough for me, but it should be possible to somehow forge a Shapefile from that info.
No comments:
Post a Comment