Jump to content

 
Photo

OS Grid references to lat/lon

- - - - -

  • Please log in to reply
8 replies to this topic

#1
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,835 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

I'm looking for a way to convert OS Grid references (like ST626882) to lat/lon, automagically. Any thoughts?
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#2
bchubb

bchubb

    Key Contributor

  • Validated Member
  • PipPipPip
  • 64 posts
  • Location:British Columbia, Canada
  • Interests:Painting
  • Canada

Do you have Manifold? There should be a way if you can paste OS cordinates as a drawing. Manifold displays x, y coordinates along with lat/long in the table.

bryanchubb.ca
My paintings (...and no, my Avatar is Vera by Fredrick Varley)

#3
Richard Fairhurst

Richard Fairhurst

    Newbie

  • Validated Member
  • Pip
  • 2 posts
  • United Kingdom

There's lots of code out there to do it. What software/programming language are you using?

#4
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,835 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

Do you have Manifold? There should be a way if you can paste OS cordinates as a drawing. Manifold displays x, y coordinates along with lat/long in the table.


I do have Manifold, but the data structure doesn't support this operation. There's no separate X and Y coordinates. The value ST626882 means a Northing of 626 and an Easting of 882 'somethings' relative to the lower left corner of grid ST (what those 'somethings' are is determined by the number of digits...). And there's the problem...

There's lots of code out there to do it. What software/programming language are you using?


I would prefer PHP. Didn't come across any samples using that, although I did find a Perl sample.

Also, something with a minimum of effort required on my behalf would be very nice. This is for an advisory thing for a non-profit organisation, so I can't really afford to pour in loads of time.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#5
Richard Fairhurst

Richard Fairhurst

    Newbie

  • Validated Member
  • Pip
  • 2 posts
  • United Kingdom

I would prefer PHP. Didn't come across any samples using that, although I did find a Perl sample.


Try this!

This should do the work for you with the two-letter grid squares, but if you need more info, there's a diagram here.

cheers
Richard

#6
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,835 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

Try this!

This should do the work for you with the two-letter grid squares, but if you need more info, there's a diagram here.

<{POST_SNAPBACK}>


That looks promising. Thanks!
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#7
mdenil

mdenil

    Contributor

  • Validated Member
  • PipPip
  • 11 posts
  • United States

The Wikipedia page for the British national Grid system
http://en.wikipedia....eference_system
has a quick two letter -> meter value conversion chart.

With a lookup table for converting the parsed letter values, and minding the datum shift (OSGB36 (Ordnance Survey Great Britain 1936)) plus the scale factor... should be a piece of cake, eh?

Datum: OSGB1936,
Map projection: Transverse Mercator,
Latitude of Origin: 49,
Longitude of Origin: -2,
Scale Factor: 0.999601272000000040,
False Easting: 400000 m,
False Northing: -100000 m

#8
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,835 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

I was actually looking for something automatic :D

The link that Richard posted led to a bit of PHP code that did the trick.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#9
mshand@ges.gla.ac.uk

mshand@ges.gla.ac.uk

    Newbie

  • Validated Member
  • Pip
  • 1 posts
  • United Kingdom

Hans,

I posted this on Carto-SOC recently,

NEARBY.ORG.UK
Has a great Geographical Search Engine for all things to do with UK and Ireland Mapping plus OS trig sources, web mapping site comparison table and an excellent online World co-ord Converter
http://www.nearby.org.uk/index2.html

SEARCHING.UK.COM
This has great links to several Geographic Converter and Calculator sites - UK and Worldwide
http://www.searching..._converter.html


Mike




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->