Skip Menu |

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

Report information
The Basics
Id: 124186
Status: resolved
Priority: 0/
Queue: Geo-Proj4

People
Owner: Nobody in particular
Requestors: PAULR [...] cpan.org
Cc:
AdminCc:

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



Subject: transform returning 'nan' for epsg:29902
Hi, I have come up against this issue which is not in any way critical but would like to get to the bottom of. When I try to transform() to or from Irish National Grid (EPSG 29902 and 29903) I get 'nan' as a result. I get normal results when I use inverse(), when I use the cs2cs command, and when I use transform() in python, as outlined below. Thanks, Paul perl v5.18.4 Mac OSX 10.11 proj4 libVersion: 4.9.3. # --- perl my $epsg_4326 = Geo::Proj4->new(init => "epsg:4326"); my $epsg_2157 = Geo::Proj4->new(init => "epsg:2157"); # Irish Transverse Mercator my $epsg_29902 = Geo::Proj4->new(init => "epsg:29902"); # Irish National Grid my ($lat,$lon,$point); ($lat,$lon) = $epsg_2157->inverse(600000,750000); print "epsg_2157 inverse: $lon $lat\n"; ($lat,$lon) = $epsg_29902->inverse(200000,250000); print "epsg_29902 inverse: $lon $lat\n"; $point = $epsg_2157->transform( $epsg_4326, [600000,750000] ); print "epsg_2157 transform: @$point\n"; $point = $epsg_29902->transform( $epsg_4326, [200000,250000] ); print "epsg_29902 transform: @$point\n"; $point = $epsg_4326->transform( $epsg_2157, [-8,53.5] ); print "epsg_4326 transform: @$point\n"; $point = $epsg_4326->transform( $epsg_29902, [-8,53.5] ); print "epsg_4326 transform : @$point\n"; # OUTPUT epsg_2157 inverse: -8 53.5 epsg_29902 inverse: -8 53.5 epsg_2157 transform: -8 53.5 epsg_29902 transform: nan nan epsg_4326 transform epsg_2157: 600000 750000 epsg_4326 transform epsg_29902: nan nan # --- cs2cs $ cs2cs +init=epsg:29902 +to +init=epsg:4326 200000 250000 8d0'2.659"W 53d30'0.76"N 54.901 $ cs2cs +init=epsg:4326 +to +init=epsg:29902 -8 53.5 200049.01 249976.50 -54.90 # --- python import pyproj p1 = pyproj.Proj(init='epsg:29902') p2 = pyproj.Proj(init='epsg:4326') x1 = 200000 y1 = 250000 x2, y2 = pyproj.transform(p1,p2,x1,y1) print x2,y2 x1 = -8 y1 = 53.5 x2, y2 = pyproj.transform(p2,p1,x1,y1) print x2,y2 # OUTPUT -8.00073850523 53.5002111685 200049.008604 249976.497
Subject: Re: [rt.cpan.org #124186] transform returning 'nan' for epsg:29902
Date: Tue, 23 Jan 2018 08:42:03 +0100
To: Paul Ryan via RT <bug-Geo-Proj4 [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Paul Ryan via RT (bug-Geo-Proj4@rt.cpan.org) [180123 04:49]: Show quoted text
> Mon Jan 22 23:48:53 2018: Request 124186 was acted upon. > Transaction: Ticket created by PAULR > Queue: Geo-Proj4 > Subject: transform returning 'nan' for epsg:29902 > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=124186 > > > I have come up against this issue which is not in any way critical but > would like to get to the bottom of. When I try to transform() to or from > Irish National Grid (EPSG 29902 and 29903) I get 'nan' as a result. I > get normal results when I use inverse(), when I use the cs2cs command, > and when I use transform() in python, as outlined below. > > perl v5.18.4 > Mac OSX 10.11 > proj4 libVersion: 4.9.3.
Which version of Geo::Proj4 are you using? The latest version, released less than a month ago, is 1.08 and reverts a problem with 1.07 which produced NaNs. -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
RT-Send-CC: Mark [...] Overmeer.net
Ah yes, the version I was using was 1.07. I have just upgraded to 1.08 and all is working correctly now. And thank you for this, and all your other great Geo modules - I use them all the time! Paul