Saturday, 23 January 2016

labeling - QGIS 3 Line connecting point to label issue - can not get line to align with label in desired place


I have labelled a points layer by defining a line between points and labels, so as I could remove the label to outside the map area (Figure 1). Using additional columns in the points layer attributes table (x and y), I can move the labels manually.



To make a line from the point to the label, I have added a 'Geometry Generator' in the Style section of the layer's Properties dialog. To define the geometry generator, I have used the following expression where $x and $y are the features' coordinates and "x" and"y" are the labels' coordinates:


make_line(make_point($x,$y),make_point("x","y")).


My issue is that labels do not align with the line connecting them to features. The labels are basically where I want them, but the line heads elsewhere (see Figure 1). How do I get these lines to basically be positioned from the first letter of the town name to the point? Image shows map with points being towns and the labels their town name. The lines are supposed to connect the town name label (e.g. Warrnambool) to the point (the town location), but the lines are fixed in odd directions




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