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

QGIS Server OGC: Display name is not provided in GetFeatureInfo json/gml response #59353

Closed
2 tasks
MarcelGeo opened this issue Nov 6, 2024 · 6 comments · Fixed by #60343
Closed
2 tasks
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server

Comments

@MarcelGeo
Copy link

What is the bug or the crash?

If the WITH_DISPLAY_NAME parameter is included in a WMS GetFeatureInfo request, the display name is omitted from the response GeoJSON or WFS GML format. It would be included as attribute with ... name in properties object for each feature.

The displayName field is included in the text/xml response format, but the XML structure is not standardized and harder to parse with standard FE libraries (openlayers ... ).

Example of responses for GET service=WMS&request=GetFeatureInfo&INFO_FORMAT=application/json&WITH_DISPLAY_NAME=true

json 👎 no display name :

{
  "features": [
    {
      "geometry": {
        "coordinates": [-111, 111],
        "type": "Point"
      },
      "id": "closure_df66a4aa_cf33_497e_b134_aa157ea885df.339",
      "properties": {
        "ID": 106,
      },
      "type": "Feature"
    }]
}

text/xml 👍

<GetFeatureInfoResponse>
 <Layer name="closure_df66a4aa_cf33_497e_b134_aa157ea885df">
  <Feature id="339">
   <Data>
    <Attribute name="ID" value="106"/>
   </Data>
   <Attribute name="displayName" value="Item 339"/>
   <BoundingBox CRS="EPSG:3857" minx="-111" miny="111" maxy="6803278.84325854" maxx="-111"/>
   <Attribute type="derived" name="geometry" value="Point (-111 111)"/>
  </Feature>
 </Layer>
</GetFeatureInfoResponse>

Note: coordinates are just examples

Steps to reproduce the issue

  1. GO to layer properties
  2. GO to Display
  3. Enable display name attribute
  4. Make GetFeatureInfo request to this project with WITH_DISPLAY_NAME parameter (as documented here https://docs.qgis.org/3.34/en/docs/server_manual/services/wms.html#wms-withdisplayname)

Versions

3.34.12-Prizren

Supported QGIS version

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

New profile

Additional context

No response

@MarcelGeo MarcelGeo added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Nov 6, 2024
@MarcelGeo MarcelGeo changed the title Display name is not provided in GetFeatureInfo json/gml response QGIS Server OGC: Display name is not provided in GetFeatureInfo json/gml response Nov 6, 2024
@agiudiceandrea agiudiceandrea added the Server Related to QGIS server label Nov 7, 2024
@elpaso elpaso self-assigned this Jan 23, 2025
@elpaso
Copy link
Contributor

elpaso commented Jan 27, 2025

@Gustry is this a bug or a feature request?

@Gustry
Copy link
Contributor

Gustry commented Jan 27, 2025

Oups, I didn't take take of other formats indeed. I would say it's a bug, as indeed, formats should be traited "equivalent" from each other and to have the same features when possible. Sorry for that.

Original PR : #52251

@elpaso
Copy link
Contributor

elpaso commented Jan 27, 2025

Oups, I didn't take take of other formats indeed. I would say it's a bug, as indeed, formats should be traited "equivalent" from each other and to have the same features when possible. Sorry for that.

Original PR : #52251

Thanks for clarifying, do you have time to fix it or should I ?

@Gustry
Copy link
Contributor

Gustry commented Jan 28, 2025

Sorry, I'm not building QGIS since a few months, so it makes coding in CPP a bit tricky. If you want to take it, you can.

@elpaso
Copy link
Contributor

elpaso commented Jan 29, 2025

I guess we can limit that to json: GML has a schema.

@MarcelGeo
Copy link
Author

I guess we can limit that to json: GML has a schema.

yeah, json is enough, thanks

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! Server Related to QGIS server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants