7

I am setting my latitude and longitude labels in the QGIS map > map grid properties > draw coordinates > format but this only has decimal, decimal with suffix, degree minutes (w and w/o suffix) etc but I only want the degrees with suffix as in 78° E, 65° N but I cant see a way to get to that format.

2 Answers 2

10

I would do this by selecting Decimal with Suffix for the format and at the bottom of the Map Grid Properties select 0 for Coordinate Precision.

enter image description here

0
7

In your grid properties first make sure to choose EPSG:4326 as CRS, then choose "custom" as coordinate format and click on the expression button next to it:

enter image description here

Now use this expression:

abs(@grid_number) ||  '°' || -- concat absolute grid number (without -) with °
if(@grid_number=0,'', -- if grid number is 0, dont use a suffix
    if(
        @grid_axis = 'x', -- determine which grid axis it is
        if(@grid_number<0,'W','E'), -- If grid number is negative and axis is x, use W, else E as suffix
        if(@grid_number<0,'S','N') -- If grid number is negative and axis is y, use S, else N as suffix
    )
)

Result:

enter image description here

1
  • I'm tempted to revert that edit!
    – Ian Turton
    Commented Jan 21, 2021 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.