-
-
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
[Feature][WMS] Add crs information in WMS GetFeatureInfo output when it differs from WGS84 #56600
[Feature][WMS] Add crs information in WMS GetFeatureInfo output when it differs from WGS84 #56600
Conversation
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.
I'm not against this change (it improves the current situation 👍 ), but wonder if it wouldn't be an option to reproject the coordinates to WGS 84 to get RFC 7946 GeoJSON if the request is using a different CRS parameter.
From https://geojson.org/:
RFC 7946 was published in August 2016 and is the new standard specification of the GeoJSON format, replacing the 2008 GeoJSON specification.
It's now more than 7 years since RFC 7946 and there are some tools already complaining if they are provided with a GeoJSON with CRS member, e.g. https://geojsonlint.com or https://geojson.io/:
5046beb
to
5294b0e
Compare
You don't want to reproject the coordinates in WGS84 because user requests their GetFeatureInfo result in a given coordinate system (using CRS/SRS parameter) and expect their result in that coordinate system.
Funny thing with https://geojsonlint.com/ is that he just checks if the root GeoJSON object has a "crs" item. But the GeoJSON spectification allows to have any additionnal members... so actually, the GeoJSON IS valid. If I replace "crs" with "srs" everything is fine. And If I give the linter coordinates in 3857, it doesn't yell. So what its best:
I 'd vote the second one. @elpaso Any opinion on this ? |
Well, I don't have a strong opinion: the first option makes sense because the client should know the response CRS (because it asked for it in the first place) but is also true that the server might not be able to honor the request, explicit is better than implicit and having the crs exposed in the response is not a bad idea. Would this also affetc WFS3/oapif ? I implemented CRS in the response even if it wasn't in RFC 7946 because I thought it was too useful to not to, but the CRS is not currently exposed in the response. |
It only affects WMS/GetFeatureInfo for now, but it could (and maybe should?) |
Yeah, probably better to add it there too. |
2868f5a
to
82da615
Compare
when requested CRS is not WGS84
82da615
to
d45c8fe
Compare
Done f7d5feb |
unrelated test failure |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
@troopa81 A WFS GetFeature request can also be used to request data in GeoJSON format in a non-EPSG:4326 CRS. As you add |
|
Sorry I have not seen it. Thanks ! |
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
GeoJSON states that CRS should always be OGC:CRS84, but when user requests explicitly a given CRS different from WGS84 on WMS GetFeatureInfo, it's better to expose the output CRS using the old GeoJSON specification format.
Related to a QWC issue, see comment
Funded by Eurométropole de Strasbourg
cc @benoitblanc