Alexander Mayrhofer wrote:
During debugging i noticed that using the _same_ coordinates and
projection, i get two different marker positions on the map, depending
whether i reproject the marker "manually" using php_mapscript or
via Mapserver itself...
The attached example (also available at
http://map.timatio.com/trace_icon_32.87_9.33_260x150_TEST.jpg ) shows
the problem - the "upper" marker is reprojected using Mapserver, and the
"lower" using php_mapscript, even though they use the same coordinates
and projection. The further away from the equator, the
larger the offset becomes (you can play around with the lat/long
parameters after "_icon_" in the above URL).
The respective lines of code look like this (i _think_ the projection is
absolutely identical for both cases - compare the mapscript lines with
the mapfile below..):
// manual reprojection - weirdness avoidance
$in_proj = ms_newProjectionObj("proj=longlat, ellps=WGS84,
datum=WGS84, no_defs");
$out_proj = ms_newProjectionObj("proj=merc, a=6378137, b=6378137,
lat_ts=0.0, lon_0=0.0, x_0=0.0, y_0=0, k=1.0, units=m, [EMAIL PROTECTED],
no_defs");
Alexander,
First, I wish I could convince people to use the 'new style' projection
definitions! eg. "+proj=merc +a=..." The multiline/comma based approach
can be flakey in surprising ways.
The problem is clearly that one mechanism is apply an ellipsoid based
transformation while the other is using the @null transformation. The
question then is why.
Some parsing weirdness breaking the [EMAIL PROTECTED] might be one
explanation though I don't see any obvious issue with your definitions
so this is a long shot.
Another might be if different versions of PROJ.4 are being used in
MapServer and your php mapscript. Ellipsoid conversion behavior
changed dramatically between PROJ 4.5.0 and 4.6.0. But this is a
bit of a long shot too since your definition is explicit about using
@null which should work the same in either version.
The last is whether or not the null file is being found. Normally this
is done via the PROJ_LIB environment variable. Keep in mind that a
PROJ_LIB setting in your apache .conf for cgi's won't apply to php_mapscript
run as a non-cgi component. Perhaps you could try setting this as a
system environment variable or even remove the null file and see if
both start behaving the same.
Good luck,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, [EMAIL PROTECTED]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo, http://osgeo.org