Monday, 17 June 2019

labeling - Maximum angle between curved characters makes QGIS curved label invisible


When labeling a curved line in QGIS 2.2, and setting Placement to 'Curved', the behavior of 'maximum angle between curved characters' is not intuitive, and I haven't been able to find documentation on it.


The line I'm trying to label is pretty jagged (it's a hiking trail). If I leave the 'maximum angle' settings both at 20 (default), no label is drawn. If I crank the values up to 45, the label is drawn but it is very jagged just like the trail, and illegible. If I crank the values down to 30, the label disappears again.


So, it seems like these values are being interpreted like so: "If any generated character would be more than x degrees rotated from the previous character, then do not draw the label."


Whereas I was hoping the values would be used as a sort of filter / smoothing algorithm: "Rotate the characters as needed such that each character's rotation is within x degrees of the adjacent characters' rotations."


Can anyone provide a more clear interpretation?



Answer



I can offer a workaround.


If the lines are indeed that jagged, would it be an option to use the Generaliser plugin, which makes a copy of your shapefile, but with smoother lines. Load that other layer, set it to have no linewidth (invisible) but label that one? The labels should follow the smoother version, while you can display the original map data as they are.


You may have to fool around with the different algorithms for smoothing that are listed, I have no clue which works best in which situation. (based on the results, it's your call which version - original or 'generalized'- you want to use for display)



Bit of info: link


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