[Qgis-user] Offsetting rotated labels proportionate to variable angles/rotations

Tony Shepherd (FarmMaps NZ) tony at farmmaps.nz
Thu Jul 1 15:44:41 PDT 2021


Hi All

 

Simple question, but I am not sure how best to word it. Since we all love
maps, I have a diagram below.

1.	Create some points along a polyline. Easy using "Points along
Gemoetry"
2.	Display and label the points and put a rotation on the labels and
justify as needed (middle right in this case)

 

What I want to do is shift the label out from the point slightly. That's
easy if using Offset X and Y, but it does exactly as expected and moves them
X and Y, NOT accounting for the angle.

 

I'm guessing I would need to use Data Defined X and Y and do some
trigonometry using the angle and distance to calculate the new preferred
label position.  Does anybody have code to do this?

 

A simple workaround I did use was to just pad a few spaces to the end of the
label (ie "FIELD NAME" || '    ')

 



Cheers

Tony

 

Tony Shepherd  |  GeoSpatial / Mapping Manager

Ph 027 435 6193  |  E  <mailto:tony at farmmaps.nz> tony at farmmaps.nz

FarmMaps NZ, 3 Kerwood Place, Gore 9740

 

 <http://tonyshepherd8.wixsite.com/home>
<https://www.wunderground.com/personal-weather-station/dashboard?ID=ISTLGORE
2> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210702/31732c0e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 32217 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210702/31732c0e/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2467 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210702/31732c0e/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 2510 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210702/31732c0e/attachment-0005.png>


More information about the Qgis-user mailing list