I've a layer with multilines, overlapping to a various degrees. I need to merge/dissolve them "downwards" while summing their values for the overlapping segments.
I made it to "Union" phase, the resulting layer is here link, values to sum are in ROUND column. Following it, I tried v.clean and Aggregate (basically as suggested here Summing attribute values of overlapping polyline portions in QGIS 3.0.3 ), but I'm kinda confused in options, and have come to thinking, that these tools actually cannot do this.
The task seems quite simple, yet I`m quite new to GIS and might be wrong. Found this thread Overlapping line aggregation+trim in PostGIS, while summing values which talks about just the same situation but is really a code in length of an A4 really the only solution?
Here's a sample of what I'm trying to achieve. I`s an actual segment from data after Aggregation but tool gave wrong results with many lines still overlapping, still, the idea is right. As a result, I want to have a flattened layer of line segments without overlapping, where each segment, i.e. color in sample, has a value, that is a sum of values of overlapping segments before flattening.
Note - I`d prefer a solution over a calculated final result, as the source data are dynamic and keep changing.
Note 2 - gave a go to the code in length of an A4 suggested in the other thread. Changed variables everywhere in the code and tried to create a virtual layer with it. No luck, it returned syntax error, which I was unable to identify. No wonder as I'm a total dumb when it comes to SQL, well, code in general.