I want to dissolve a line geometry by a unique value in the field "RoutenIDs". For example dissolve line 37 to 43 with value 27. Dissolve line 37-46 ... with value 1999 and so on. Is there a function or a plugin to do that in QGIS 3.20?
Asked
Active
Viewed 207 times
2
2 Answers
3
Use Menu Processing / Toolbox / Aggregate with this expression to aggregate:
left ( "RoutenIDs", strpos( "RoutenIDs", ';')-1)
If you want the output to be an integer instead of a text (string), add to_int().
Babel
- 71,072
- 14
- 78
- 208
-
1I was up to post the identical answer ;-) but u were faster :) – Taras Aug 30 '21 at 09:25
1
If you want to dissolve only for visual purposes (no actual geometries), you can use this expression with Geometry generator (see documentation):
buffer (collect_geometries (array_agg( $geometry,group_by:=routenids)),0)
Unfortunately, the option to create actual geometries using Geometry by expression (see documentation) does not work here because aggregate functions do not work well with Geometry by expression (see the difference between both functions).
Babel
- 71,072
- 14
- 78
- 208

