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 
https://www.mapserver.org/ogc/wms_server.html:

Map Name and wms_title:
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 "".

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?

Discussion about the topic in https://github.com/mapserver/mapserver/issues/5404

And this is from the WMS 1.3.0 standard:

7.2.4.6.2 Title
A <Title> is mandatory for all layers; it is a human-readable string for 
presentation in a menu. The Title is not
inherited by child Layers.
7.2.4.6.3 Name
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
LAYERS parameter of a GetMap request. A Layer that contains a <Name> element is 
referred to as a “named
layer” in this International Standard. If the layer has a Title but no Name, 
then that layer is only a category title for
all the layers nested within. A server that advertises a Layer containing a 
Name element shall be able to accept
that Name as the value of LAYERS argument in a GetMap request and return the 
corresponding map. A client
shall not attempt to request a layer that has a Title but no Name.
A server shall throw a service exception (code="LayerNotDefined") if an invalid 
layer is requested.
A containing category itself may include a Name by which a map portraying all 
of the nested layers can be
requested at once. For example, a parent layer "Roads" may have children 
“Interstates” and “State Highways”
and allow the user to request either child individually or both together.
The Name is not inherited by child Layers.


-Jukka Rahkonen-


Lähettäjä: mapserver-users <mapserver-users-boun...@lists.osgeo.org> Puolesta 
Zmitser Kozhukh
Lähetetty: torstai 16. huhtikuuta 2020 17.32
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] mapserver creating layers group MS , that is displayed 
in GetCapabilities. how to get rid of it? what is the reason for it?

Good day,
I haven’t been using mapserver for a while, but I guess, that since last time I 
have used it, something has changed.
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:
<Layer queryable="1">
<Name>MS</Name>
<Title>MS</Title>
<Abstract>MS</Abstract>
<CRS>EPSG:4326</CRS>
….
after normal layers follow:
        <Layer queryable="1" opaque="0" cascaded="0">
        …..
        </Layer>
        …..
</Layer>
So for me it looks that for no reason the group MS is created which is sort of 
container for all normal layers.
But how to get rid of this MS group?
Sincerely,


--
Zmitser Kozhukh
_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to