New Proj.4 perl bindings
rand at meridian-enviro.com
rand at meridian-enviro.com
Thu Feb 8 19:08:16 PST 2001
I had found the proj.pm that Steven Lime let leak out on to the
mapserver mailing list (http://mapserver.gis.umn.edu/majordom_lists/archives/mapserver-users/html/0006/msg00131.html)
was somewhat awkward to use, so I decided to wrap my own. Good ol'
free software thinking. :)
I've just finished my first pass at wrapping the proj.4 library, here
is a summary:
use Projection;
my $pj = new Prection(["proj=merc", "ellps=clrk66", "lon_0=-96"], $DEGREES);
($u, $v) = $pj->Forward(-97.0667, 47.9000);
($lat, $lon) = $pj->Inverse($y, $v);
Thats it.
The projection is automatically destroyed, so there isn't a need to
free it. Also, I got rid of the projUV structure. Oh, and the
arguments to making a new projection are automatically counted. (If
you want the default behaviour of using (ugh) radians, just make the
second argument to Projection "$RADIANDS".)
If anybody has any suggestions on improving this, please let me
know. (Does anybody *really* want that projUV structure exported out
into perl?)
I've no documentation, test suite, or much else, yet. But go ahead,
hold your breath, I'll get back to you. ;^)
Oh, the standard
perl Makefile.PL
make
make install
should work.
More information about the MapServer-users
mailing list