[Mapserver-users] projecting a point in PHP MapScript
Eric Bridger
eric at gomoos.org
Tue Mar 4 00:37:16 PST 2003
Chris,
1) pointObj->project() does not return a point, it just reprojects the
pointObj, so getting a null is not an error.
2) Still the crab_here point is not gettting projected. When I did
something similiar in Perl mapscript, for my UTM projection I used:my
$proj_utm = new
projectionObj('proj=utm,ellps=GRS80,zone=19,north,no_defs');
Eric
On Mon, 2003-03-03 at 22:08, Chris Black wrote:
> Hello all. I have some data in DD that I want to project in UTM (so I
> can plot them on a UTM map). I've written code that I *think* should do
> this:
>
> $crab_here = ms_newpointobj();
> // here's a DD lat/long: 38.20527700 -122.37277700
> $inproj = ms_newProjectionObj("proj=latlong,ellps=clrk66");
> $outproj = ms_newProjectionObj("proj=utm,datum=NAD27,zone=10");
> $crab_here->setXY(38.20527700, -122.37277700);
> $new_obj = $crab_here->project($inproj, $outproj);
> if ($new_obj == null) {print "new_obj is null";} else
> {print("new_obj is "); print($new_obj);}
> print("; x is ");
> print($crab_here->x);
> print("; y is ");
> print($crab_here->y);
>
> But when I run this it prints "new_obj is null; x is 38.205277; y is
> -122.372777", that is, I don't have a new point.
>
> What am I doing wrong?
>
> Thanks.
>
> -- Chris
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
More information about the MapServer-users
mailing list