5

I have large single layers with many features overlapping.

Simplified example with 50% transparency:enter image description here

Where the features overlap I want the attributes added together. I manually created the output I want below.

enter image description here

  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Sep 17 '16 at 9:16
5

QGIS 3.2

Thanks to new Union tool in QGIS 3.2, this has become quite easy!!!

What we do, is just use Union and Aggregate tools.

(1) Union (Processing Toolbox | Vetor Overlay | Union)

enter image description here

(2) We obtain Union layer (now broken into 12 parts...sorry mostly hidden...)

enter image description here

(3) Aggregate (Processing Toolbox | Vector geometry | Aggregate)

Note: Group by expression is geom_to_wkt( $geometry ) and the Aggregate function is sum

enter image description here

(4) Final output is Aggregated layer.

enter image description here

3

Before QGIS 3.2

This example requires MS-Excel function, along with SAGA in QGIS Processing Toolbox.

(1) Start Polygon self-intersection tool in QGIS Processing Toolbox | SAGA | Vector polygon tools. A trick here is to select your value field as Identifier.

enter image description here

(2) This tool adds an attribute field ID which shows values of all intersected polygons, separated by a | (pipe) in between.

do not use id

So, please avoid using id for a fieldname. (The id above is really bad example, which will be troublesome later when we save it as csv). Maybe fid or code would be fine.

(3) All overlapping feature will be given id: zero (0). Please edit and assign unique number. Save it as a csv file, and open by Microsoft Excel.

(4) In Excel, run Convert Text to Columns Wizard tool. (Choose | as the separator). Calculate sum of them (eg column F as sum of C,D,E in this example).

enter image description here

(5) Keep columns fid and sum and remove all the others. Save it as new csv file.

(6) Join the new csv file with the polygon layer using fid as the key field.

Lots of things to do... Not a pleasant way, but hope this helps.

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.