I am using both 50K and 25K Rasters from OS to try to produce smaller scale maps, eg Exmoor, but try as I might I cannot get the OS grid references on the outside of the map grid, the best I have got is on the centimetre or millimetre button to produce figures on the outside of the map, but both X and Y start at 0 not the OS grid reference, I am using CRS ESPG:27700, can anyone help?
Asked
Active
Viewed 250 times
1
-
did you ever get an answer to this? I found using Left(Right(@grid_number,5),2) gives you the result you are looking for. This works as this way... Right(@grid_number,5) reads the final right numbers in the Northing / Easting - which point to the actual grid reference. Left((),2) then tells QGIS to take the first to numbers of the final five to give your '65' The first one (or two, as the northing can be 7 digits) digits tell you the sheet ref number when taken from the X and Y and concatenated. I.e.. X = 265000 and Y = 365000 would give you X = 2, Y = 3. concat (2,3) = 23 = 'SH' My current ta – Sam Roberts Feb 05 '19 at 11:22
1 Answers
1
The key thing to things to check are the interval and the projection.
As you can see I've selected 1000m as my interval (with a bigger area you might want to try 5000 and 10000). If your projection isn't set to 27700 (OSGB) then you will end up with weird numbers but you should still see some.
I also set the number format to be to_int( @grid_number) to avoid the annoying the decimal places, by selecting custom in the Draw Coordinates format box, then pressing the E button to open the expression editor.
Ian Turton
- 81,417
- 6
- 84
- 185
-
Looks good so far, but how do I set the number format please? and how do you manage to put the image onto the answer please? – Derek Mar 21 '16 at 10:43
-
Also how do I get the figure back to teens not thousands, and at the moment the top and bottom have come out as 265000 not 65. Thanks for your help. – Derek Mar 21 '16 at 10:48
-
You can convert the grid number into a string and then modify as you need - try something like right( to_string( @grid_number/1000),2) – Ian Turton Mar 21 '16 at 10:55
-
I can get into the custom, but unfortunately I am not brilliant on this, what do I change when I am in the E button? And where do I go to change the string for the grid number, sorry to ask again, but a step by step guide would be a big help. Thank you – Derek Mar 21 '16 at 11:44
-
I posted a question today that touches on what I think you want to do. http://gis.stackexchange.com/questions/186271/print-composer-custom-grid-label-problem – nhopton Mar 23 '16 at 19:46
-
-
@Derek - I don't understand the question above :-( just paste right( to_string( @grid_number/1000),2) into the left hand box and hit OK – Ian Turton Mar 24 '16 at 11:03
-
Hi when I copy your formula and paste into the LHS on the grid number box I get Parser Error: syntax error, unexpected '(', expecting COMMA or ')'
Eval Error: No root node! Parsing failed?
– Derek Mar 24 '16 at 11:14 -
Not sure what I did in the end but it worked thank you, ( I copied the whole sentence from ":-", then deleted the text letter by letter until I got past "paste" and the space and it worked. I thought I had copied from here in the first place, but apparently not! – Derek Mar 24 '16 at 11:20

