4

I have two data sets:

I would like to calculate the number of people within for example 50 km from each point. What would be the best way of doing this in QGIS?

nmtoken
  • 13,355
  • 5
  • 38
  • 87
johnrobot
  • 295
  • 2
  • 9
  • 1
    I recommend reading about PostGIS (SQL) and R, might come handy if you need do more spatial analysis in future – simpleuser001 Jan 28 '13 at 08:41
  • ST_Contains http://postgis.net/docs/manual-2.0/ST_Contains.html source: http://postgis.net/docs/manual-2.0/reference.html#Spatial_Relationships_Measurements – Mapperz Jan 28 '13 at 14:52
  • perhaps an answer to overlapping buffers could be to store the non-buffered area as a shape and subtract the population in the non-buffer area from the total – doug Nov 16 '18 at 23:19

1 Answers1

1

Use Vector > Geoprocessing Tools > Buffer on your point shapefile to create a 50km radius circle around each point.

Use the Zonal Stats plugin (its a core plugin, but must be activated in Manage Plugins) to calculate the sum (among other stats) of the raster cells inside of each polygon of the resulting shapefile.

Alexandre Neto
  • 14,212
  • 2
  • 58
  • 85
  • 1
    This only works provided no two points are closer than 50 km: when the buffers overlap, zonal stats will not be able to obtain the correct answer. Instead, compute a focal sum (with a 50 km radius circular neighborhood) and extract its values at each of the points in the shapefile. – whuber Jan 27 '13 at 23:40
  • Thank you for the answers. Two questions:
    • Since the data is in lat/long and I will use meters for the analysis, I will have to reproject the data to suitable coordinate system. Any suggestions on which one to use for a global data set?

    • The buffer zones will probably overlap. Can you tell me a bit more about how to compute a focal sum?

    Magnus

    – johnrobot Jan 28 '13 at 06:58
  • @whuber, I have never noticed problems using QGIS Zonal Stats plugin with overlaping polygons, but I know that it's a Problem in ArcGIS (9.3). I made a small test, using two polygons with the same shape\size, and overlap them. Using the QGIS plugin and the resulting count, sum and mean for each polygon was the expected. – Alexandre Neto Jan 28 '13 at 11:39
  • Very interesting! That's nice to know, and I am pleased to have been wrong about QGIS in this regard. Based on what you say, it sounds like the zonal stats solution should be preferred unless there are a very many points with very many overlaps, in which case the focal stats solution--with its much greater computational efficiency--may have some merit as an option. – whuber Jan 28 '13 at 17:14
  • Johnrobot, your query about a suitable global projection needs some careful thought. I would like to suggest you review similar questions on this site and then, if they do not indicate a solution, post that as a separate question. It looks like you could compute a variable distance buffer in a conformal projection, varying the radii with the scale. – whuber Jan 28 '13 at 17:21
  • Thanks for the replies. I have had a go using http://www.gistutor.com/postgresqlpostgis/6-advanced-postgresqlpostgis-tutorials/58-postgis-buffer-latlong-and-other-projections-using-meters-units-custom-stbuffermeters-function.html, perhaps that will be of use to someone else, too. – johnrobot Feb 06 '13 at 20:44