I have one layer in QGIS with many polygons (drawn in different colors) that partially overlap. How can I mark the areas that overlap separately (e.g. dashed)? Here is an example:


The colors of the areas are defined by an attribute. The orange area intersects the purple area. I have dashed the area i want to target in black in the 2nd image.

What I am not looking for is the "Intersect" tool (from the toolbox), which only searches for the overlaps of several layers. I want to target these areas1within this one layer if possible.


1 Answer 1


You can add a geometry generator style:

Open the symbol tab and add a Geometry Generator with this expression:


Note the buffer: It is needed to dissolve the overlapping geometries, otherwise it will return an error if there is more than one intersecting part.

enter image description here

Now go to Simple Fill of the Geometry Generator style and use data defined override for the fill color. Set it to e.g. 'black'. Otherwise the dashed lines will have the same color as the intersecting parts and therefore not be visible:

enter image description here


enter image description here

  • Hi. thank you very much for your answer. Unfortunately, i do not get the same result as you. As shown in the screenshots below, I did everything like you, but in my case, if an object intersects another one, both objects are dashed completely (so not just the intersection part). What could I have done wrong? (The only thing that could be the problem is that I didn't use simplefill for the dashed lines, but even with simple fill it did the thing i described. [lookimg.com/image/QVCFos] [lookimg.com/image/QVCI5z] [lookimg.com/image/QVCHwc] Apr 3 at 22:09
  • Fixed links: lookimg.com/image/QVCFos lookimg.com/image/QVCI5z lookimg.com/image/QVCHwc Apr 4 at 9:51

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.