I have a dataset in QGIS with polygon features that partially overlap completely. I would like to delete the overlapping polygon features so that each area is only covered by one feature. The decision as to which features should remain should be based on the "fclass" attribute. To do this, I would like to prioritize which fclass should remain before the others and which can be deleted.

I am using QGIS 3.34.5 and have tried to use polygon self-intersection, v.clean and union, but that doesn't quite do what I want.

Here is a screenshot of the overlapping features. In this case, I want to keep the "building" feature and remove the "residential" feature. S

2 Answers 2


enter image description here

Field Calculate an integer prio column. I have a column named buildingty. When there is an overlap I want to keep the lowest prio. So a communal building is kept when overlapping any other:

    when "buildingty" is 'Communal' then 1
    when "buildingty" is 'Industry' then 2
    when "buildingty" is 'Residental' then 3
    when "buildingty" is 'Store' then 4
    when "buildingty" is 'Warehouse' then 5
    else 99

Union the output with itself as input layer, no overlay layer. Where there are overlaps, duplicated geometries will be created: enter image description here

Last step is to Aggregate. "Load field from template layer" with Union as template, to add all layers from Union. Group by $geometry. Select minimum as aggregate function for all fields:

enter image description here

enter image description here

(You might want to Dissolve the aggregated layer)


You can use "Remove Self-Overlapping Portions by Condition" from ProcessX Plug-In.

As Order-By Expression use something like

when "fclass" = 'building' then 1
when "fclass" = 'residential' then 2
else 9

to prioritze your features and adjust the Order-By Method accordingly.

Run it and done.

enter image description here

This algorithm removes self-overlapping portions within a layer by an optional attribute condition. The layer can be of type (multi)point, (multi)line or (multi)polygon. The output layer is multitype of the input type. If you use the optional attribute condition, the overlapping portions are only removed if the condition between the overlapping features is met. You can choose the iteration order and therefore which feature should keep the overlapping parts. The algorithm uses the predicate overlaps, so features within, touching, crosses, etc. are not considered. Because the algorithm edits the features while iterating over the layer you may recognize a result, you maybe did not expect before starting the algorithm, in some rare overlap-constellations; this is by design.

Disclaimer: I am the author of this Plug-In.

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.