Tuesday, 27 November 2018

qgis - Align label text using an expression



I want to align text to a specific angle in QGIS. Both the text and the angle are specified in a table (column: street name / column: angle) When I generate the labels, at the moment all the labels are placed horizontal. I want the labels (street name) to align to the specified angle from the angle column.


Any ideas on how to do this? Maybe using an expression?



Answer



Welcome to GIS.SE! In QGIS you can control any aspect of labeling (and styling as well) by attribute values or expression, a feature called data defined override. Goto Layer properties | Labels | Placement and under Data defined near Rotation you can select the column / field containing your rotation angles:


enter image description here


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