<HTML><BODY><div>Yes, you are right. Looks like I remembered it wrong. I also have tried different versions of wms : 1.0.0, 1.1.0 … and all have this root layer. So this was just my misconception.</div><div>Regarding root layer name both options (setting wms_rootlayer_name to empty string as well as setting name property of map to empty string) , I think, gave the same result.</div><div>Probably I will ask front end developers to disregard layers with empty name as you suggest. Thanks a lot.</div><div>Sincerely, Dimitri</div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Четверг, 16 апреля 2020, 20:10 +03:00 от Rahkonen Jukka (MML) <jukka.rahkonen@maanmittauslaitos.fi>:<br> <div id=""><div class="js-helper js-readmsg-msg"><style type="text/css"></style><div><div id="style_15870570391458841299_BODY"><div class="class_1587064704"><div class="WordSection1_mailru_css_attribute_postfix"><p class="MsoNormal_mailru_css_attribute_postfix"><span style="mso-fareast-language:EN-US">Hi,</span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span style="mso-fareast-language:EN-US"> </span></p><p class="MsoNormal_mailru_css_attribute_postfix"><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" rel="noopener noreferrer" target="_blank"> https://demo.geo-solutions.it/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities</a></span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"><Layer></span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"><Title>GeoServer Web Map Service</Title></span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="MsoNormal_mailru_css_attribute_postfix"><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 <a href="https://hakku.gtk.fi/locations/wmsserver/" target="_blank">https://hakku.gtk.fi/locations/wmsserver/</a>.</span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="MsoNormal_mailru_css_attribute_postfix"><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.</span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="MsoNormal_mailru_css_attribute_postfix"><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 "")?</span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-</span></p><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><div class="mail-quote-collapse"><div><div style="border-top:solid #e1e1e1 1.0pt; border:none; padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal_mailru_css_attribute_postfix"><b><span lang="EN-US">Lähettäjä:</span></b><span lang="EN-US"> Zmitser Kozhukh <<a href="/compose?To=zmitserk@mail.ru">zmitserk@mail.ru</a>><br><b>Lähetetty:</b> torstai 16. huhtikuuta 2020 19.41<br><b>Vastaanottaja:</b> Rahkonen Jukka (MML) <<a href="/compose?To=jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>><br><b>Kopio:</b> <a href="/compose?To=mapserver%2dusers@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><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?</span></p></div></div><p class="MsoNormal_mailru_css_attribute_postfix"><span lang="EN-US"> </span></p><div><p class="MsoNormal_mailru_css_attribute_postfix">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.</p></div><div><p class="MsoNormal_mailru_css_attribute_postfix">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. </p></div><div><p class="MsoNormal_mailru_css_attribute_postfix">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.</p></div><div><p class="MsoNormal_mailru_css_attribute_postfix">So I guess I will just preprepare custom getcapabilities xmls and configure server to serve them instead of using mapserver for this.</p></div><div><p class="MsoNormal_mailru_css_attribute_postfix">Sincerely, Dimitri</p></div><div><p class="MsoNormal_mailru_css_attribute_postfix"> </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_mailru_css_attribute_postfix">Четверг, 16 апреля 2020, 18:43 +03:00 от Rahkonen Jukka (MML) <<a href="//e.mail.ru/compose/?mailto=mailto%3ajukka.rahkonen@maanmittauslaitos.fi" rel="noopener noreferrer">jukka.rahkonen@maanmittauslaitos.fi</a>>:<br> </p><div id=""><div><div><div id="style_15870518331550761285_BODY_mailru_css_attribute_postfix"><div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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" rel="noopener noreferrer" target="_blank">https://www.mapserver.org/ogc/wms_server.html</a>:</span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">Map Name and wms_title:</span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">Discussion about the topic in <a href="https://github.com/mapserver/mapserver/issues/5404" rel="noopener noreferrer" target="_blank">https://github.com/mapserver/mapserver/issues/5404</a> </span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">And this is from the WMS 1.3.0 standard:</span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">7.2.4.6.2 Title</span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">inherited by child Layers.</span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">7.2.4.6.3 Name</span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><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></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">and allow the user to request either child individually or both together.</span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">The Name is not inherited by child Layers.</span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-</span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><span lang="EN-US" style="mso-fareast-language:EN-US"> </span></p><div><div><div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"><b>Lähettäjä:</b> mapserver-users <<a rel="noopener noreferrer">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 rel="noopener noreferrer">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?</p></div></div></div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"> </p><div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333">Good day,</span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" 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></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" 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></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333"><Name>MS</Name></span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333"><Title>MS</Title></span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333"><Abstract>MS</Abstract></span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333"><CRS>EPSG:4326</CRS></span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333">….</span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333">after normal layers follow:</span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333">        <Layer queryable="1" opaque="0" cascaded="0"></span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333">        …..</span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333">        </Layer></span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333">        …..</span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333"></Layer></span></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" 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></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" 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></p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix" style="background:white"><span style="font-size:11.5pt;font-family:'Arial',sans-serif;color:#333333">Sincerely,</span></p></div></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"> </p></div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix"> </p></div><div><div><div><p class="msonormalmailrucssattributepostfix_mailru_css_attribute_postfix">--<br>Zmitser Kozhukh</p></div></div></div></div></div></div></div></div></div></div></blockquote><div><p class="MsoNormal_mailru_css_attribute_postfix"> </p><div><p class="MsoNormal_mailru_css_attribute_postfix"> </p></div><div><div><div><p class="MsoNormal_mailru_css_attribute_postfix">--<br>Zmitser Kozhukh</p></div></div></div><div><p class="MsoNormal_mailru_css_attribute_postfix"> </p></div></div></div></div></div></div></div></div></div></blockquote><div> <div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Zmitser Kozhukh</div></div></div><div> </div></div></BODY></HTML>