Hi Monier,<br><br>My understanding of how this works is as follows.<br><br>Assuming your data is in epsg:4326, and you wish to display it in epsg:3785:<br><br>1) Your LAYER needs to reflect epsg:4326.<br>&nbsp;&nbsp;&nbsp; PROJECTION<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;init=epsg:4326&quot;<br>&nbsp;&nbsp;&nbsp; END<br><br>2) Your layer also needs to have a wms_srs parameter in the METADATA section to allow for the layer to be requested in epsg:3785, ie<br>&nbsp;&nbsp;&nbsp; METADATA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;wms_srs&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;EPSG:4326 EPSG:3785&quot;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;wms_name&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;counties&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;wms_server_version&quot;&nbsp; &quot;1.1.1&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;wms_format&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;image/png&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;wms_onlineresource&quot;&nbsp; &quot;<a href="http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/states.map&amp;" target="_blank">http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/states.map&amp;</a>&quot;<br>

&nbsp;&nbsp;&nbsp; END<br><br>3) Your request to Mapserver needs to define the extents of the image you want , <i>in the units of the projection.&nbsp; </i>So a valid request for the layer above would be:<br><br><a href="http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/test/test.map" target="_blank">http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/states/state.map</a><br>

&amp;layers=counties<br>&amp;srs=EPSG%3A3785<br>&amp;version=1.1.1<br>&amp;bbox=-20037508.34%2C-<div id=":yh" class="ArwC7c ckChnd">20037508.34%2C-10018754.1704%2C-10018754.1704<br>&amp;service=WMS<br>&amp;width=256<br>&amp;styles=<br>
&amp;format=image%2Fpng<br>
&amp;request=GetMap<br>&amp;height=25</div><br>Hope that helps,<br><br>Roger<br>--<br><div class="gmail_quote">
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Monier Clement wrote:<br>
<br>
Hi,<br>
<br>
There is bigger than tiny difference in extents in epsg:4326 and in epsg:3785. &nbsp;The latter is using meters as an unit.<br>
I had a try with Finland polygon and here are the results:<br>
<br>
D:\TEMP&gt;ogrinfo -summary Finland_WGS84.shp Finland_WGS84<br>
Feature Count: 1<br>
Extent: (19.648331, 59.804989) - (31.587299, 70.079422)<br>
<br>
D:\TEMP&gt;ogr2ogr -f &quot;ESRI Shapefile&quot; -s_srs epsg:4326 -t_srs epsg:900913 Finland_<br>
Spherical.shp Finland_WGS84.shp<br>
<br>
D:\TEMP&gt;ogrinfo -summary Finland_Spherical.shp Finland_Spherical<br>
Feature Count: 1<br>
Extent: (2187242.167179, 8356448.200347) - (3516282.078834, 11094615.004724)<br>
<br>
-Jukka-<br>
<br>
<br>
&gt; Hi,<br>
&gt;<br>
&gt; I got the map extent from shpinfo.<br>
&gt; Beside, I know that there should only be a tiny difference<br>
&gt; between coordinates in latlon-wgs84 (data proj) and &quot;web<br>
&gt; spherical mercator&quot; (map proj).<br>
&gt;<br>
&gt; You&#39;ll find the whole test-case files as attachement.<br>
&gt;<br>
&gt; Here&#39;s the command line to get the map :<br>
&gt; C:\ms4w\tools\mapserv\shp2img -m<br>
&gt; C:\ms4w\apps\gmap\htdocs\test.map -o test.png -l layer1 -i agga<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt; Clément<br>
&gt;<br>
&gt;<br>
&gt; -----Message d&#39;origine-----<br>
&gt; De&nbsp;: Rahkonen Jukka [mailto:<a href="mailto:Jukka.Rahkonen@mmmtike.fi" target="_blank">Jukka.Rahkonen@mmmtike.fi</a>]<br>
&gt; Envoyé&nbsp;: lundi 27 octobre 2008 12:46<br>
&gt; À&nbsp;: Monier Clement; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a> Objet&nbsp;:<br>
&gt; VS: [mapserver-users] projection = geographer&#39;s pain<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; Have you double-checked that your map extent correspods with<br>
&gt; the map projection?<br>
&gt; Or if you could send your whole mapfile I am pretty sure that<br>
&gt; you will get a final answer to your problem.<br>
&gt;<br>
&gt; -Jukka Rahkonen-<br>
&gt;<br>
&gt; &gt; -----Alkuperäinen viesti-----<br>
&gt; &gt; Lähettäjä: <a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a><br>
&gt; &gt; [mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>] Puolesta Monier<br>
&gt; &gt; Clement<br>
&gt; &gt; Lähetetty: 27. lokakuuta 2008 13:39<br>
&gt; &gt; Vastaanottaja: &#39;Pietro Giannini&#39;; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
&gt; &gt; Aihe: RE: [mapserver-users] projection = geographer&#39;s pain<br>
<div><div></div><div>&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Thanks for your answers Roger &amp; Pietro.<br>
&gt; &gt;<br>
&gt; &gt; I&#39;ve followed your advice by trying these 4 test-cases :<br>
&gt; &gt;<br>
&gt; &gt; 1)<br>
&gt; &gt; Map proj set to : &nbsp; &quot;init=epsg:3785&quot; (web spherical Mercator,<br>
&gt; &gt; manually added<br>
&gt; &gt; into espg file)<br>
&gt; &gt; Layer proj set to : &quot;init=epsg:4326&quot; (latlon wgs84, proj<br>
&gt; system of my<br>
&gt; &gt; shapefiles)<br>
&gt; &gt;<br>
&gt; &gt; =&gt; got a blank map<br>
&gt; &gt;<br>
&gt; &gt; 2)<br>
&gt; &gt; Map projection set to : &quot;init=epsg:4326&quot;<br>
&gt; &gt; Layer projection set to : &quot;init=epsg:4326&quot;<br>
&gt; &gt;<br>
&gt; &gt; =&gt; got a map<br>
&gt; &gt;<br>
&gt; &gt; 3)<br>
&gt; &gt; Map projection set to : &quot;init=epsg:3785&quot;<br>
&gt; &gt; Layer projection set to : &quot;init=epsg:3785&quot;<br>
&gt; &gt;<br>
&gt; &gt; =&gt; got the same map as 2)<br>
&gt; &gt;<br>
&gt; &gt; 4)<br>
&gt; &gt; Map projection set to : &quot;init=epsg:4326&quot;<br>
&gt; &gt; Layer projection set to : &quot;init=epsg:3785&quot;<br>
&gt; &gt;<br>
&gt; &gt; =&gt; got a blank map<br>
&gt; &gt;<br>
&gt; &gt; I&#39;ve also tried with another well-known existing epsg proj-system<br>
&gt; &gt; (instead of the manually-added 3785 code), but got the same results.<br>
&gt; &gt; I&#39;ve made other attempts by replacing &quot;init=3785&quot; by full<br>
&gt; description<br>
&gt; &gt; proj-string like &quot;+proj=longlat +ellps=WGS84<br>
&gt; &gt; +datum=WGS84 +no_defs &nbsp;no_defs&quot;<br>
&gt; &gt; or &quot;+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0<br>
&gt; &gt; +x_0=0.0 +y_0=0<br>
&gt; &gt; +k=1.0 +units=m +nadgrids=@null &nbsp;no_defs&quot;<br>
&gt; &gt; But it didn&#39;t change anything...<br>
&gt; &gt;<br>
&gt; &gt; It seems that :<br>
&gt; &gt; - a map is drawn only if the map&#39;s and layer&#39;s proj-systems are the<br>
&gt; &gt; same.<br>
&gt; &gt; - the output projection is always overridden by the<br>
&gt; shapefile system,<br>
&gt; &gt; no re-projection is done anyway.<br>
&gt; &gt;<br>
&gt; &gt; Let me know if you have any further leads to solve this issue.<br>
&gt; &gt;<br>
&gt; &gt; Thanks for your help<br>
&gt; &gt;<br>
&gt; &gt; Clément<br>
&gt; &gt;<br>
&gt; &gt; -----Message d&#39;origine-----<br>
&gt; &gt; De&nbsp;: <a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a><br>
&gt; &gt; [mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>] De la part<br>
&gt; de Pietro<br>
&gt; &gt; Giannini Envoyé&nbsp;: vendredi 24 octobre 2008 21:40 À<br>
&gt; &gt; : <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a> Objet&nbsp;: Re:<br>
&gt; &gt; [mapserver-users] projection = geographer&#39;s pain<br>
&gt; &gt;<br>
&gt; &gt; I can confirm that projection is often a pain!<br>
&gt; &gt;<br>
&gt; &gt; However, the problem may be in the projection of the layer.<br>
&gt; &gt;<br>
&gt; &gt; The PROJECTION section in a layer declare the projection of<br>
&gt; the data<br>
&gt; &gt; source of this layer, while the PROJECTION on the map level is the<br>
&gt; &gt; projection wich you want to show the whole map. So you can overlay<br>
&gt; &gt; more data sources in different projection in a single map.<br>
&gt; &gt;<br>
&gt; &gt; Try to set the layer PROJECTION as &quot;init=epsg:4326&quot;.<br>
&gt; &gt; Let us know...<br>
&gt; &gt; ciao<br>
&gt; &gt; ........................... pg<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Pietro Giannini<br>
&gt; &gt; Bytewise srl - Area GIS<br>
&gt; &gt; 41°50&#39;38.58&quot;N 12°29&#39;13.39&quot;E<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Ven, Ottobre 24, 2008 16:55, Monier Clement wrote:<br>
&gt; &gt; &gt; Hi,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I&#39;m running MS4W v2.2.8 (including MapServer 5.2) on windows.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; My datasource is shapefiles with WGS84 projection (epsg:4326).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I would like MapServer to render these data into a &quot;Web<br>
&gt; (spherical)<br>
&gt; &gt; &gt; Mercator&quot; projected map (epsg:3785) in order to perfectly<br>
&gt; &gt; overlay the<br>
&gt; &gt; &gt; GoogleMaps tile images (for the moment, my maps are<br>
&gt; slightly shifted<br>
&gt; &gt; &gt; north.)<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I&#39;ve added this string at the end of the file &quot;epsg&quot; in<br>
&gt; &gt; /ms4w/proj/nad :<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &lt;3785&gt; +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0<br>
&gt; &gt; +lon_0=0.0 +x_0=0.0<br>
&gt; &gt; &gt; +y_0=0 +k=1.0 +towgs84=0,0,0,0,0,0,0 +units=m<br>
&gt; &gt; +nadgrids=@null +no_defs &lt;&gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; But I don&#39;t know how to modify my request and mapfile in<br>
&gt; &gt; order to get the<br>
&gt; &gt; &gt; correct map.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I&#39;ve tried many combinations so far but with no success until now.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Do I have to change the projection system of my shapefiles ?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Is MapServer able to change projection between input and output ?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Request : &quot;&amp;SRS=epsg:3785&quot;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; MapFile :<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; [Map section]<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; METADATA<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &quot;wms_srs&quot; &nbsp; &quot;EPSG:4326 EPSG:3785&quot; # is this correct ?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; END<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; PROJECTION<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp;&quot;init=epsg:3785&quot; # is this correct ?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; END<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; [Layer section]<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; METADATA<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &quot;wms_srs&quot; &nbsp; &quot;EPSG:3785&quot; # is this correct ?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; END<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; PROJECTION<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp;&quot;init=epsg:3785&quot; # is this correct ?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; END<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; With these settings, the pictures I got from MapServer are<br>
&gt; &gt; still shifted.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thanks for your help<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Clement<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; mapserver-users mailing list<br>
&gt; &gt; &gt; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
&gt; &gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; mapserver-users mailing list<br>
&gt; &gt; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
&gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; mapserver-users mailing list<br>
&gt; &gt; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
&gt; &gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt; &gt;<br>
&gt;<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</div></div></blockquote></div><br>