I have a land use vector layer with polygons representing forest, farming, urban aggregates, etc. Each polygon has a field with its area. I was trying to intersect it with buffers of different diameters (50m, 100m, 500m) around points and then obtain the area of each land use inside that buffer in QGIS 3.2.2.
The problem is the intersect tool in Vector -> Geoprocessing Tools
does not change the field Area
on the resulting intersected layer, rather it persists with the value of the entire polygon, even though only a fraction of it is inside the buffer.
I tried several solutions but none worked to solve this, so I decided on a workaround. On the intersected layer, I added a field $area
which shows the area in map units of each cut polygon and then another column with the percentage, which is the map units of that cut polygon dividing by the overall area of the circular buffer. I won't get the actual area of each land use but at least a percentage of occupation which is good enough.
Now the problem is that for each point there are several fragments of different polygons pertaining to the same land use. I wish to combine for each point the values of the same land use.
On this screenshot, you can see highlighted there are 3 pieces of land use "forest" on the 100m buffer around the same point 24. I wish to merge and sum these percentages and end up with a total percentage for each land use for each point.
Better yet if it were possible to create another table where the elements (lines) are merged by their land use, thus avoiding repeated values and providing a single element and respective total percentage value per land use type per point. On the example above, all three highlighted elements of land use Áreas florestais
of point 24 would be collapsed into a single element with a single value for Point = 24, land use = Áreas florestais
and Perc = sum(0.068+0.037+0.147)
sum("Perc", group_by:= (to_string("Ponto") + "Uso_solo"))
and see if it gives what you need. – Kazuhito Sep 14 '18 at 10:33