1

Hi all:) I have a spatial operations/intersections question. I have a couply (actually many) polygon layers. Some of them intersect, others dont (like in the image). I basically want to count the "layers" if you want to call it like that. It's kind of a recursive intersection always intersecting two and the result with the next one. What I want is to more or less create a heatmap from polygon data

The purple in the image should have the value of 3. The green and grey partially a vakue of 2 (where the overlap) and partially 1 (where they dont overlap)

This minimal project is also available here: https://github.com/RobinKohrs/rec_intersection/raw/refs/heads/main/rec_intersection.gpkg

Is that somehow a common problem?

I guess you could automate it in python/r with intersctions and differences but I feel like there might be a better way?!:) enter image description here

1
  • 1
    You might look at the polygon self intersection tool in the SAGA section of processing. Here's a visual of it working although it never got to producing a python script. gis.stackexchange.com/questions/444530/… Commented Jul 30 at 18:33

1 Answer 1

1

I have three polygon layers: layerA, layerB and layerC.

enter image description here

Start by merging them into one layer. Then Union the output with the Merge as input layer, no overlay layer. enter image description here

This will create duplicate geometries where there are overlaps. Count the overlaps using Aggregate: group by expression: geom_to_wkt( geometry:=@geometry, precision:=1)

enter image description here

Result: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.