[Mapserver-users] projecting a point in PHP MapScript

Chris Black cblack at CalAcademy.Org
Mon Mar 3 14:08:03 PST 2003


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




More information about the MapServer-users mailing list