[mapserver-users] mapserver creating layers group MS , that is displayed in GetCapabilities. how to get rid of it? what is the reason for it?

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Thu Apr 16 10:10:03 PDT 2020


Hi,

Can you point some common WMS server that does not have a root layer? For example all Geoservers have root layer like this https://demo.geo-solutions.it/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities

<Layer>
<Title>GeoServer Web Map Service</Title>

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/.

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.

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 "")?

-Jukka Rahkonen-

Lähettäjä: Zmitser Kozhukh <zmitserk at mail.ru>
Lähetetty: torstai 16. huhtikuuta 2020 19.41
Vastaanottaja: Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi>
Kopio: mapserver-users at lists.osgeo.org
Aihe: 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?

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.
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.
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.
So I guess I will just preprepare custom getcapabilities xmls and configure server to serve them instead of using mapserver for this.
Sincerely, Dimitri

Четверг, 16 апреля 2020, 18:43 +03:00 от Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi<mailto:jukka.rahkonen at maanmittauslaitos.fi>>:


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-bounces at lists.osgeo.org</compose?To=mapserver%2dusers%2dbounces at lists.osgeo.org>> Puolesta Zmitser Kozhukh
Lähetetty: torstai 16. huhtikuuta 2020 17.32
Vastaanottaja: mapserver-users at lists.osgeo.org</compose?To=mapserver%2dusers at 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


--
Zmitser Kozhukh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20200416/acb0e6c7/attachment-0001.html>


More information about the mapserver-users mailing list