[mapserver-users] projection = geographer's pain

Monier Clement clement.monier at v-trafic.com
Mon Oct 27 07:39:18 EDT 2008


Thanks for your answers Roger & Pietro.

I've followed your advice by trying these 4 test-cases :

1) 
Map proj set to :   "init=epsg:3785" (web spherical Mercator, manually added
into espg file)
Layer proj set to : "init=epsg:4326" (latlon wgs84, proj system of my
shapefiles)

=> got a blank map

2) 
Map projection set to : "init=epsg:4326"
Layer projection set to : "init=epsg:4326"

=> got a map

3)
Map projection set to : "init=epsg:3785"
Layer projection set to : "init=epsg:3785"

=> got the same map as 2)

4) 
Map projection set to : "init=epsg:4326"
Layer projection set to : "init=epsg:3785"

=> got a blank map

I've also tried with another well-known existing epsg proj-system (instead
of the manually-added 3785 code), but got the same results.
I've made other attempts by replacing "init=3785" by full description
proj-string like "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs  no_defs"
or "+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"
But it didn't change anything...

It seems that :
- a map is drawn only if the map's and layer's proj-systems are the same.
- the output projection is always overridden by the shapefile system, no
re-projection is done anyway.

Let me know if you have any further leads to solve this issue.

Thanks for your help

Clément	

-----Message d'origine-----
De : mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] De la part de Pietro
Giannini
Envoyé : vendredi 24 octobre 2008 21:40
À : mapserver-users at lists.osgeo.org
Objet : Re: [mapserver-users] projection = geographer's pain

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
>


_______________________________________________
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