Geographic Information Systems Asked on May 26, 2021
I would like to have font markers flip when they are upside down but otherwise follow the line angle.
Here is an image of how they look now:
I would like them to look like this:
I achieved this by switching the line direction but I want to do it through the style and I would like to do it at the marker level not the line level.
I have tried a geometry generator to switch the line.
if(y_max( $geometry)>y_min($geometry),$geometry,reverse($geometry))
But this only switches the issue to the bottom line.
I also tried a data defined override on the font marker rotation with these expressions.
if( @symbol_angle < 180,0,180)
if(y_max( $geometry)< y_min($geometry),0,180)
If you're working with "font markers" for your text, set the following for data defined override of the rotation:
if(line_interpolate_angle($geometry,0)>180,180,0)
This checks, whether the line is "flipped" and if it is, tells the symbology to rotate the text by 180 degrees, otherwise it stays, as it is.
I did some additional testing, and this solution does not take changes of line direction into account.
Correct answer by Erik on May 26, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP