[mapserver-users] projection = geographer's pain

Pietro Giannini pgiannini at bytewise.it
Fri Oct 24 15:39:35 EDT 2008


I can confirm that projection is often a pain!

However, the problem may be in the projection of the layer.

The PROJECTION section in a layer declare the projection of the data
source of this layer, while the PROJECTION on the map level is the
projection wich you want to show the whole map. So you can overlay more
data sources in different projection in a single map.

Try to set the layer PROJECTION as "init=epsg:4326".
Let us know...
ciao
........................... pg


-- 
Pietro Giannini
Bytewise srl - Area GIS
41°50'38.58"N 12°29'13.39"E




On Ven, Ottobre 24, 2008 16:55, Monier Clement wrote:
> Hi,
>
>
>
> I'm running MS4W v2.2.8 (including MapServer 5.2) on windows.
>
> My datasource is shapefiles with WGS84 projection (epsg:4326).
>
> I would like MapServer to render these data into a "Web (spherical)
> Mercator" projected map (epsg:3785) in order to perfectly overlay the
> GoogleMaps tile images (for the moment, my maps are slightly shifted
> north.)
>
>
>
> I've added this string at the end of the file "epsg" in /ms4w/proj/nad :
>
> <3785> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
> +y_0=0 +k=1.0 +towgs84=0,0,0,0,0,0,0 +units=m +nadgrids=@null +no_defs <>
>
>
>
> But I don't know how to modify my request and mapfile in order to get the
> correct map.
>
> I've tried many combinations so far but with no success until now.
>
>
>
> Do I have to change the projection system of my shapefiles ?
>
> Is MapServer able to change projection between input and output ?
>
>
>
> Request : "&SRS=epsg:3785"
>
>
>
> MapFile :
>
>
>
> [Map section]
>
>   METADATA
>
>     "wms_srs"   "EPSG:4326 EPSG:3785" # is this correct ?
>
>   END
>
>
>
> PROJECTION
>
>    "init=epsg:3785" # is this correct ?
>
> END
>
>
>
> [Layer section]
>
>   METADATA
>
>     "wms_srs"   "EPSG:3785" # is this correct ?
>
>   END
>
>   PROJECTION
>
>    "init=epsg:3785" # is this correct ?
>
>   END
>
>
>
> With these settings, the pictures I got from MapServer are still shifted.
>
>
>
> Thanks for your help
>
>
>
> Clement
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>




More information about the mapserver-users mailing list