Skip Menu |

This queue is for tickets about the Geo-Coordinates-OSGB CPAN distribution.

Report information
The Basics
Id: 96738
Status: rejected
Worked: 5 min
Priority: 0/
Queue: Geo-Coordinates-OSGB

People
Owner: toby [...] cpan.org
Requestors: ab [...] lixutec.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.06
Fixed in: (no value)



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";
On Thu Jun 26 10:50:19 2014, ab@lixutec.net wrote: Show quoted text
> 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.
This is working as designed. Longitude -122 is a very long way from the British Isles. OSGB is only defined for mainland Britain. The further away you are from 2° west the less accurate the conversion. You should be using a module designed for your locality. I will update the documentation to make this restriction (even more) clear. Many thanks for the report. Toby
On Thu Jun 26 18:27:31 2014, TOBY wrote: Show quoted text
> On Thu Jun 26 10:50:19 2014, ab@lixutec.net wrote:
> > 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.
> > This is working as designed. > > Longitude -122 is a very long way from the British Isles. OSGB is > only defined for mainland Britain. The further away you are from 2° > west the less accurate the conversion. You should be using a module > designed for your locality. > > I will update the documentation to make this restriction (even more) > clear. > > Many thanks for the report. Toby