Replies: 2 comments
-
👋 @samn, I'm really sorry about this. We decided to stop using the top level bounds because:
from https://docs.ogc.org/is/17-083r4/17-083r4.html#toc16 ref #106 |
Beta Was this translation helpful? Give feedback.
-
Ahh thanks for explaining, @vincentsarago do you think this because the WMTS and TMS specs are not exactly aligned with how they treat the bounding box? I was surprised to find so many examples of WMTS GetCapabilities with this problem. |
Beta Was this translation helpful? Give feedback.
-
We've been using morecantile to figure out the tile coordinates covering a polygon in a WMTS' tile matrix set. We map fields in WMTSCapabilities.xml to fields in morecantile models to construct a custom
TileMatrixSet
, and compute the coordinates of tiles in the TMS for a given lat lng bbox.Many WMTSCapabilities return a different bounding box in the layer's
ows:BoundingBox
than in theTileMatrixSet
. A recent change to the implementation ofTileMatrixSet#xy_bbox
caused incorrect tile coordinates to be generated in this case, and I'm not totally sure if it's just that the WMTS' tile matrices are malformed, or if it's something morecantile should be able to handle.Here's an example WMTS with this problem: https://geodata.md.gov/imap/rest/services/Imagery/MD_SixInchImagery/MapServer/WMTS/1.0.0/WMTSCapabilities.xml
The example script below shows that the
ows:BoundingBox
and the bbox that morecantile computes from the tile matrices differ. The previous implementation ofxy_bbox
would use the boundingBox (instead of computing one from the tile matrices), and tile coordinates ended up getting computed correctly.On morecantile >= 3.4.0 the tile coordinates are calculated incorrectly (25,318 total, instead of 4 as expected):
Example Script (morecantile 5)
But on morecantile==3.3.0 the correct number of tiles are computed:
Example Script (morecantile 3.3.0)
I realize the root cause here might be the inconsistency between the overall bounds, and the bounds on the tile matrices, but would appreciate any guidance on how to handle this. Here's another example WMTS with this problem. It looks like both are from ArcGIS.
Beta Was this translation helpful? Give feedback.
All reactions