Skip to content
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

Bug WMS QGIS GetFeatureInfo returning entity #50981

Closed
1 of 2 tasks
ThomasG77 opened this issue Nov 23, 2022 · 3 comments · Fixed by #50995
Closed
1 of 2 tasks

Bug WMS QGIS GetFeatureInfo returning entity #50981

ThomasG77 opened this issue Nov 23, 2022 · 3 comments · Fixed by #50995
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@ThomasG77
Copy link
Contributor

What is the bug or the crash?

Considering QGIS attached project (see how to reproduced part for file),

I got a parsing issue from returned content after GetFeatureInfo query using "Identify feature"

For layer "INSEE.FILOSOFI.POPULATION" named in layer tree "Densité de population", WMS URL is https://wxs.ign.fr/economie/geoportail/r/wms?VERSION=1.3.0

When you try to query as entity, it returns error like in attached image. Using the request debugger, I see QGIS does a request using INFO_FORMAT=application/json instead of one requesting GML (not available in capabilities) so, the returned entity should not be parsed as GML but as GeoJSON/JSON, hence thee issue. Below a sample of the GetFeatureInfo query in the network debugger https://wxs.ign.fr/economie/geoportail/r/wms?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=INSEE.FILOSOFI.POPULATION&STYLES=&FORMAT=image/jpeg&QUERY_LAYERS=INSEE.FILOSOFI.POPULATION&INFO_FORMAT=application/json&I=833&J=382&FEATURE_COUNT=10

Excerpt of the GetFeatureInfo part in WMS capabilities (curl -s "https://wxs.ign.fr/economie/geoportail/r/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities" |xmllint --format -)

      <GetFeatureInfo>
        <Format>text/plain</Format>
        <Format>text/html</Format>
        <Format>text/xml</Format>
        <Format>application/xml</Format>
        <Format>application/json</Format>
        <DCPType>
          <HTTP>
            <Get>
              <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://wxs.ign.fr/economie/geoportail/r/wms?" xlink:type="simple"/>
            </Get>
          </HTTP>
        </DCPType>
      </GetFeatureInfo>

Steps to reproduce the issue

  • open the attached project debug-qgis-ogc-wms.qgz.zip,
  • click on a feature choosing "entity" in the panel associated with "Identify feature"
  • get the following error message (screenshot)

Error message screenshot

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

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

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

@ThomasG77 ThomasG77 added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Nov 23, 2022
@pathmapper
Copy link
Contributor

Same error message with QGIS 3.29.0-Master (2a0fc59).

@elpaso
Copy link
Contributor

elpaso commented Nov 24, 2022

This might well be a QGIS bug because QGIS should not request an info format which is not in getcapabilities, but shouldn't the server also respond with an exception if a request for an unsupported info format is made?

@pathmapper
Copy link
Contributor

QGIS should not request an info format which is not in getcapabilities

Looks like this it not the case, the request includes INFO_FORMAT=application/json which is included in GetCapabilities.

The issue is here, that QGIS tries to parse the JSON response as GML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants