[Qgis-developer] Expression to get label reference point X and Y for use with geometry generator (make_line) ?

kimaidou kimaidou at gmail.com
Thu May 4 05:39:38 PDT 2017


I am playing with data-defined label position, with 2 column label_x and
I use a geometry generator to draw the line between the label and the
feature centroid, like

  centroid( $geometry ),
  make_point( "label_x", "label_y" )

It work pretty well (with some rectangle background under the label text),
but it is obviously only active when the label_x and label_y fields are not
NULL ( when the label is pinned )

I would like to draw this line for any features (perhaps depending on this
line length). So basically, I would need 2 new functions $x_label and

Anyone has tried to achieve this ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170504/43ce04eb/attachment.html>

More information about the QGIS-Developer mailing list