6

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.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Nov 13, 2012 at 16:58
1
  • 4
    Normally this is trivial: it's a "zonal sum" operation, which totals values within disjoint polygonal regions. But you have two problems. First, your exposure contours are surely nested--they overlap greatly. Second, many of the contour lines probably are not closed, and therefore do not adequately represent "polygons" at all. If you possibly can, you should obtain a raster representation of exposure (this was likely used to generate the contours in the first place). Comparing the two rasters will yield a highly detailed plot of total population exposed versus exposure threshold. Commented Nov 13, 2012 at 18:16

2 Answers 2

6

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.

Glorfindel
1,0962 gold badges10 silver badges15 bronze badges
answered Nov 13, 2012 at 17:52
0
6

If you are familiar with R, you could also solve this problem with your favourite R editor, which is easy as pie.

For example like this:

library(raster);library(rgdal)
ras <- raster(...)
pol <- readOGR(...)
extraction <- extract(ras,pol)
statistics <- lapply(extraction,table)
# Further analyze the data (mean, sum per polygon feature or sth. like that)

BTW: I am currently writing a new function for a qgis-plugin of mine, which could exactly do what you want. However, it could still take a bit until it is ready (in fact I first need to solve the following problem).

Taras
35.7k5 gold badges77 silver badges151 bronze badges
answered Nov 13, 2012 at 19:24
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.