Perl mapscript reprojecting WKT issues

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Tue May 29 15:14:15 EDT 2007


> Kralidis,Tom [Burlington] writes: 
> 
> > Hi,
> > 
> > MapServer 4.10.0
> > FreeBSD
> > 
> > I have a Perl script where I'd like to reproject a WKT 
> string.  Here's 
> > the code:
> > 
> > #!/usr/bin/perl
> >  
> > use strict;
> > use warnings;
> >  
> > use mapscript 4.10.0;
> >  
> > my $projInObj  = new mapscript::projectionObj("init=epsg:4326");
> > my $projOutObj = new mapscript::projectionObj("init=epsg:42304");
> >  
> > my $shape = mapscript::shapeObj::fromWKT("POINT(-75 45)");
> >  
> > print $shape->toWKT()."\n";
> >  
> > $shape->project($projInObj, $projOutObj) || die "Can't reproject: 
> > $!\n";
> >  
> > print $shape->toWKT()."\n";
> > 
> > The script dies on the shapeObj project call. 
> > 
> > Any suggestions or ideas?

Can anyone run this script (you might have to change epsg:42304 if you
don't have it defined in your proj epsg file) successfully?

I notice that this functionality was as a result of RFC2
(http://mapserver.gis.umn.edu/development/rfc/ms-rfc-2).  Just not sure
if it's my syntax that's off or if this could be a potential bug?

..Tom



More information about the mapserver-users mailing list