Skip Menu |

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

Report information
The Basics
Id: 47956
Status: resolved
Priority: 0/
Queue: Geo-Point

People
Owner: Nobody in particular
Requestors: don_reid [...] comcast.net
Cc:
AdminCc:

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



Subject: Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform
Date: Thu, 16 Jul 2009 15:38:24 -0700
To: bug-Geo-Point [...] rt.cpan.org
From: don <don_reid [...] comcast.net>
Geo::Proj->to is calling $myproj4->transform with its remaining arguments, but Geo::Proj4->transform is lloking for a reference to an array. I tried changing it to: $myproj4->transform($toproj4, \@_); But then I get an error: Argument "point[wgs84](44.0196 -121.7903)" isn't numeric in subroutine entry at /home/dreid/apps/lib/perl5/x86_64-linux-thread-multi/Geo/Proj4.pm line 114. I'm not sure what the code in transform is doing, after checking that $points is an array reference, it looks for the first element to be another array reference?? Is this usage right for a simple transform? $wgs84 = Geo::Proj->projection('wgs84'); $nad27 = Geo::Proj->new ( nick => 'nad27', proj4 => '+proj=latlong +datum=NAD27 +ellps=clrk66', ) or die; $p = Geo::Point->latlong(44.0196, -121.7903, 'wgs84'); $q = $wgs84->to($nad27, $p); -- Don Reid
Subject: Re: [rt.cpan.org #47956] Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform
Date: Fri, 17 Jul 2009 11:10:31 +0200
To: don via RT <bug-Geo-Point [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* don via RT (bug-Geo-Point@rt.cpan.org) [090716 22:38]: Show quoted text
> Thu Jul 16 18:38:56 2009: Request 47956 was acted upon. > Transaction: Ticket created by don_reid@comcast.net > Subject: Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform > > Geo::Proj->to is calling $myproj4->transform with its remaining > arguments, but Geo::Proj4->transform is lloking for a reference to an > array.
These are artifacts from an internal redesign of the module, some time ago. I do use the module myself, but do not use that method and there are apparently no regression tests for it either. My usual path is simply my $object = Geo::Something->new($projection, @points); my $projected = $object->in($other_projection); I'll try to spend some time on this module later today, to get things fixed-up. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #47956] Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform
Date: Fri, 17 Jul 2009 16:46:43 +0200
To: don via RT <bug-Geo-Point [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* don via RT (bug-Geo-Point@rt.cpan.org) [090716 22:38]: Show quoted text
> Thu Jul 16 18:38:56 2009: Request 47956 was acted upon. > Transaction: Ticket created by don_reid@comcast.net > Queue: Geo-Point > Subject: Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform > > $wgs84 = Geo::Proj->projection('wgs84'); > $p = Geo::Point->latlong(44.0196, -121.7903, 'wgs84'); > $q = $wgs84->to($nad27, $p);
Ok, my verdict ;-) I do not look at the code often, so it took me some time to understand what happens. I will improve the docs in the next release. The Geo::Proj module is the clue to the external Geo::Proj4 module. The latter has a point as array: [ X, Y, Z ] Also the methods in Geo::Proj see a point as [X, Y, Z]. Only the in() method of the Geo::Shape extensions like Geo::Point know better. So, you can either use $p = Geo::Point->latlong(44.0196, -121.7903, 'wgs84'); $q = $p->in($nad27); or my $r = $wgs84->to($nad27, [4.0196, -121.7903]); $q = Geo::Point->latlong($r->[0], $r->[1], 'nad27'); -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #47956] Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform
Date: Fri, 17 Jul 2009 07:54:55 -0700
To: Mark Overmeer via RT <bug-Geo-Point [...] rt.cpan.org>
From: don <don_reid [...] comcast.net>
On Fri, Jul 17, 2009 at 10:47:04AM -0400, Mark Overmeer via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=47956 > > > * don via RT (bug-Geo-Point@rt.cpan.org) [090716 22:38]:
> > Thu Jul 16 18:38:56 2009: Request 47956 was acted upon. > > Transaction: Ticket created by don_reid@comcast.net > > Queue: Geo-Point > > Subject: Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform > > > > $wgs84 = Geo::Proj->projection('wgs84'); > > $p = Geo::Point->latlong(44.0196, -121.7903, 'wgs84'); > > $q = $wgs84->to($nad27, $p);
> > Ok, my verdict ;-) I do not look at the code often, so it took me > some time to understand what happens. I will improve the docs in the > next release. > > The Geo::Proj module is the clue to the external Geo::Proj4 module. > The latter has a point as array: [ X, Y, Z ] Also the methods in > Geo::Proj see a point as [X, Y, Z]. Only the in() method of the > Geo::Shape extensions like Geo::Point know better. > > So, you can either use > $p = Geo::Point->latlong(44.0196, -121.7903, 'wgs84'); > $q = $p->in($nad27); > > or > my $r = $wgs84->to($nad27, [4.0196, -121.7903]); > $q = Geo::Point->latlong($r->[0], $r->[1], 'nad27'); > -- > Regards, > MarkOv
OK, I'll work with those. Thanks for your support of these modules and your assistance. Don
Subject: Re: [rt.cpan.org #47956] Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform
Date: Wed, 29 Jul 2009 13:58:34 -0700
To: bug-Geo-Point [...] rt.cpan.org
From: don_reid [...] comcast.net
Hi, tell me if I am bugging you too much. Perhaps I don't understand something, but I expected to get the coordinates changed. When I use Data::Dumper on $p and $q below I get: $VAR1 = bless( { 'G_proj' => 'wgs84', 'GP_y' => '44.0196', 'GP_x' => '-121.7903' }, 'Geo::Point' ); $VAR1 = bless( { 'G_proj' => 'nad27', 'GP_y' => '44.0196', 'GP_x' => '-121.7903' }, 'Geo::Point' ); Is some other action needed to apply the projection? Don Reid Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=47956 > > > * don via RT (bug-Geo-Point@rt.cpan.org) [090716 22:38]:
>> Thu Jul 16 18:38:56 2009: Request 47956 was acted upon. >> Transaction: Ticket created by don_reid@comcast.net >> Queue: Geo-Point >> Subject: Mismatch in Arguments between Geo::Proj->to and >> Geo::Proj4->transform >> >> $wgs84 = Geo::Proj->projection('wgs84'); >> $p = Geo::Point->latlong(44.0196, -121.7903, 'wgs84'); >> $q = $wgs84->to($nad27, $p);
> > Ok, my verdict ;-) I do not look at the code often, so it took me > some time to understand what happens. I will improve the docs in the > next release. > > The Geo::Proj module is the clue to the external Geo::Proj4 module. > The latter has a point as array: [ X, Y, Z ] Also the methods in > Geo::Proj see a point as [X, Y, Z]. Only the in() method of the > Geo::Shape extensions like Geo::Point know better. > > So, you can either use > $p = Geo::Point->latlong(44.0196, -121.7903, 'wgs84'); > $q = $p->in($nad27); > > or > my $r = $wgs84->to($nad27, [4.0196, -121.7903]); > $q = Geo::Point->latlong($r->[0], $r->[1], 'nad27'); > -- > Regards, > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > Mark@Overmeer.net solutions@overmeer.net > http://Mark.Overmeer.net http://solutions.overmeer.net
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #47956] Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform
Date: Fri, 31 Jul 2009 22:40:22 +0200
To: don via RT <bug-Geo-Point [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* don via RT (bug-Geo-Point@rt.cpan.org) [090729 20:59]: Show quoted text
> Hi, tell me if I am bugging you too much.
Please continue complaining... you do other things than I do, so encounter other problems... and all problems need to be fixed. Show quoted text
> changed. When I use Data::Dumper on $p and $q below I get: > $VAR1 = bless( { > 'G_proj' => 'wgs84', > 'GP_y' => '44.0196', > 'GP_x' => '-121.7903' > }, 'Geo::Point' ); > $VAR1 = bless( { > 'G_proj' => 'nad27', > 'GP_y' => '44.0196', > 'GP_x' => '-121.7903' > }, 'Geo::Point' ); > > Is some other action needed to apply the projection?
This is my program: use Geo::Point; use Geo::Proj; use Data::Dumper; my $wgs84 = Geo::Proj->projection('wgs84'); my $nad27 = Geo::Proj->new ( nick => 'nad27', proj4 => '+proj=latlong +datum=NAD27 +ellps=clrk66', ) or die; my $p = Geo::Point->latlong(44.0196, -121.7903, 'wgs84'); my $q = $p->in('nad27'); warn Dumper $p, $q; It produces: $VAR1 = bless( { 'G_proj' => 'wgs84', 'GP_y' => '44.0196', 'GP_x' => '-121.7903' }, 'Geo::Point' ); $VAR2 = bless( { 'G_proj' => 'nad27', 'GP_y' => '44.0197623060126', 'GP_x' => '-121.789154393739' }, 'Geo::Point' ); I have no idea whether those values are correct, but at least . is different from your outcome (do you have a 64bit perl? 32 bit perl has too small floats) and . differs from each other which means that some calculation has been performed. So? Did I get the correct output? -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #47956] Mismatch in Arguments between Geo::Proj->to and Geo::Proj4->transform
Date: Fri, 31 Jul 2009 13:57:13 -0700
To: bug-Geo-Point [...] rt.cpan.org
From: don_reid [...] comcast.net
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=47956 > > > * don via RT (bug-Geo-Point@rt.cpan.org) [090729 20:59]:
>> Hi, tell me if I am bugging you too much.
> > Please continue complaining... you do other things than I do, so > encounter other problems... and all problems need to be fixed. >
>> changed. When I use Data::Dumper on $p and $q below I get: >> $VAR1 = bless( { >> 'G_proj' => 'wgs84', >> 'GP_y' => '44.0196', >> 'GP_x' => '-121.7903' >> }, 'Geo::Point' ); >> $VAR1 = bless( { >> 'G_proj' => 'nad27', >> 'GP_y' => '44.0196', >> 'GP_x' => '-121.7903' >> }, 'Geo::Point' ); >> >> Is some other action needed to apply the projection?
> > This is my program: > > use Geo::Point; > use Geo::Proj; > use Data::Dumper; > > my $wgs84 = Geo::Proj->projection('wgs84'); > my $nad27 = Geo::Proj->new ( > nick => 'nad27', > proj4 => '+proj=latlong +datum=NAD27 +ellps=clrk66', > ) or die; > > my $p = Geo::Point->latlong(44.0196, -121.7903, 'wgs84'); > my $q = $p->in('nad27'); > > warn Dumper $p, $q; > > It produces: > $VAR1 = bless( { > 'G_proj' => 'wgs84', > 'GP_y' => '44.0196', > 'GP_x' => '-121.7903' > }, 'Geo::Point' ); > $VAR2 = bless( { > 'G_proj' => 'nad27', > 'GP_y' => '44.0197623060126', > 'GP_x' => '-121.789154393739' > }, 'Geo::Point' ); > > I have no idea whether those values are correct, but at least > . is different from your outcome (do you have a 64bit perl? 32 bit > perl has too small floats) and > . differs from each other which means that some calculation has been > performed. > > So? Did I get the correct output?
Thanks, I'll try that on a couple of systems. Yes I have a 64 bit perl, but I'm glad you pointed out the need for it. Your results are what I expected. Don