Closed pathmapper closed 3 years ago
It is not a Browser only issue, "title" and "abstract" also do not show in the "add WMS layer" dialog when establishing a connection.
Good find @gioman, added also Abstract and Short name to the sample project:
sample_project_title_abstract.zip
Short name is displayed in the "add WMS layer" dialogue where Title and Abstract are missing:
Also tried the sample QGIS Server WMS using another GIS software and the Abstract and Title are displayed:
software | title | abstract |
---|---|---|
QGIS Desktop 3.16.2 | :x: | :x: |
Firefox Browser (getCapabilities) | :heavy_check_mark: | :heavy_check_mark: |
another GIS software | :heavy_check_mark: | :heavy_check_mark: |
After taking a closer look at the OpenGIS Web Map Service (WMS) Implementation Specification it's getting clearer what's happening here:
QGIS Desktop doesn't show Title and Abstract of the <Service>
element (spec 7.2.4.3. General service metadata) for QGIS Browser and the "add WMS layer" dialogue at all. Instead it is showing Title and Abstract of the available layers including parent layers.
Regarding parent layers, from spec 7.2.4.5 (Layers and styles):
Each available map is advertised by a
element in the service metadata. Conceptually, each Layer is a distinct entity. However, as a means of classifying and organizing layers, and as a means of reducing the size of the service metadata, a single parent Layer may enclose any number of additional layers, which may be hierarchically nested as desired.
Looks like in the project properties the term root layer is used instead of parent layer (for the Short name field).
2.
QGIS Server adds a parent/root layer using the Short name field of the project properties for <Name>
, but it doesn't include <Title>
and <Abstract>
for this parent/root layer for getCapabilities and there's no way to set them in the project properties.
Spec 7.2.4.6.2
A
<Title>
is mandatory for all layers
Spec 7.2.4.6.4
The optional
<Abstract>
and<KeywordList>
elements are optional, but a server should provide them.
A solution here might be to use Title and Abstract defined in Service Capabilities also for <Title>
and <Abstract>
of the parent/root layer.
Describe the bug WMS title is not displayed in QGIS browser for WMS provided by QGIS Server.
How to Reproduce
Using a browser to request the GetCapabilities document, the title is there: http://168.119.115.196/cgi-bin/missing_title/qgis_mapserv.fcgi?service=WMS&version=1.3.0&request=GetCapabilities
QGIS and OS versions
Additional context
project_and_data_used_for_qgis_server.zip
For other WMS the title is displayed in QGIS browser, e.g.: https://www.wms.nrw.de/geobasis/wms_nw_dop
https://www.wms.nrw.de/geobasis/wms_nw_dop?service=WMS&version=1.3.0&request=GetCapabilities