Subject: | Doesn't work with cities in the eastern hemisphere? |
Date: | Wed, 19 Jun 2019 00:38:02 +0000 |
To: | "bug-Geo-Proj4 [...] rt.cpan.org" <bug-Geo-Proj4 [...] rt.cpan.org> |
From: | "Rowe, Thomas" <rowet [...] metsci.com> |
use warnings;
use strict;
use feature ':5.14';
use Geo::Proj4;
my $proj_from = Geo::Proj4->new("+proj=latlong +datum=WGS84 +ellps=WGS84") or die "parameter error: ".Geo::Proj4->error. "\n";
my $proj_to = Geo::Proj4->new("+proj=eqc +datum=WGS84 +ellps=sphere +lat_ts=0") or die "parameter error: ".Geo::Proj4->error. "\n";
my $philadelphia = [ 39, -75];
my $sydney = [-33, 151];
my $tokyo = [ 35, 139];
my $london = [ 51, 0];
for ($philadelphia, $sydney, $tokyo, $london) {
my @p = @{$proj_from->transform($proj_to, $_)} or die Geo::Proj4->error;
say join ' ', @p;
}
__END__
Output:
4336600.09710257 -8328886.09705354 -12800.9191526175
inf inf
inf inf
5670938.58851874 0 7140.00000000093