I am designing a map in French where West is "Ouest", and thus the map should read 45°23′67′′O
instead of 45°23′67′′W
. I am using a version of QGIS in English (update: in the French version of QGIS, the default option is O
). I am currently using QGIS 2.18.11, but intend to switch to 3.0 soon.
1) Is there a way to change the longitude and latitude suffix to another language or just set a different letter?
2) Using the custom
option, how can I get the minutes and the seconds? I found an example here that gets me a decimal degrees version with my own suffix, but I would like to keep degrees, minutes, seconds format. If @grid_number
is degrees… what is the equivalent for minutes and seconds?
abs(format_number( @grid_number ,2))
|| ' °'
|| CASE
WHEN @grid_axis = 'x'
THEN
IF (@grid_number > 0, 'E' , 'O')
ELSE
IF (@grid_number > 0, 'N' , 'S')
END
Best Answer
Transforming decimal degrees to degrees-minutes-seconds requires some intermediate variables, so you would need to create a custom function to achieve what you want.
The way to do the conversion is taken from this post, and is enhanced with the proper formatting and french orientation letter.
Using the numbers from the screen shot at the bottom:
dd_to_dms_FR
then go back to the
Expression
tab and call the new functiondd_to_dms_FR( @grid_number,@grid_axis )