6

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

5
  • 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. Commented 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? Commented 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. Commented 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. Commented Nov 23, 2021 at 17:48
  • What should I do when someone answers my question? Commented Nov 28, 2024 at 9:18

3 Answers 3

7
  • Union the layer with itself

  • Extract by expression "fid"<>"fid_2", replace fid with the name of your column.

enter image description here

0
4

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.