QGIS 3 – Creating a Frequency Map from Overlapping Polygons

frequencyoverlapping-featurespolygonqgis-3spatial-join

I have vector layers (polygons) of burned areas for a series of 33 years and i need to create a frequency map from the overlapping of this polygons (1 if there is no overlapping, 2 if there are two polygons overlapping, etc). Due to the amount of layers and overlays I need to do it in a relatively automatic way, but I can't find how. Additionally I need to be able to calculate the area of the different frequencies from the final result so I am looking for a way that allows it.

Is there a way to do this in QGIS?

Actualisation:
I tried the metodology developed in : https://gis.stackexchange.com/a/392905/88814
however I had problems with the fourth step (Split with lines). I think my polygons are very complex and long so the algorithm never ends, even running it one layer at a time.

Best Answer

I was finally able to do it by following the steps below (this works with larger and more complex polygon layers):

  1. Add an attribute with value 1 to the attribute table of all vector layers. This will be used later as a value for the burned areas that will be added with the overlapping values. (if you have the overlapping polygons in a single layer you need to separate them).

  2. In this step you need a polygon that covers the entire study area. If you don’t have one Dissolve all the layers using Menu Vector / Geoprocessing tools/ Dissolve and then use Menu Vector/ Research tools / Extract layer extent. Add an Atribute field to de polygon and fill it with the number 0. Now rasterize the resulting layer using Menu Processing / Toolbox / Rasterize (vectorial to raster) completing as follows:

  • Input: Study area polygon.
  • Attribute field: The attribute field created in this step.
  • Output raster size units: Pixels.
  • Widht/Horizontal resolution: horizontal extent in pixels.
  • Height/Vertical resolution: vertical extent in pixels.
  • Output extent: Study area polygon.

This will create a raster layer with value 0 in each pixel. (remember to calculate the extension in pixels according to the desired resolution).

  1. Now use Menu Processing / Toolbox / Rasterize (overwrite with attribute) completing as follows:
  • Input vector layer: The first vector layer you want to add to your frequency map.
  • Input raster layer: The raster layer created in the step 2.
  • Field to use for burn in value: The field attribute created in step 1.
  • Check "add burn in values to existing raster values".

This will add one unit to the pixels that match the polygons of the input vector layer.

  1. Repeat step 3 with each layer you want to add to the frequency map.

  2. Use Menu Processing / Toolbox / Raster layer unique value report and open the .html report to know how many pixels there are for each frequency and its area (area units depends of the layer projection).

Finally you can change the visualisation of the resulting layer to allow viewing of the different frequency classes ussing Properties / Simbology / Render type / Paletted - Unique values and pressing the classify button. If you can’t see the layer after adding values in steps 3/4 you may need close the layer in the proyect and open it again.

Related Question