How to Convert OS Grid to GPS
The Global Positioning System is a satellite-based navigation system used for air and ground travel. The Ordnance Survey is a mapping system for Great Britain. GPS and the OS system use different models for their coordinate systems: GPS uses longitude and latitude, while OS Grid References are based on 100-km. grid squares identified by letter-pairs. The OS uses a six-digit reference to pinpoint each coordinate inside this grid. Use Javascript functions to convert OS grid coordinates to GPS.
Instructions
-
-
1
Open Notepad.
-
2
Copy and paste the Javascript functions to convert latitude and longitude to OS grid points (see Resources) into Notepad.
-
-
3
Create textboxes by pasting this form into Notepad:
<form name="f" action="none!">
<table >
<tr>
<td>OS Grid Ref</td>
<td colspan="3"><input name="gridRef" id="gridRef" value="TG 5140 1317" size="12"></td>
</tr>
<tr>
<td>Latitude/Longitude</td>
<td><input name="latWGS84" id="latWGS84" value="" size="12"></td>
<td> </td>
<td><input name="lonWGS84" id="lonWGS84" value="" size="12"></td>
</tr>
<tr><td><input type="submit"></td></tr>
</table>
</form>
-
4
Add this Javascript function to the Notepad document:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#gridRef').change( function() {
var pOSGB = OSGridToLatLong($('#gridRef').val());
var pWGS = convertOSGB36toWGS84(pOSGB);
$('#latWGS84').val(pWGS.lat.toLat(2));
$('#lonWGS84').val(pWGS.lon.toLon(2));
});
});
</script>
-
5
Save the Notepad document with an ".html" extension. Open it in your browser.
-
6
Enter the OS Grid reference in the "OS Grid Ref" text field and click the "Submit" button. The equivalent GPS coordinates will appear in the "Latitude" and "Longitude" text boxes.
-
1
References
Resources
- Photo Credit map image by araraadt from Fotolia.com