Subject: | wrong converting WGS84 Lat/Lng -> OSGB Grid? |
the WGS84 Decimal "47.64897 -122.34812"
should be converted to British Grid "-3388649 10638526"
but the output of my test script is:
converting to OSGB: lat: 47.6449475431333 - lng: -122.353127264019
converting to OSGB: easting: -3388647.629 - northing: 10668745.644
looking at the northing... it's completely different.
Here is my test script:
#!/usr/bin/perl
use strict;
use Geo::Coordinates::OSGB qw(ll_to_grid grid_to_ll shift_ll_from_WGS84 shift_ll_into_WGS84);
use Geo::Coordinates::OSTN02 qw/OSGB36_to_ETRS89 ETRS89_to_OSGB36/;
my $latitude = "47.64897";
my $longitude = "-122.34812";
my ($osgb_lat, $osgb_lng) = shift_ll_from_WGS84($latitude, $longitude);
print "converting to OSGB: lat: " . $osgb_lat . " - lng: " . $osgb_lng . "\n";
my ($osgb_easting, $osgb_northing) = ll_to_grid($osgb_lat, $osgb_lng);
print "converting to OSGB: easting: " . $osgb_easting . " - northing: " . $osgb_northing . "\n";