6

Is there any GIS function which gives back the polygons of the intersections by storing the number of the overlapping surfaces to an attribute?

Or do you have a script for this purpose?

A sample pic with transparency:

enter image description here

  • Do you want the geometry of the intersections or are you talking about recording a reference to intersecting polygons such as [ID=1,ID=4,ID=5],[ID=4,ID=9] etc.... – Liam G Oct 12 '16 at 21:22
  • I would like some layers with different levels of intersections. Or I prefer one layer where the intersecting features have the level of intersection in a field. – pnz Oct 12 '16 at 21:50
  • Are you trying to achieve something similar to what's explained in this ESRI blog ? – SaultDon Oct 14 '16 at 1:33
  • Interesting, thanks for the link. Actually I started to write a PyQGIS code, because I prefer open-source solutions. – pnz Oct 14 '16 at 13:22
  • I know, but are you trying to process your data to reach the same result? – SaultDon Oct 14 '16 at 22:53
1

I used the following workflow to obtain results similar to what you seem to be looking for:

  1. Run the Intersection tool and select the same layer for the Input and Intersect layer.

  2. Run the Delete duplicate geometries tool as the output from Step 1 will produce annoying duplicates.

  3. Run the Join attributes by location tool and select the output layer from Step 2 as both input layers:

    Join attributes by location

    This step creates a count field which will contain the number of intersections for each polygon. However, if no polygon is being intersected, it will count as 1 so we need to subtract this in the next step.

  4. Run the Field Calculator and update the count field using the expression:

    "count" - 1
    

I used the workflow and seem to get reasonably correct results:

Example 1:

Count of 2

Example 2:

Count of 5


If you don't wan to do the above steps manually, you could create a model such as this one:

Model

Or you can download it and copy it to your /.qgis2/processing/models folder).

  • 1
    Thanks for your efforts Joseph, but I cannot accept it, since it gives only a similar result, that I want. I have to highlight those areas which are only covered by one polygon, covered by two polygon, and so forth. – pnz Oct 13 '16 at 12:25
  • 3
    @pnz - No problem at all, will keep it posted in case it might help others :) – Joseph Oct 13 '16 at 12:26

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.