Saturday 23 September 2017

visualisation - Styling polygon layer as dissolved with QGIS Geometry generator?



The QGIS Geometry Generator seems like a nice way to keep data intact while allowing for some creative visualisations.


I have a layer of tesselating polygons that I would like to style as a continuous surface without internal borders.


To dissolve a number of polygons in Spatialite I would use the UNION function, but Union in the Geometry Generator doesn't give a result, ie:


 union( $geometry, $geometry )

So is it possible to use the Geometry Generator to show a polygon layer as dissolved, and if so, how?



Answer



You can now do this with the geometry generator in QGIS 2.99/3.0 by using buffer(collect($geometry),0) in the expression builder.


The new collect() aggregate function collects all the feature geometries into a multipolygon; buffer() converts it into a single polygon to be styled as such.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...