-
-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add metadata to optionally not emit root layer name in WMS Capabilities XML #5404
Comments
|
Hi,
The proper fix is to tell MapServer to not emit the root layer name via something like wms_rootlayer_name_enabled
For my mind the default value should be to not emit the root layer name because in most cases users do not really want to do that. Same discussion was going on in the Geoserver issue tracker some time ago https://osgeo-org.atlassian.net/browse/GEOS-7935.
…
|
|
cc @dmorissette @rouault for thoughts. @jratike80 I would tend to agree however I'm not sure how many installations utilize the functionality (imagine a 2 layer mapfile where is it easy to just call the root layer) already, so the concern is breaking existing applications. |
|
FYI PR in #5405 pending consensus. |
|
Copy of the the comment that I wrote to PR follows because I think this is where it belongs. I think that also the WMS documentation http://mapserver.org/ogc/wms_server.html should be updated from this place:
Did you consider an alternative to add an explicit new metadata item "wms_name" that would override the name of the mapfile? The same effect than by setting |
|
(Ooppss... copying my comment from the PR here) I agree with @jratike80's comment and suggestion of setting "wms_name" "" instead of creating a new "wms_rootlayer_name_enabled" metadata. |
|
@jratike80 so implement |
|
@dmorissette ^^ |
|
Yes, wms_rootlayer_name would be consistent with existing wms_rootlayer_abstract, wms_rootlayer_keywordlist, and wms_rootlayer_title. I was thinking that "wms_name" would have the same effect than MAP NAME but just interpreted later and having precedence . But by looking at WMS standard that name is not good because it makes user to think that it would be a pair to "wms_title" which sets title for the whole service. However, the standard mandates that the service name is always "WMS". So forget "wms_name". New "wms_rootlayer_name" would make is possible to have different names in MAP-NAME and MAP-METADATA-"wms_rootlayer_name". You may consider if this is good or not. From the documentation I can't find especially much use for MAP-NAME
Some edits to documentation would be needed: a new entry for wms_rootlayer_name and some edits to "Map Name and wms_title" and perhaps a new bullet item for the name of the root layer. |
|
@jratike80 PR #5405 updated. Logic sequence in pseudo code: Makes sense? We can merge and then update docs if this works for you. |
|
Thinking about Would that make sense? |
|
@jratike80 even if MAP.NAME is set wms_rootlayer_name (if set) overrides it. See the tests as part of the PR. Note that existing tests pass as well so the PR does not break existing functionality. Or are you thinking to not emit the root layer name as a default? |
|
Emit root layer name is for sure useful. I was just thinking about a small corner case when user, for some reason, would like to override root layer name that heritages from MAP-NAME into nothing and remove the name element from GetCapabilities XML. I was reading just your pseudocode I am only a user who does not really write nor read code but test msautotest/wxs/ows_wms_rootlayer_name_empty.map actually seems to test overriding MAP-NAME into empty. In test msautotest/wxs/ows_wms_rootlayer_name.map you have perhaps done copy-paste without edit: |
If wms_rootlayer_name is "" then rootlayer name from MAP-NAME is not kept. The test case in
Typo in Thanks for the valuable comments and discussion! Ok to merge PR? |
|
Have you tried setting MAP.NAME to ""? As far i remember, this makes to root layer name disappearing.Kind regards, Martin. Von: Tom KralidisGesendet: Samstag, 18. März 2017 00:50An: mapserver/mapserverAntwort an: mapserver/mapserverCc: SubscribedBetreff: Re: [mapserver/mapserver] add metadata to optionally not emit root layer name in WMS Capabilities XML (#5404)
Emit root layer name is for sure useful. I was just thinking about a small corner case when user, for some >reason, would like to override root layer name that heritages from MAP-NAME into nothing and >remove the name element from GetCapabilities XML.
I was reading just your pseudocode
if MAP.WEB.METADATA.wms_rootlayer_name is set and is not ""
which made me believe that if wms_rootlayer_name is set and IS an empty string "" then the rootlayer >name from MAP-NAME is kept.
If wms_rootlayer_name is "" then rootlayer name from MAP-NAME is not kept. The test case in /msautotest/wxs/ows_wms_rootlayer_name.map should take care of this corner case.
I am only a user who does not really write nor read code but test msautotest/wxs/ows_wms_rootlayer_name_empty.map actually seems to test overriding MAP-NAME into empty.
In test msautotest/wxs/ows_wms_rootlayer_name.map you have perhaps done copy-paste without edit:
+# Results expected
+# getcapabilities: root element does not emit element
Shouldn't it be the opposite and give Name "foo" as a result?
Typo in msautotest/wxs/ows_wms_rootlayer_name.map now fixed.
Thanks for the valuable comments and discussion! Ok to merge PR?
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/mapserver/mapserver","title":"mapserver/mapserver","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/mapserver/mapserver"}},"updates":{"snippets":[{"icon":"PERSON","message":"@tomkralidis in #5404: \u003eEmit root layer name is for sure useful. I was just thinking about a small corner case when user, for some \u003ereason, would like to override root layer name that heritages from MAP-NAME into nothing and \u003eremove the name element from GetCapabilities XML.\r\n\u003e\r\n\u003eI was reading just your pseudocode\r\n\u003eif MAP.WEB.METADATA.wms_rootlayer_name is set and is not \"\"\r\n\u003ewhich made me believe that if wms_rootlayer_name is set and IS an empty string \"\" then the rootlayer \u003ename from MAP-NAME is kept.\r\n\u003e\r\n\r\nIf wms_rootlayer_name is \"\" then rootlayer name from MAP-NAME is not kept. The test case in `/msautotest/wxs/ows_wms_rootlayer_name.map` should take care of this corner case.\r\n\r\n\u003eI am only a user who does not really write nor read code but test msautotest/wxs/ows_wms_rootlayer_name_empty.map actually seems to test overriding MAP-NAME into empty.\r\n\u003e\r\n\u003eIn test msautotest/wxs/ows_wms_rootlayer_name.map you have perhaps done copy-paste without edit:\r\n\u003e+# Results expected\r\n\u003e+# getcapabilities: root element does not emit element\r\n\u003eShouldn't it be the opposite and give Name \"foo\" as a result?\r\n\r\nTypo in `msautotest/wxs/ows_wms_rootlayer_name.map` now fixed.\r\n\r\nThanks for the valuable comments and discussion! Ok to merge PR?"}],"action":{"name":"View Issue","url":"#5404 (comment)"}}}
|
|
Ok to merge PR. |
|
@mkofahl correct, setting |
|
@jratike80 thanks, merging. |
|
FYI related docs PR in MapServer/MapServer-documentation#168 |
|
I trust that the commit in year 2017 resolved this issue. |
A sample GetCapabilities request shows the following:
The root layer element's
foovalue is derived from the mapfile'sMAP.NAMEvalue. WMS says anyLayerwith aNameelement should beGetMapcapable. In our case this requests all layers in the WMS, which may prove problematic for a number of reasons:The workaround is to set
MAP.NAMEto"". The proper fix is to tell MapServer to not emit the root layer name via something like"wms_rootlayer_name_enabled" "false"The text was updated successfully, but these errors were encountered: