[mapserver-users] need help with projection problems with php
David Armstrong
david.armstrong at ntlworld.com
Wed Jan 23 08:48:04 PST 2002
Still having problems getting projection to work in mapserver, and i saw
yesterday John Arthur's message to the list along with Franks reply.
However once i modified the code to accept the datum values , the code stops
and errors on the pj_transform () line.
am i missing any variables or calling the function incorrectly.
Can anyone test this out that's projection minded !
any pointers ! ?
Regards
Dave
############# php code ################
<?
dl("php_mapscript_35.dll");
dl("php_proj.dll");
$lat = doubleval("336276.6563");
$lon = doubleval("4145316.5");
$parms[0] = "proj=utm";
$parms[1] = "ellps=clrk66";
$parms[2] = "datum=NAD27"; # also need to use wgs84 for gps as an input
also ! any ideas
$parms[3] = "zone=18";
$parms[4] = "no_defs";
$projUTM = pj_init($parms);
$parms[0] = "proj=latlong";
$parms[1] = "ellps=GRS80";
$parms[2] = "datum=NAD83";
$parms[3] = "lat_0=36.0";
$parms[4] = "lon_0=-79.5";
$parms[5] = "lat_1=37.0";
$parms[6] = "lat_2=39.5";
$projGEO = pj_init($parms);
$ret = pj_transform($projUTM, $projGEO, $lat, $lon ,0);
$ln = ($ret["u"]);
$lt = ($ret["v"]);
echo "<BR>".$ln."<BR>".$lt;
#This returns:
#-76.8507223773
#37.442055949314
#Which is NAD27, but should return:
#-76.850410
#37.442204
#Which is NAD83
?>
More information about the MapServer-users
mailing list