Raster aggregate values
Jump to navigation Jump to search
Q: How can I calculate the average map values by spatial unit (grid)? For example, I would like to calculate the average slope by square kilometer for a given area.
A: Procedure outline:
- Make a slope map from the DEM with at the same resolution and bounds as the DEM. (run 'g.region rast=dem' first)
- Make the grid with , with box=1000,1000 (assuming the location is meters-based)
- Draw a 1 km x 1 km grid ( ), and overlay the vector map (area fill = none, or only display boundary features, colored red or so) just to verify where it will be and what it will look like.
- Run to calculate stats for each grid box, and upload to that area's attribute table.
Perhaps a similar thing could be done using?