phpmapscript projection problem(?)
Andreas T
haristeas at GMAIL.COM
Mon Dec 4 13:52:53 PST 2006
Hi!
I have been trying to reproject a point from one projection to an other with
phpmapscript and its projection object (with the PROJ.4 that is enhanced
with phpmapscript). I am using phpmapscript_48.dll (i supose it refers to
version 4.8...).
The original projection of the point that I am trying to reproject is a
greek projection system called "TM3". It has the following attributes:
- projection = *Tranvserse Mercator 3o*
- ellpisoid = bessel
- lon0 = 23ο42' 58''.815
- lat0 = 34
- towgs84 = DX=456.39, DY=372.62, DZ=496,82, DangleX=0, DangleY=0,
DangleZ=0.000363, ppm=0.0000159
- False E = 200000
- False N = 0
- Ellipse big axis = 6377397.155m
- 1/f = 1/299.1528128
- k0 = 0.9999
- units = m
The second projection is the universal WGS84 (LAT/LONG)
The point's initial values are:
X = 134216
Y = 731046
The correct tranformation should have give us:
lon=22.562799
lat=40.3511194
Though I keep taking something like:
lon=22.9206930
lat=40.5838561
The diference seems to be small with naked eye, though it hundreds of
meters...
I have tryed (believe me) with a number of different ways to export the
right lat/long though the result came again and again the same. I provide
the code that I used:
[CODE]
$projInObj = ms_newprojectionobj("proj =tmerc,ellps=bessel,towgs84=456.39,
372.62,496,82,0,0d00m00363s,0.0000159,".
"lat_0=34d0m0s,lon_0=23d42m58815s,x_0=200000,units=m,k=0.9999,a=6378137,rf=
298.25722101");
$projOutObj=ms_newprojectionobj("proj=latlong,ellps=WGS84,DATUM=WGS84");
$myshape = ms_newpointobj();
$myshape->setXY(134216, 731046);
$myshape->project($projOutObj, $projInObj);
print_r($myshape);
[/CODE]
Can you please help me understand why I keep getting bad results? Is it
something that I am doing wrong? Does it have to do with a PROJ problem?
Thanks for the time
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20061204/12c37459/attachment.htm>
More information about the MapServer-users
mailing list