How to Convert OS Grid to GPS

Written by declan maher
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Convert OS Grid to GPS
The Ordance Survey now provides maps in digital form. (map image by araraadt from Fotolia.com)

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.

Skill level:
Easy

Other People Are Reading

Instructions

  1. 1

    Open Notepad.

  2. 2

    Copy and paste the JavaScript functions to convert latitude and longitude to OS grid points (see Resources) into Notepad.

  3. 3

    Create textboxes by pasting this form into Notepad:

    <form name="f" action="none!">

        &lt;table &gt;
    

    <tr>

            &lt;td&gt;OS Grid Ref&lt;/td&gt;
    
            &lt;td colspan="3"&gt;&lt;input name="gridRef" id="gridRef" value="TG 5140 1317" size="12"&gt;&lt;/td&gt;
    
          &lt;/tr&gt;
    
          &lt;tr&gt;
    
            &lt;td&gt;Latitude/Longitude&lt;/td&gt;
    
            &lt;td&gt;&lt;input name="latWGS84" id="latWGS84" value="" size="12"&gt;&lt;/td&gt;
    
            &lt;td&gt;&amp;nbsp;&lt;/td&gt;
    
            &lt;td&gt;&lt;input name="lonWGS84" id="lonWGS84" value="" size="12"&gt;&lt;/td&gt;
    
          &lt;/tr&gt;
    

    <tr><td><input type="submit"></td></tr>

        &lt;/table&gt;
    
      &lt;/form&gt;
    
  4. 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() {

    $('#grid Ref').change( function() {

      var pOSGB = OSGridToLatLong($('#grid Ref').val());
    
      var pWGS = convertOSGB36toWGS84(pOSGB);
    
      $('#latWGS84').val(pWGS.lat.toLat(2));
    
      $('#lonWGS84').val(pWGS.lon.toLon(2));
    
    });
    

    });

    </script>

  5. 5

    Save the Notepad document with an ".html" extension. Open it in your browser.

  6. 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.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.