qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.12k stars 2.93k forks source link

Unable to activate Identify Feature on a WMS layer with GetFeatureInfo Capabilities #50983

Open ThomasG77 opened 1 year ago

ThomasG77 commented 1 year ago

What is the bug or the crash?

With this project, https://github.com/qgis/QGIS/files/10076587/debug-qgis-ogc-wms.qgz.zip

The below WMS layer can't be queried (unable to activate the "Identify Feature" button for the layer) whereas GetFeatureInfo is possible (checked in the capabilities)

For layer "AGENDA21_S_R44" named in layer tree "Collectivites engagees dans une demarche Agenda 21 dans le Grand Est" with WMS URL https://ogc.geo-ide.developpement-durable.gouv.fr/wxs?map=/opt/data/carto/geoide-catalogue/1.4/org_5443264/ccf16ee8-5b97-4cf5-9257-c88102c106e2.internet.map

Manual GetFeatureInfo with text/plain

https://ogc.geo-ide.developpement-durable.gouv.fr/wxs?map=/opt/data/carto/geoide-catalogue/1.4/org_5443264/ccf16ee8-5b97-4cf5-9257-c88102c106e2.internet.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=880288.54028120101429522,6862834.76942052692174911,889264.71626451192423701,6871157.00023245997726917&CRS=EPSG:2154&WIDTH=1153&HEIGHT=1069&LAYERS=AGENDA21_S_R44&STYLES=&FORMAT=image/png&QUERY_LAYERS=AGENDA21_S_R44&INFO_FORMAT=text/plain&I=833&J=382&FEATURE_COUNT=10

Manual GetFeatureInfo with application/vnd.ogc.gml

https://ogc.geo-ide.developpement-durable.gouv.fr/wxs?map=/opt/data/carto/geoide-catalogue/1.4/org_5443264/ccf16ee8-5b97-4cf5-9257-c88102c106e2.internet.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=880288.54028120101429522,6862834.76942052692174911,889264.71626451192423701,6871157.00023245997726917&CRS=EPSG:2154&WIDTH=1153&HEIGHT=1069&LAYERS=AGENDA21_S_R44&STYLES=&FORMAT=image/png&QUERY_LAYERS=AGENDA21_S_R44&INFO_FORMAT=application/vnd.ogc.gml&I=833&J=382&FEATURE_COUNT=10

So, the issue is that "Identify Feature" should be activated for the layer whereas it does not

Steps to reproduce the issue

Clue: maybe related to nested layers e.g below image

WMS capabilities layers overview in QGIS

Versions

QGIS version 3.22.11-Białowieża QGIS code branch Release 3.22
Qt version 5.15.6
Python version 3.9.13
GDAL/OGR version 3.5.2
PROJ version 9.0.1
EPSG Registry database version v10.064 (2022-05-19)
GEOS version 3.11.0-CAPI-1.17.0
Compiled against SQLite 3.39.3 Running against SQLite 3.40.0
PDAL version 2.4.3
PostgreSQL client version 14.5
SpatiaLite version 5.0.1
QWT version 6.2.0
QScintilla2 version 2.13.3
OS version Ubuntu 18.04.6 LTS
       

Active Python plugins densityanalysis | 2022.9.14 DataPlotly | 3.9.2 contour | 2.0.10 sagaprovider | 2.12.99 db_manager | 0.1.20 processing | 2.12.99 MetaSearch | 0.3.5 grassprovider | 2.12.99

Supported QGIS version

New profile

Additional context

Not running a supported version because using conda that only comes with 3.22.11 at the moment.

pathmapper commented 1 year ago

Confirmed with QGIS 3.29.0-Master (2a0fc591f7).

elpaso commented 1 year ago

Two layers, same name? That's the root of the problem.

ThomasG77 commented 1 year ago

I've confirmed the diagnostic with a capabilities version where I've renamed one of the 2 layers mentioned as AGENDA21_S_R44_DEBUG instead of AGENDA21_S_R44 and used the remote fixed static capabilities https://labs.webgeodatavore.com/partage/capabilities.xml?

Need to made a feedback to OGC web service owner about name duplication he should check.

Only thing that could be done on QGIS side seems to put a warning when finding layer(s) with duplicated layer(s) name(s) in WMS Data Source Manager panel or put a warning about this situation in QGIS doc.

Not sure if it needs more action on QGIS devs side and if need to be closed as wondering if this kind of issue should be caught at QGIS level or elsewhere.

PS: made a small tool only for this purpose e.g https://gist.github.com/ThomasG77/45567547728ad993aee9f4457760440a

alexbruy commented 8 months ago

Can be closed?

ThomasG77 commented 8 months ago

Depend if you consider my suggestion (repeated below) mandatory otherwise, good to close at there is an answer

Only thing that could be done on QGIS side seems to put a warning when finding layer(s) with duplicated layer(s) name(s) in WMS Data Source Manager panel or put a warning about this situation in QGIS doc.