[mapserver-users] Mapserver and projcs in geotiff header

Frank Warmerdam warmerdam at pobox.com
Thu Oct 28 06:35:54 PDT 2010


Jørn Vegard Røsnes wrote:
> Hi all,
> 
> just a feature check of Mapserver.
> 
> Should Mapserver read the projection information in the geotiff header, if 
> PROJECTION is not set in the LAYER def. of the map file?
> 
> I'm testing with Mapserv 5.1-dev, and it's not working without PROJECTION, 
> only when PROJECTION is set. 
> I will soon try with a recent version of Mapserver (compiling).

Jørn,

MapServer does not ask the underlying data source for coordinate system
information by default.  However, you can setup a projection block like:

   PROJECTION
     "auto"
   END

to automatically read the projection through GDAL.  This is a little
used feature, so it is possible it is broken now.  The normal projection
block for your coordinate system would look something like:

   PROJECTION
     "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"
   END

If it is intended to be "google mercator" then you should use:

   PROJECTION
     "+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 +nadgrids=@null +no_defs"
   END

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