Which buildings have access to nature where more than 50% of the nature area is closer than 3km?

I have 1) a file with all the residential buildings in a small municipality and 2) a file with all the surrounding green areas.

I'm having a hard time solving this because the residential buildings are so many that doing a buffer for individual buildings produces way too many overlapping circles. In spite of this, I tried following this tutorial Percentage of polygon in one shapefile within polygon of another . I used the overlap analysis and set the green areas as input layer, and the 3km buffer around residential buildings as the overlay layer. But in the attribute table the analysis returns a column with the area percentage where all the values are 99 or 100. Which makes me think that the analysis isn't performed on each individual buffered circle, but on the whole shape instead. I tried the other way around as well (buffer layer as input and green areas as overlay) but the percentage values it returns are very small and none larger than 49%, which can't be right either.

I have also tried performing a 3km buffer on the green areas and see which buildings it intersects with but that doesn't give the full picture since there are other buildings that have access to less than 100% of the green area within 3km.

Here is a screenshot of my layers.

Anyone have any tips on how I should actually go about this?

1 Answer

Step 0: Add an ID to your buildings (most likely using `\$id` in the field calculator).

Step 1: Buffer your buildings, don't dissolve the buffers (as you already did).

Step 2: Calculate the areas of your nature reserves (use the field calculator and `\$area`).

Step 3 (optional): Use `select by location` to select all buffers which `touch` a nature reserve.

Step 4: Use `intersect` with the buffers as the first layer, and the nature areas as the second. You may use only the selected features, if the process would take too long otherwise.

Step 5: For every intersected buffer, where the remainung buffer-area is at least half as large as the total area of the nature reserve, note a `1` in the attribute table, every other buffer gets a `0`. Do this by running `if(\$area >= "total area"*0.5,1,0)` on the intersected layer. You have to replace the term in `"` with the name of your column with the corresponding value.

Step 6: Use `join attributes table` (aka join by value/field) to join the column you created in step 5 to your original buildings based on the common ID they share. Now every building which has access to at least 50 % of a nature area has a `1` in its attributes.

• Thanks! I think it might have worked. Any tips on how to trace the result of step 7 back to the original buffered buildings? Because the result of the intersection analysis are green area polygons, not the buffered circles. So the percentage of intersecting areas is not in the same layer/attribute table as the actual building polygons. I have tried performing a join based on the building ID field that exists in both layers. However, if any of the intersection instances connected to that building ID happened to be null, it is null that is copied in the joined table of the building layer. Oct 9, 2020 at 2:06
• @Selma: I overhauled the process. If something is unclear, please let me know.
– Erik
Oct 9, 2020 at 7:23
• Thanks!! I realized that the biggest problem was the size of the file (over 6 mil objects) so the analysis would crash after the while and return null for the rest of the objects. However, now I have divided the original layer into 6 smaller ones based on class and performed the steps from above on each one of them. But now when I merge column from step 5 for each layer with the building ID I get 6 separate columns with 1 or 0 values. This also means that the same building could have value 1 in one column, nulll in another, and 0 in another, which makes sense because (cont. below) Oct 11, 2020 at 14:28
• because a building might intersect with a green area of class 1, but not with that of class 3, etc. To combine these 6 columns I ran the expression (case when "column1" or "column2" or "column3" and so on =1 then 1 else 0 end) . My question now is if there is a better expression I could have used to accomplish this? Or even when joining tables based on the id attribute, is there a way of joining tables from several layers at the same time? Could Group Stats be of use here? Oct 11, 2020 at 14:38
• I suggest you put these up as different questions @Selma, since those might be answered already somewhere in here.
– Erik
Oct 12, 2020 at 6:47