4

I have several polygons drawn in Google Earth, saved as .kml files. They represent the same feature (a lava flow) as identified by different people on satellite images (so one polygon = one person). My goal is to build a map as this one, where the color represents the number of overlapping polygons, here from 0 to 6:

enter image description here

I've done this with Matlab, by "rasterizing" (using the inpolygon function and a meshgrid). The problem is that I lose the vector information. For instance, I can't calculate the area of the polygon where the 6 flows overlap (I can sum all the pixels with the same value, but this is imprecise because of the pixel size). Plus I get some distortion due to the shift in coordinate system.

I figured I'd better do it with QGIS but this is where I get stuck. I managed to load the polygons, and that's pretty much it... I think I should use a geoprocessing tool like intersect but it takes only two layers as input. Is there any way to do this?

2

1 Answer 1

4

A quick possibility (if all your objects lie in the same layer...) :

In the processing Toolbox, under SAGA, you have a treatment called polygon self-intersection which seems to be what you're seeking ...

(as a result, i seem to recall you will have a new field aggregating the id of all the polygons intersecting, so as a second step you will just have to base your symbology on the number of aggregated id's ...)

2
  • Yes, it's exactly what I was looking for, thanks! It does create a new field ID with values like '1|4|5', so I created a new field with the expression round(length(ID)/2) in order to get my categories. Now all I have left is to sum the areas of all polygons with the same number of overlap, which should be easy. Commented Apr 1, 2020 at 15:31
  • I would like to do this too, but don't know my way around QGIS. Can someone explain step-by-step what to do (for simple example of two kml files)?
    – Sam
    Commented Sep 27, 2021 at 14:54

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.