Monday, 18 May 2015

labeling - How do I edit a single label in QGIS 3.4 (Madeira)?


I'm making a map of North Dakota and trying to label the counties, but one of the names (Golden Valley) is extremely long in a very tall county. I don't want to turn the label vertically, but would rather put 'Golden Valley' on two lines so it will fit.


Is it possible to edit only that label so that it is on two lines? And how?



Answer



You can use wordwrap() function with condition in the expression to wrap only 'Golden Valley' when defining the field to use in Label with:


enter image description here


Here is the expression to use:


Case

When "CountyNM" = 'Golden Valley' Then wordwrap("CountyNM",6)
else "CountyNM"
End

Where "CountyNM" is the field name in this example. You need to change it based on the field name you are using.


Here is the result:


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