Open Source Computing and GIS in the UK

Travels in a digital world

Thursday Tip Day: Converting OS Grid Squares for GIS

| Comments

After last week’s post I was asked in the comments to explain how to convert British Ordnance Survey Grid Squares to sensible Eastings and Northings, for use in a GIS. So here goes…

Firstly- to quote from the Ordnance Survey website:

The National Grid, like its military predecessors, consists of a systematic breakdown of the Grid area into progressively smaller squares identified first by letters and then numbers. The largest unit of the grid is 500km squares each designated by a prefix letter alphabetically from A-Z omitting I – the first letter to be quoted in today’s National Grid Reference. Great Britain is covered only by four of these squares – H, N, S and T. The 500km squares are then further broken down in to twenty-five 100km squares which are identified by a letter, again A – Z omitting I ( the second letter quoted in a reference). On Ordnance Survey maps these squares are divided into smaller squares by grid lines representing 10 km spacing each numbered 0 – 9, from the South West Corner in an Easterly and Northerly direction.

The upshot of this is that there is a grid of 7x13 100KM squares superimposed over England, Scotland and Wales (Ireland has it’s own grid), each of which can be referenced either by two letters, or two numbers (counting from left to right, bottom to top, starting with 0). Traditionally, grid references in the UK have the two letter code, then the grid reference, eg SD 481 616 is the grid reference of my house.

To use these references in a GIS, ie to display point data by easting and northing coordinates do the following:

  1. Find out the numbers representing the grid letters (SD is 3,4),

  2. The column number is prefixed in front of the easting (eg 3481),

  3. The row number is prefixed in front of the northing (eg 4616),

  4. Add enough zeroes to have 6 digits in both the easting and the northing (348100 461600) *,

  5. The number of zeroes tells you how accurate the reference is- the above reference is accurate to 100m.

  6. The far North of Scotland has 7 digits in the northing

Ah, but how do you know the numbers to represent each grid square? Well, there are complicated formulae for it but I find it easiest to print out this map and number the squares up starting with 0,0 in the bottom left corner.

It is possible to find php modules online to do this automatically for a web site, and I also created a visual basic module to do this in microsoft access. I won’t post the module as my web host will probably think it’s spyware or a virus, but feel free to contact me in the comments if you’d like it.

Hope this helps!