2

I have imported some OS MasterMap data into QGIS 3.2 and have labelled the Cartographic Text dataset. This dataset has a rotation field, populated with various angles of rotation depending where they are to be positioned with relation to roads and buildings. However, when I choose this column under Data Defined Placement, it seems to be rotating the labels in the wrong direction.

Is there a way to tell QGIS to treat the angles differently, as you can in ArcGIS (geographic or arithmetic)?

Sean McVeigh
  • 191
  • 1
  • 7
  • Is this stored in a database? you can do angle expressions in the expression builder. https://gis.stackexchange.com/questions/279504/align-label-text-using-an-expression – Mapperz Oct 09 '18 at 16:24

1 Answers1

4

To use an expression to control label rotation, choose "edit" from the data defined override menu.

enter image description here

If all of your angles are positive numbers, use this expression to make them negative:

concat('-',  to_real('fieldname')) 

If your angles include positive and negative values, use this expression:

 to_real('fieldname') * -1

If your field is already in numerical format you can leave out the to_real() function.

csk
  • 24,827
  • 3
  • 32
  • 70
  • 1
    i'd also check the field type in the layer properties, if it's a string you may need to convert it to an integer. – Steven Kay Oct 09 '18 at 19:30
  • 1
    Thanks @StevenKay, I incorporated your suggestion into my answer. I used to_real() instead of to_int(), in case their angles require decimal place specificity. – csk Oct 09 '18 at 19:45
  • Hi csk. I entered your first expression (concat) and this worked perfectly. Many thanks. – Sean McVeigh Oct 19 '18 at 11:27