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.

QGIS attribute table

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)

  • Interesting question! Please try sum("Perc", group_by:= (to_string("Ponto") + "Uso_solo")) and see if it gives what you need. – Kazuhito Sep 14 at 10:33
  • @Kazuhito Perfect! It does work, this expression provides a sum of percentages on a new field for each land use. Thank you. – Filipe Bernardo Sep 14 at 10:42
  • Thanks FilipeBernardo, your question is probably the first in this site which need to group by multiple fields. Let me put it in as an answer, but there could be better solutions. – Kazuhito Sep 14 at 11:10
  • Yes, indeed it's not the ideal solution because the elements are not merged by land use, thus providing repeated values, luckily it's just 39 points so I can handle it for my current analysis and having the total percentage sum is already a great time saver, but it would be troublesome if it were some thousands of points. Anyway thank you for your reply and I'll be checking for new answers to this question as well. – Filipe Bernardo Sep 14 at 11:23
  • FilipeBernardo, sounds your comment is the real intention of your question? You can edit your post anytime to fit it for purpose. – Kazuhito Sep 14 at 11:29

Turns out I found the complete solution for this question by using the aggregate tool (Vector > Geoprocessing tools > Aggregate) for repeated element merging, in addition to @Kazuhito's formula to calculate the combined relative area of more than one element under the same field.

Here's the description of the Aggregate tool on QGIS 3.4.1.

This algorithm takes a vector layer and combines their features into new features. One or more attributes can be specified to dissolve features belonging to the same class (having the same value for the specified attributes), alternatively all features can be dissolved in a single one. All output geometries will be converted to multi geometries. In case the input is a polygon layer, common boundaries of adjacent polygons being dissolved will get erased.

On the Aggregate window, there is an option to dissolve fields.

Dissolve field(s) [optional]

This allows the merging of several elements having the same field value on the chosen layer for dissolving.

Here's an example, on the original layer, two elements with cellID 6752

repeated elements 6752

and then on the aggregated layer, they are merged into a single element with cellID 6752.

single element 6752

Hope this solution will be useful to someone else.

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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