Thursday 30 June 2016

Spatial query of raster data using QGIS


I have population distribution data as a raster layer and exposure contours as vector (polygon) layers. What I'd like to do is use the vector layer to estimate the population indicated from the raster layer that fall underneath the polygon.


Can someone shed some light on this?



If it isn't straight forward, I am not too bad with Python so I'd be more than comfortable writing something that does this.



Answer



You could use the GRASS module v.rast.stats, which calculates univariate statistics from a raster map based on vector polygons and uploads the statistics to new attribute columns.


The v.rast.stats2 module is an optimised version that might be more suitable if you are working with large datasets.


Starspan is another option that allows one to do spatial analysis of raster data using vector features.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...