4

I'm working with QGIS to find overlapping area's in a polygon layer.

Some more info : The Layers contains multiple circles ( buffers ) and i need to find where there is an overlapping area of 3 or more circles. And based on how many circles overlap they have to get a different color / style.

Does anybody know a fast workflow for this?

  • Do your buffers have known and constant diameters ? – snaileater Feb 12 at 9:44
  • Yes, 750m radius – Koen Venken Feb 12 at 9:46
  • If it's only for styling (ie. you don't need the number of overlap recorded in the table) you can play with the styling option "feature blending mode" (it's in the layer rendering part) for exemple setting it to multiply give you darker shade the more overlaping feature you have – J.R Feb 12 at 10:00
  • That's usefull but it would be ideal to have the number of overlap in the record table. – Koen Venken Feb 12 at 10:11
  • 1
    you could rasterize the layers and burn the sum into the raster layer. Then separate the buffers at intersection and perform a raster statistic with the zonal statistics tool – Leo Feb 12 at 12:10
4

QGIS 3.4

  1. Make sure your polygon layer has a unique id field, such as id or fid.
  2. Run Union tool (Processing Toolbox > Vector overlay). It will return a new Union layer.
  3. Open the attribute table of this Union layer, and create an integer field with an expression as below: count("id", group_by:=geom_to_wkt($geometry)) ...... if your id field name is "id".

enter image description here

  • Thanks very much! This works perfect and was just what i needed. – Koen Venken Feb 12 at 14:26
3

In Database/DB Manager/Virtual layers/Qgis layers you're able to execute the following query (you'll have to adapt the column names...) :

with a as (select * from buffer_table)
select to_real(buffer_table.id) id, count(*) nb from buffer_table,a
where st_intersects(buffer_table.geometry, a.geometry) and a.id<>buffer_table.id
group by buffer_table.id

You load this table and save it in QGIS and join the result to your buffer_table and then you can use the nb column to label or style your buffer objects.

1

Try this: Processing toolbox - SAGA self intersection your result will like 1|5|7 and so one

via DB manger/SQL you can make a query to "count" '|' as indicator for the number of overlaps:

Create table test_count3 as select length("ID")-length(replace("ID",'|','')) as test, ogc_fid FROM test_split END

join this layer to your self intersection layer via ogc_fid and style it as categorized with the "test" column (But I am sure there is a more elegant way, however it seems to work...) enter image description here

  • when did this algorithm appear ? – snaileater Feb 12 at 12:52
  • don't know stumbled upon it a few days ago, when i had a similar problem. – user16032 Feb 12 at 12:56

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.