For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > March 2004 > RFC: New Module Geo::MapProjection









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RFC: New Module Geo::MapProjection
Andrew Westrate

2004-03-19, 12:55 pm

Hello all,

A year or so ago, I wrote a cartographic program which plots latitude
and longitude in SVG (Scalable Vector Graphics). At the time, I knew of
no Perl module which would perform map projections, so I wrote one,
thinking I might later add it to CPAN. However, between the time I
wrote it, and the time I thought again of posting it, the following have
appeared:

Cartography::Projection::GCTP
PDL::Transform::Cartography

One of these simply ties in to a external library, while the other
appears has, IMO, somewhat strange syntax and an odd namespace.

There this module name has been registered, but it has never had any
files added to it for a long time:
Geo::Projection


So, my question is, is there any need for another one, or should I just
forget about adding it? On the pro side:
my module is Pure Perl
it has a simple syntax
it has a couple projections the others lack (including Winkel Tripel,
which is the map projection used by National Geographic)
it has functions for getting characteristics of the map projection
itself, such as is it equal area, is it conformal, is it equidistant, etc.


Here's an example of the synxtax:

use Geo::MapProjection;

@projection_names = Geo::MapProjection->available_projections;

$projection = "winkel_tripel";
$mp = Geo::MapProjection->new($projection);

my $is_equal_area = $mp->equal_area();
my $is_conformal = $mp->conformal();
my $is_equidistant = $mp->equidistant();
my $is_azimuthal = $mp->azimuthal();

foreach my $tuple (...) {
my ($lat, $long) = @{ $tuple };

my ($x, $y) = $mp->project($lat, $long);
}


Thanks,
Andy Westrate
Slaven Rezic

2004-03-19, 12:56 pm

Andrew Westrate <andywestrate.SP@M.yahoo.com> writes:

> Hello all,
>
> A year or so ago, I wrote a cartographic program which plots latitude
> and longitude in SVG (Scalable Vector Graphics). At the time, I knew
> of no Perl module which would perform map projections, so I wrote one,
> thinking I might later add it to CPAN. However, between the time I
> wrote it, and the time I thought again of posting it, the following
> have appeared:
>
> Cartography::Projection::GCTP
> PDL::Transform::Cartography
>
> One of these simply ties in to a external library, while the other
> appears has, IMO, somewhat strange syntax and an odd namespace.
>
> There this module name has been registered, but it has never had any
> files added to it for a long time:
> Geo::Projection
>
>
> So, my question is, is there any need for another one, or should I
> just forget about adding it? On the pro side:
> my module is Pure Perl
> it has a simple syntax
> it has a couple projections the others lack (including Winkel
> Tripel, which is the map projection used by National Geographic)
> it has functions for getting characteristics of the map
> projection itself, such as is it equal area, is it conformal, is it
> equidistant, etc.
>


Yes, we need this one! I am awaiting your CPAN upload...

Regards,
Slaven

--
Slaven Rezic - slaven@rezic.de

tknotes - A knotes clone, written in Perl/Tk.
http://ptktools.sourceforge.net/#tknotes
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com