[Mapserver-users] setprojection, need clarification

Debbie Pagurek pagurekd at agr.gc.ca
Tue Apr 15 16:06:16 EDT 2003


I am looking at the php/mapscript documentation at:http://mapserver.gis.umn.edu/doc36/phpmapscript-class-guide.html
and I'd like some clarification about setProjection.

  int setProjection(string proj_params, boolean bSetUnitsAndExtents)
         Set map projection and coordinate system.  Parameters are given as 
         a single string of comma-delimited PROJ.4 parameters.
         The argument bSetUnitsAndExtents is used to automatically update
         the map units and extents based on the new projection. Possible 
         values are MS_TRUE and MS_FALSE. By default it is set to MS_FALSE.


When would you use the "boolean bSetUnitsAndExtents" parameter and set it to MS_TRUE?

Just wondering because I have a map file that is in decimal degrees (proj=latlong).  In an application, I am changing the projection to Robinson on the fly (proj=robin,lon_0=0,x_0=0,y_0=0) and all is working fine, except that the scalebar is not appearing correctly.  I have made sure to change the overall map units to meters ( $map->set("units","MS_METERS");  ) and I am also updating the mapextents with appropriate extents in meters.  As I said, the actual map is appearing just fine, it's just the scalebar that isn't making sense - showing something as 360km when it really should be more like 10000+ km.

Any help would be much appreciated!

D. Pagurek





More information about the mapserver-users mailing list