phpmapscript projection problem(?)

Andreas T haristeas at GMAIL.COM
Tue Dec 5 09:35:17 EST 2006


I sent an other reply today this morning though it has not appeared yet, so
I suppose I must rewrite it and resend it. So...

Let's take a more standard tranformation and let's (together) evaluate the
results.
I will use as my starting coordinate system the standard greek grid system
(GGRS87). As found on the web page
http://cvs.gis.umn.edu/cgi-bin/viewcvs/mapserver_docs/proj.html?rev=1.2#GGRS87%20/%20Greek%20Grid
the parameters of this system are:
    proj=tmerc
    lat_0=0.000000000
    lon_0=24.000000000
    k=0.999600
    x_0=500000.000
    y_0=0.000
    ellps=GRS80
    towgs84=-199.87,74.79,246.62,0,0,0,0
    units=m
    no_defs
Here, I will inform that the greek system has its borders on
Xmin = 80000
Xmax = 1050000
Ymin = 3760000
Ymax = 4660000

Supposing that these params are official and accepted enough, I step over to
the tranformation from this system (GGRS87) to WGS84.
So we have the following code:

[CODE]
// Projections declaration
$projInObj=ms_newprojectionobj("proj=tmerc,ellps=GRS80,towgs84=-199.87,74.79
,246.62,0,0,0,0,units=m,lon_0=24,k=0.9996,x_0=500000,no_defs")
$projOutObj=ms_newprojectionobj("proj=latlong,ellps=WGS84,DATUM=WGS84,no_defs");

// Shape to be reprojected
$myshape = ms_newpointobj();
$myshape->setXY(552000, 4098077);

// Some code to confirm initial values
print_r($myshape);
echo "<p />";

$myshape->project($projInObj, $projOutObj);

// Code to get the final values
print_r($myshape);
[/CODE]

The expected result (according to very reliable software like ArcGIS and
others...) is:
lon=24,351076881,lat=37,014812887
Though! the result that I get from mapscript is:
lon=24.585568772,lat=37.028433901

Again it seems to a small difference but the truth is that we have to deal
with a very large difference on the results!

I did test the tranformation with different values. I provide some triads of
input and output:
<triad 1>
Input:                X=100000, Y=4000000
Expected:         lon:19,334046546,lat:36,035407643
mapscript gave: lon:19.560466687 lat:36.063361179
</triad 1>

<triad 2>
Input:                X=400000, Y=4200000
Expected:         lon:22,514890564,lat:37,564089629
mapscript gave: lon:22.862809496,lat:37.943105553
</triad 2>

<triad 3>
Input:                X=700000, Y=4400000
Expected:         lon:26,200754084,lat:39,434436875
mapscript gave: lon:26.334654875,lat:39.727476986
</triad 3>

<triad 4>
Input:                X=1000000, Y=4600000
Expected:         lon:29,585420281,lat:41,235432698
mapscript gave: lon:29.980956617,lat:41.396983529
</triad 4>

I can't relize any sytematic error. The only thing that can mention by a
first look is that I get bad results. And, once again, I ask: Do I do
something wrong or are there any limitations on the PROJ or the mapscript
that I must know?

Thanks on advance

Andreas Trantidis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20061205/fbcf7e51/attachment.html


More information about the mapserver-users mailing list