<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 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;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormalmailrucssattributepostfix, li.msonormalmailrucssattributepostfix, div.msonormalmailrucssattributepostfix
        {mso-style-name:msonormal_mailru_css_attribute_postfix;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.Shkpostityyli20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
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="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Can you point some common WMS server that does not have a root layer? For example all Geoservers have root layer like this
<a href="https://demo.geo-solutions.it/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities">
https://demo.geo-solutions.it/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><Layer><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><Title>GeoServer Web Map Service</Title><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">This is an ArcGIS server and it seems to have root layer with title but without a name as well https://hakku.gtk.fi/locations/wmsserver/.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">OpenLayers can certainly parse GetCapabilities from common WMS servers. The nested layers are there, I guess, for making it possible to categorize layers and thus help with building
 a user friendly presentation of the layers. But if you parse only the layers with name and skip layers with just title the result might please you.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">However, it should be possible to make Mapserver to have a root layer with just title, that is mandatory, but without name. Do you mean that your root layer has always name even if your
 MAP has an empty name (NAME "") or if you have set an empty name for it in MAP-METADATA (wms_rootlayer_name "")?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">Lähettäjä:</span></b><span lang="EN-US"> Zmitser Kozhukh <zmitserk@mail.ru>
<br>
<b>Lähetetty:</b> torstai 16. huhtikuuta 2020 19.41<br>
<b>Vastaanottaja:</b> Rahkonen Jukka (MML) <jukka.rahkonen@maanmittauslaitos.fi><br>
<b>Kopio:</b> mapserver-users@lists.osgeo.org<br>
<b>Aihe:</b> Re[2]: [mapserver-users] mapserver creating layers group MS , that is displayed in GetCapabilities. how to get rid of it? what is the reason for it?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal">Thank you Jukka! For me it is surprise to find out that there is a such thing as a root layer. Do you know if it is possible to disable it? Or is it just natural way how mapserver parses mapfile into getcapabilities xml? I would rather
 prefer to have list of separate layers in getcapabilities.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I have tried to set the name of the root layer to empty string, also the name of the map I was setting to empty string, also tried to put metadata ows_enable_request to ‘!*’ but the root layer still appears in GetCapabilities. In case when
 I omit wms_title and wms_abstract on the Map object level, it is still substituted to ‘MS’ automatically by mapserver. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">For me personally, this requirement to have root layer partially makes sense, but the customer , who uses OL to read getcapabilities of wms services, that I am preparing, is bothered by having root layer there — it is meaningless and not
 needed for him.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">So I guess I will just preprepare custom getcapabilities xmls and configure server to serve them instead of using mapserver for this.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Sincerely, Dimitri<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #0857A6 1.0pt;padding:0cm 0cm 0cm 8.0pt;margin-left:7.5pt;margin-top:7.5pt;margin-right:7.5pt;margin-bottom:7.5pt">
<p class="MsoNormal">Четверг, 16 апреля 2020, 18:43 +03:00 от Rahkonen Jukka (MML) <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>>:<br>
 <o:p></o:p></p>
<div id="">
<div>
<div>
<div id="style_15870518331550761285_BODY">
<div>
<div>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">WMS service does not actually need to have a root layer but usually it exists. Each layer must have a title but name in optional. If layer does not hava a name
 it cannot be accessed with GetMap so what you need to do is to get rid of the name of your root layer. How to do that is documented in
<a href="https://www.mapserver.org/ogc/wms_server.html" target="_blank">https://www.mapserver.org/ogc/wms_server.html</a>:</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">Map Name and wms_title:</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">WMS Capabilities requires a Name and a Title tag for every layer. The Map’s NAME and wms_title metadata will be used to set the root layer’s name and title in
 the GetCapabilities XML output. The root layer in the WMS context corresponds to the whole mapfile. You can suppress the root layer’s name by setting wms_rootlayer_name to "".</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">There has been some changes in configuring the name of the root layer. Earlier it just took the NAME from the MAP level if it was not left empty. Do you perhaps
 have “MS” as a name of your mapfile now?</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">Discussion about the topic in
<a href="https://github.com/mapserver/mapserver/issues/5404" target="_blank">https://github.com/mapserver/mapserver/issues/5404</a>
</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">And this is from the WMS 1.3.0 standard:</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">7.2.4.6.2 Title</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">A <Title> is mandatory for all layers; it is a human-readable string for presentation in a menu. The Title is not</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">inherited by child Layers.</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">7.2.4.6.3 Name</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">If, and only if, a layer has a <Name>, then it is a map layer that can be requested by using that Name in the</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">LAYERS parameter of a GetMap request. A Layer that contains a <Name> element is referred to as a “named</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">layer” in this International Standard. If the layer has a Title but no Name, then that layer is only a category title for</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">all the layers nested within. A server that advertises a Layer containing a Name element shall be able to accept</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">that Name as the value of LAYERS argument in a GetMap request and return the corresponding map. A client</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">shall not attempt to request a layer that has a Title but no Name.</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">A server shall throw a service exception (code="LayerNotDefined") if an invalid layer is requested.</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">A containing category itself may include a Name by which a map portraying all of the nested layers can be</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">requested at once. For example, a parent layer "Roads" may have children “Interstates” and “State Highways”</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">and allow the user to request either child individually or both together.</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">The Name is not inherited by child Layers.</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-</span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="msonormalmailrucssattributepostfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<div>
<div>
<div>
<div>
<p class="msonormalmailrucssattributepostfix"><b>Lähettäjä:</b> mapserver-users <<a href="/compose?To=mapserver%2dusers%2dbounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>>
<b>Puolesta </b>Zmitser Kozhukh<br>
<b>Lähetetty:</b> torstai 16. huhtikuuta 2020 17.32<br>
<b>Vastaanottaja:</b> <a href="/compose?To=mapserver%2dusers@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<b>Aihe:</b> [mapserver-users] mapserver creating layers group MS , that is displayed in GetCapabilities. how to get rid of it? what is the reason for it?<o:p></o:p></p>
</div>
</div>
</div>
<p class="msonormalmailrucssattributepostfix"> <o:p></o:p></p>
<div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">Good day,</span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">I haven’t been using mapserver for a while, but I guess, that since last time I have used it, something has changed.</span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">Now when I am querying GetCapabilities of WMS service, created by Mapserver (version 7.2.0 running on a linux
 server), it puts everying in ‘MS’ layer group. But I don’t have any MS group defined in mapfile. Could anyone explain how to get rid of this MS group in GetCapabilities xml? This is how it looks in xml:<br>
<Layer queryable="1"></span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333"><Name>MS</Name></span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333"><Title>MS</Title></span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333"><Abstract>MS</Abstract></span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333"><CRS>EPSG:4326</CRS></span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">….</span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">after normal layers follow:</span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">        <Layer queryable="1" opaque="0" cascaded="0"></span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">        …..</span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">        </Layer></span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">        …..</span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333"></Layer></span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">So for me it looks that for no reason the group MS is created which is sort of container for all normal layers.</span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">But how to get rid of this MS group?</span><o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix" style="background:white"><span style="font-size:11.5pt;font-family:"Arial",sans-serif;color:#333333">Sincerely,</span><o:p></o:p></p>
</div>
</div>
<div>
<p class="msonormalmailrucssattributepostfix"> <o:p></o:p></p>
</div>
<div>
<p class="msonormalmailrucssattributepostfix"> <o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="msonormalmailrucssattributepostfix">--<br>
Zmitser Kozhukh<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">--<br>
Zmitser Kozhukh<o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>