fix: fall back to WKT for WMTS BoundingBox crs when CRS cannot be resolved to a URN#1448
Open
wakame1367 wants to merge 2 commits into
Open
fix: fall back to WKT for WMTS BoundingBox crs when CRS cannot be resolved to a URN#1448wakame1367 wants to merge 2 commits into
wakame1367 wants to merge 2 commits into
Conversation
…olved to a URN Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
The remaining red on this PR's I opened #1449 to fix that pre-existing mypy failure separately. Once it lands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1043
What
When the
wmtsExtensionis configured with a custom CRS that cannot beresolved to an authority identifier (e.g. a slightly tweaked polar
stereographic projection),
CRS_to_urn()returnsNoneand the WMTSCapabilities document ends up with an invalid bounding box CRS:
This breaks WMTS clients such as QGIS.
This PR implements the fallback discussed in #1043: when no URN can be
resolved, we now emit a
UserWarningand use the WKT representation of the CRSfor the
crsattribute. WKT is not strictly compliant with the WMTS 1.0.0expectation that this value be a CRS URI/URN, but GDAL/QGIS handle it
correctly, and it is preferable to emitting
crs="None".The same fix is applied to both
titiler.extensions.wmtsExtensionandtitiler.mosaic.extensions.wmtsExtension, and the now-unneeded# type: ignorecomments are removed.Changes
titiler/extensions/wmts.py/titiler/mosaic/extensions/wmts.py: fall backto
geographic_crs.to_wkt()(with aUserWarning) whenCRS_to_urn(geographic_crs)returnsNonean authority, asserting that a
UserWarningis emitted and that thecrsattribute of
ows:BoundingBoxcontains the WKT stringCHANGES.md🤖 Generated with Claude Code