[Mapserver-users] documentation bug (was Re: projecting a point in PHP MapScript)

Frank Warmerdam warmerdam at pobox.com
Wed Mar 5 14:27:03 EST 2003


Chris Black wrote:
> Ok, I've stepped up to 3.7, which I downloaded as 
> mapserver-3.7-win32-php4.3.0-gd2.zip from 
> http://www2.dmsolutions.ca/mapserver/dl/ (since I'm on Windows, I'm 
> trying to avoid doing any compilation myself).
> 
> The behavior has changed somewhat; I now get an explicit failed return 
> code and an error message.  I'm still not succeeding.  Is there any way 
> to get a more explicit error message about why the projection is 
> failing?  Is there a different 3.7 binary and libraries I should try?


Chris,

Generally speaking it is hard to get meaningful error messages from PROJ.4
explaining failure, but a good start is to do testing with the "cs2cs"
commandline program distributed with PROJ.4.

cs2cs +proj=latlong +ellps=clrk66 +to +proj=utm +zone=10 +datum=NAD27 \
   +ellps=clrk66 +units=m +no_defs +north
38.2052770 -122.37277700
*       * 0.000

Well, this fails because you have X and Y backwards.  I assume you want to
translate the location 122.372777E, 38.2052770N? Even though the coordinate
system is called latlong (longlat also works) the order is latitude,longitude.

Second, you provide a datum definition for one coordinate system but not
the other.  This seems to cause a problem.  If I change to just listing
the ellipses things seem OK:

cs2cs +proj=latlong +ellps=clrk66 +to +proj=utm +zone=10 +ellps=clrk66 +units=m +no_defs +north
-122.372777 38.2052770
554916.29       4228571.08 0.000

So, try correcting these problems in your script.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the mapserver-users mailing list