<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
p.HTML-esimuotoiltu, li.HTML-esimuotoiltu, div.HTML-esimuotoiltu
        {mso-style-name:HTML-esimuotoiltu;
        mso-style-link:"HTML-esimuotoiltu Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.HTML-esimuotoiltuChar
        {mso-style-name:"HTML-esimuotoiltu Char";
        mso-style-priority:99;
        mso-style-link:HTML-esimuotoiltu;
        font-family:Consolas;}
p.Seliteteksti, li.Seliteteksti, div.Seliteteksti
        {mso-style-name:Seliteteksti;
        mso-style-link:"Seliteteksti Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.SelitetekstiChar
        {mso-style-name:"Seliteteksti Char";
        mso-style-priority:99;
        mso-style-link:Seliteteksti;
        font-family:"Tahoma","sans-serif";}
span.k
        {mso-style-name:k;}
span.s
        {mso-style-name:s;}
span.EmailStyle27
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle28
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle29
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.nb
        {mso-style-name:nb;}
span.EmailStyle31
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Thanks Jukka,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">It works!  I had missed the detail that you could have space separated list in wms_srs specification.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Now I have to see if I can the layers to work also in the cascading WMS services.  <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">You are right about the google proj. I should change to 3857 even if I full control right now.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">/Lars<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Rahkonen Jukka (MML) [mailto:jukka.rahkonen@maanmittauslaitos.fi]
<br>
<b>Sent:</b> den 9 februari 2015 12:03<br>
<b>To:</b> Schylberg Lars; mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [mapserver-users] [EXTERNAL] WMS SRS as variable<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Ok, I start to understand little by little. It is not about making your Mapserver to support several SRS in output, it is about making your Mapserver to send GetMaps to cascaded remote WMS services by using the
 most reasonable SRS in the request, that is, usually the same SRS as used for output so that Mapserver does not need to do interim warping.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I suggest to include enough from the mapfile for making the questions and answers understandable. Let’s take this sample from
<a href="http://mapserver.org/ogc/wms_client.html">http://mapserver.org/ogc/wms_client.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">LAYER<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">  NAME "country_bounds"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">  TYPE RASTER<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">  STATUS ON<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">  CONNECTION "<a href="http://demo.mapserver.org/cgi-bin/wms?">http://demo.mapserver.org/cgi-bin/wms?</a>"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">  CONNECTIONTYPE WMS<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">  METADATA<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">    "wms_srs"             "EPSG:4326"     #<=== THIS CAN BE A SPACE SEPARATED LIST<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">    "wms_name"            "country_bounds"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">    "wms_server_version"  "1.1.1"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">    "wms_format"          "image/gif"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">  END<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">END<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">You would like to use variable substitution in “wms_srs” “EPSG:%srs%”. That is not possible because there are only a few places where substitutions can be used. See
<a href="http://mapserver.org/cgi/runsub.html">http://mapserver.org/cgi/runsub.html</a> and Parameters supported.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">However, if you want to support output in 'EPSG:32633 EPSG:3006 EPSG:900913 EPSG:4326' you can use the same list in the “wms_srs” metadata item of the cascaded WMS layer. Then if you want output in EPSG:32633
 Mapserver will use the same SRS in GetMaps that it is creating and I suppose that it is your goal.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Be aware with EPSG:900913, recent Mapservers do not support it out-of-the-box but you must edit the epsg projection file manually. It would better to use  EPSG:3857 instead but then the remote WMS should also
 understand the meaning of EPSG:3857 .<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">If request rewriting is absolutely needed, like you want to send out EPSG:3857 but remote WMS understands only EPSG:900913 or you need to do some other tailored mapping between the codes, then I suppose you should
  use some miraculous mapscript for rewriting the mapfile.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>