3

I'm willing to plot public transport data for a university project, and I'm currently trying to find out roughly how many people live with a reasonable distance from a set of bus routes.

example

I have my bus routes set up as paths, like the green path below, and population data per small area as an attribute for each pink point.

What I'm trying to do is create a buffer around each bus route of roughly 1 km, select all the pink points within the buffer area, find the sum of the "Population" value of each, and save that in a file. However, I have around 600 routes I'm trying to find this info for, and I haven't been able to find any way to batch process all of my routes.

3
  • Can you please describe what have you tried by so far?
    – Taras
    Commented Aug 19, 2019 at 5:34
  • Can you please tell whether you have each bus route in a separate shapefile or they all are mounted into one shapefile?
    – Taras
    Commented Aug 19, 2019 at 7:46
  • @Taras Each route is currently saved as its own shapefile in a folder. I haven't tried anything so far, as I haven't been able to figure out a way to process them in bulk. Commented Aug 20, 2019 at 3:03

1 Answer 1

1

If you want to use the whole layer as an input to your analysis, just open the appropriate tool from processing toolbox and select that layer in a corresponding menu. Majority of tools works in a "per feature" manner, so that desired algorithm is applied for each feature in layer (eg cretes buffer around each feature in layer, and so on) So, with that in mind, your analysis is pretty straightforward:

  1. run Buffer algorithm for whole bus routes layer with the desired buffer amount.
  2. Then run Extract by location algorithm. Ther you want to extract features from population layer that intersects layer resulting from step 1.
  3. Then use Basic statistics for fields algorithm co compute statistics for poupulation field in layer from step 2. Or alternatively you can use interactive statistics tool as described here: Sum values in a field for selected features QGIS
3
  • I think @James Schoch has each bus route as a separate shapefile, therefore IMHO he is looking for a loop-like-solution. Probably a PyQGIS
    – Taras
    Commented Aug 19, 2019 at 7:44
  • If the bus routes are in separate layers, run the merge vector layers tool to combine them so they can be efficiently processed using the built-in tools.
    – csk
    Commented Aug 19, 2019 at 17:38
  • Thank you guys! Commented Aug 25, 2019 at 21:09

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.