4

I want to extract all overlapping areas in the same polygon layer, where borders from e.g. area 1 and area 2 (picture) overlap. I have tried "intersection" with the same layer as input and overlay layer, but the result includes both overlap and non-overlap, which makes sense since everything overlaps.

It seems like more people than me have had this issue, but I have not found a way that works for me.

Area 1 and 2

Overlap between area 1 and 2

4
  • You might try the SAGA Polygon Self Intersection tool in QGIS or in the SAGA GUI. This is different than the SAGA Intersect tool. Overlaps each become a separate polygon with null attribute values excepting one field added with both overlapping polygons ID separated by the pipe symbol. You can then select in the table for the overlapping and export or select the non-overlapping and delete.
    – johns
    Nov 23, 2021 at 14:43
  • Tried this. But got this message: "SAGA version 7.8.2 is not officially supported - algorithms may encounter issues". Tried to run it anyway, but it did not work. any thoughts?
    – Erik
    Nov 23, 2021 at 15:55
  • I get that error message but usually the tools run. I'm using the SAGA for Processing plugin. You could use SAGA itself, it gets shortcuts loaded in the OsGeo4W start folder I'm not really familiar with running the tools from its interface.
    – johns
    Nov 23, 2021 at 17:40
  • Another option might be to run the GRASS v.clean (with break, snap and bpol as tools), which will "split out" the overlaps but keep both. Then in the calculator use the expression count (1, unique field value here) to populate a new field with the overlaps by count.
    – johns
    Nov 23, 2021 at 17:48

3 Answers 3

5
  • Union the layer with itself

  • Extract by expression "fid"<>"fid_2", replace fid with whatever id column you have.

enter image description here

0
3

Another approach is to use the "Extract by expression" geoalgorithm together with the following expression:

overlay_intersects(@layer)

it uses the overlay_intersects() function.

Input:
input

Algorithm's window:
window

Output:
output

2

You can create a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer....

Replace polylayer with the name of your polygon layer and idcolumn with the name of your id column (create one if you don't have one):

SELECT
    ST_INTERSECTION(a.geometry, b.geometry)
FROM
    polylayer a,
    polylayer b
WHERE
    a.idcolumn < b.idcolumn
    AND
    st_overlaps(a.geometry, b.geometry);

Then save the layer with right-click-Export.

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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