# Buffering specific roads and calculating inhabitant number

I wish to calculate the number of inhabitants (population) who live within settlements less than 500 meters from highways and from local roads and how many marines are located less than 20 kilometres from settlements with more than 10,000 inhabitants.

I have roads.shp which consists of 6 categories of the roads and I dont know how to include only highways and local roads for my buffer zone, I mean, I dont know how to "explode" roads.shp and delete or hide other road categories and work with just these two I need.

How can I do this? Not just the roads thing but overall problem above.

• Welcome to GIS SE. As a new user, please take the Tour, which emphasizes the importance of asking One question per Question. We use a Focused question/Best answer model, so you need to not only state the goal, but detail what you've tried, and what problem resulted. Jan 14 at 0:18
• So you have and road line layer and what else? Point layers of settlements and marinas?
– BERA
Jan 14 at 6:45

One way to do so :

1) Run the buffer tool only on the highway and local roads transects :

• Open the attribute table of your road layer and use the "Select by expression" tool and run the following expression "field name of your layer containing the roads type" IN ('highways', 'local roads')
• Run the Buffer tool (check the "selected features only" and the "dissolve result" options before running the tool)

2) Sum up your target attribute (inhabitants number) that overlaps with the buffer roads:

• Select the "Join attributes by location (summary)" tool (input layer = buffer roads ; join layer = settlement polygons ; choose "intersect" ; field to summary = number of inhabitants ; summaries to calculate = "sum"

You will get a new buffer layer with a new column with the total number of inhabitants living within settlements less than 500 meters from highways and from local roads. :)

• Thank you! In the meantime I figure it out but your method is great too! Jan 15 at 16:49
• No worries, I'm glad you managed to work it out yourself ! Jan 15 at 16:53
• Im proud to! Btw I posted another question, its a bit harder so if you have time please check that one out to, thanks! Jan 15 at 17:00