geographical accuracy
Graham Seaman
graham at theseamans.net
Sat Feb 24 13:45:10 GMT 2007
Just in case anyone else runs into the same issue, here's a description
of the problem and a (bodgy) solution:
The task:
Given a set of UK ordnance survey eastings and northings, convert them
into latitude and longitude for use with google maps
The problem: Geo::Coordinates::OSGB and Geography::NationalGrid::GB,
when (correctly) set to use the WSG84 ellipsoid return values which
agree with one another to 6 decimal places. Unfortunately the results
only agree to 2 decimal places with the values expected by Google maps.
The Google map value coincides with the results returned by the
reference converter at http://gps.ordnancesurvey.co.uk/convert.asp, so
there is nothing strange happening at the google end. But I have around
20 metres of error in my output, enough to look silly on the map
(features in the middle of rivers, in roads, etc)
The partial solution (a better one would be to rewrite one of the perl
modules..): download the document 'Transformations and OSGM02 User
Guide' from the gps.ordnancesurvey site. Apply the iterative
transformation titled 'inverse transformation (OSGB36 to ETRS89)' (page
22) to your OS eastings and northings, using the lookup tables provided
in the zip file with the document. Use the resulting ETRS89 eastings
and northings as input to either of the two perl modules. Result: on a
quick sample of the outputs, I'm getting around 4 to 5 decimal places of
agreement with google and the reference converter. Not perfect, but good
enough for what I need..
Cheers
Graham
More information about the london.pm
mailing list