Converting OS Grid References to Latitude/Longitude
Ordnance Survey have published a document "A Guide to Coordinate Systems in Great Britain" which can be downloaded
from their website (free.) This provides a detailed explanation of the GB National Grid Reference System, how it works and the
complex algorthythyms and OSTN transfromation grid used for converting GPS to/from National Grid. Most of the functions
provided within this section utilise OS data or are derived from material within this publication.
Where you copy, publish or distribute the contents of this document to third parties, you must acknowledge Ordnance
Survey as the source of the information by including the attribution statement
Copyright Ordnance Survey 2018
The conversion process has two stages - a mathematical procedure to project the curved surface of the earth onto the flat plane of a map and a data grid called OSTN15 which provides fine adjustments for a 1km grid covering all of England, Wales and Scotland. (Northern Ireland comes under the Irish Grid Reference system.)
Obtaining and Preparing the OSTN15 File
Accurate conversion from GPS to OS-Grid or OS-Grid to GPS requires access to a data grid called OSTN15 which can be downloaded free from the Ordnance Survey website. You will also
have to prepare this file to ensure your project can access this data.
-
Download the OSTN15 and OSGM15 Developer pack from https://www.ordnancesurvey.co.uk
Take care to select the correct Developer Pack (OSTN02 is outdated and you want the full OSTN15 version not the "Lite" version. - Unzip the pack - you will then have PDF instruction manuals, the OSNT15 file and a set of test data points for debugging any problems.
- Find the OSTN15 data file within the pack. It will probably have a name similar to OSTN15_OSGM15_DataFile.txt
- Copy the OSTN15 data file to the Application.Startup folder for yor project.
-
Open the OSTN15 data file a Spread Sheet and make these edits...
- Delete the first line (The header record)
- The new first line will have cells containing 90.750 and -82.020
- Delete all columns except the ones containing 90.750 and -82.020
- Close and save the file
- Rename the OSTN15 file as OSTN15.dat
- Once you have OSTN15.dat in your Application.StartUp directory, the functions should work correctly.
90.750,-82.020 90.764,-82.015 90.779,-82.010 90.794,-82.005and end
109.132,-53.032 109.158,-53.042 109.183,-53.054 109.209,-53.064Depending on your .NET configuration, the Application.StartUp folder may have a path similar to this
...\source\repos\ ProjectName \bin\Debug\net10.0-windows
Acknowledgement
This page refences material
Copyright Ordnance Survey 2018
from their
publication
A Guide to Coordinate Systems in Great Britain
DigitalDan.co.uk