3

I am trying to find places where different features in one layer intersect. An example picture of the layer:

enter image description here

The result I would want from it:

enter image description here

However, at best, using Intersection, Clip or SAGA Self-intersecting polygons I get this result, basically just the Union:

enter image description here

Is there any way to do this automatically?

2

3 Answers 3

11

You can create a virtual layer.

The query joins the layer to itself where two polygons intersect and their ids are different. And then calculates their intersection geometries.

You need an id column with unique integers for each polygon. Mine is named id.

Change id to the name of your id column and Buffered to the name of you layer in the query below. (I also use a filter to exclude overlaps with an area <=1000, you can modify or remove it.)

SELECT a.id, st_intersection(a.geometry, b.geometry) AS geometry
FROM Buffered as a
JOIN Buffered as b
ON st_intersects(a.geometry, b.geometry)
AND st_area(st_intersection(a.geometry, b.geometry))>1000
AND a.id<b.id

enter image description here

The layer is temporary, you can save it to file by right-click and export.

5

Using SAGA's polygon self intersection:

  1. Run the self intersection processing tool
  2. Run "extract by expression" and use for example strpos("ID",'|') > 0 as expression to extract only the overlapping portions

Background: SAGA's self intersection adds a new field with the chosen id's of the input layer and uses | as delimiter between the original id's. So if that sign is in the result string there was at least one self intersection. Of course you could also use a regular expression or something else to detect it. Just make sure the original id field does not contain | characters.

5

Using ProcessX Plug-In:

  1. Run "Conditional Intersection" with default settings and choose the same layer as source and overlay

enter image description here

This Algorithm builds an intersection if an optional condition is fullfilled. It can also be used as polygon-self-intersection.

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.