-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Do not include a BoundingBox tag in GetFeatureInfo responses, when it is null #54858
Conversation
To be honest I couldn't find the specifications about the GetFeatureInfo XML response so I don't know if the bbox is mandatory or if it is expected by clients even if it's null. @pblottiere @rldhont @rouault do you have any clue? |
I've read on stackoverflow that OGC does not mandate any format for the response of a GetFeatureInfo call. Indeed GeoServer seem to be responding with HTML or JSON and allows customization so I guess QGIS can decide on a format. Ideally such format would then be documented by QGIS itself. In the test I've modified there's no geometrical component at all in the response so I'm not even sure that's a valid thing, but in any case a BoundingBox makes no sense in it so I'd think it's ok to omit that. |
The page I was reading about not mandating a format was: https://gis.stackexchange.com/questions/57733/in-what-format-does-a-wms-getfeatureinfo-return-data |
It would make sense if the client checks the bbox to know that it's an aspatial table (which is supported). The response may have no features so it's not always possible to check if the features have a geometry. I guess you should check what GeoServer does in this situation, AFAIK it is a reference implementation. |
If there is not a spatial table, how can someone click on the feature in a WMS GetFeatureInfo request? |
The test making the request is here: There is no spatial query either, is "universe bounding box" to be assumed when that happens ? |
It is meant for API calls using FILTER https://docs.qgis.org/3.28/en/docs/server_manual/services/wms.html#getfeatureinfo |
I'm getting a fiailure in assertXMLEqual but the failure doesn't tell me what the actual result is: https://github.com/qgis/QGIS/actions/runs/6420951207/job/17441540938?pr=54858#step:13:639 should we always show the diff instead ? Looking at the expected xml, there's an empty "extent" tag, maybe we want to completely avoid expecting that line ? Lack of that line in the current response sounds like a likely consequence of not including null rects. |
Uhm, that test does something different than I thought, and I'm not sure what, exactly. |
Got it: it's the get_postgres_types_json_dict.txt to be changed |
Update expected test results accordingly
9fa7d4a
to
dc5d079
Compare
Testsuite seem now happy. I need this change in order to change the internal representation of a NULL QGsRectangle - see GH-54646 - just printing those BoundingBox elements with arbitrary data makes no sense anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a cursory reading of the spec, the contents of GetFeatureInfoResponse
seems to be left to the latitude of the server, so I guess this looks fine.
Unfortunately your approval is not enough for me to be allowed to merge this in. Hopefully @elpaso @pblottiere @rldhont @rouault will allow this in to help move on with the other PR about QgsRectangle ( GH-54646 ) |
A BoundingBox is required by WMS GetFeatureInfo. It tells the WMS server which bounding box was used to create the image for which the pixel coordinate (point clicked in the map image) applies. WMS server requests are stateless, the server doesn't hold session state to know which map image has been clicked on to provide the feature request, instead the feature request must send the full information to create the image, plus additional parameters to say which pixel is queried and which format you want the feature information to be returned in. |
I've noticed QGIS WMS responses are including a BoundingBox tag with min/max values being all 0.0 when the real bounding box is null, this PR aims at making it more explicit to allow for using other encoding for a null bounding box.
I haven't found the specification of the returned XML to see if a more formal way to express a null bounding box exists.
References #54646 (comment)
\cc @elpaso