Wednesday, 6 July 2016

qgis - Measure collected polygons in Geometry Generator, avoiding extra texts from multipart polygons


I combined a set of polygons on the first instance of Geometry generator using something like this:


buffer(buffer(collect( $geometry, concat("MZNA","REGLABEL")), 0.1), -0.1)

Buffers are meant to join poligons with a little separation. Thing is, after that I defined marker lines to simulate measurement, but in the case of multipart polygons, I get random measures floating between the different 'islands'. So I want to separate them before measuring, but I dont know how...


EDIT: What im trying to avoid is this:


Im using the approach shownin QGIS How to label individual sides of polygon by @she_weeds. My problem is, as shown in the pic, after collecting and buffering, I get some multipolygons and those ones gets an extra text floating between the polygon parts. Is there a way to avoid it without dissolving the generated geometry?



Im not experienced enough to know if its possible (started using QGis 2 weeks ago), but i thought some options:



  • Dissolve polygons instead of collecting them, using a python function. Didnt know how to call dissolve from the function editor, didn't even know if it was possible.

  • Apply a filter to the collect statement.

  • When generating lines from points, or text from those lines, somehow test the points to condition the generation of lines.

  • When generating points from nodes, test multipart polygons and generate different sets of points. Managed to successfully test that but didnt manage to create more than one set of points.




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...