[gdal-dev] WMTS Possible rounding error

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Tue Dec 10 14:10:54 PST 2024


Hi,

I read from the GetCapabilities that the URL template is like .../{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}

The size of tile matrix 1 "<ows:Identifier>1</ows:Identifier>" is
<MatrixWidth>4</MatrixWidth>
<MatrixHeight>3</MatrixHeight>

The WMTS standard tells about TileCol
"...else SHALL be any integer value between 0 and
MatrixWidth - 1, see Table 14, (both included)"

Thus TileCol 3 SHALL exist, but on that server it does not seem to exist. I think it is clearly a server error. If the server does not have TileCol=3 intentionally, it should advertise that with TileMatrixSetLimits in the GetCapabilities.

I may be wrong, I have not been reading and interpreting the WMTS standard super much.

-Jukka Rahkonen-

Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org> Puolesta Michal Kowalczuk via gdal-dev
Lähetetty: tiistai 10. joulukuuta 2024 23.52
Vastaanottaja: gdal-dev at lists.osgeo.org
Aihe: [gdal-dev] WMTS Possible rounding error

Hi,
Consider the following WMTS service:
WMTS:https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/WMTS/1.0.0/WMTSCapabilities.xml?SERVICE=WMTS&REQUEST=GetCapabilities&VERSION=1.0.0,layer=USGSHydroCached,tilematrixset=default028mm

and try to get whole extent:
gdal_translate -srcwin 0 0 1852166785 1511812353 -outsize 570 465 "WMTS:https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/WMTS/1.0.0/WMTSCapabilities.xml?SERVICE=WMTS&REQUEST=GetCapabilities&VERSION=1.0.0,layer=USGSHydroCached,tilematrixset=default028mm" tile.png --debug on --config GDAL_ENABLE_WMS_CACHE NO
(where 1852166785 1511812353  is a raster size)

GDAL creates 4 requests:

HTTP: Requesting [1/4] https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/WMTS/tile/1.0.0/USGSHydroCached/default/default028mm/1/0/0
HTTP: Requesting [2/4] https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/WMTS/tile/1.0.0/USGSHydroCached/default/default028mm/1/0/1
HTTP: Requesting [3/4] https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/WMTS/tile/1.0.0/USGSHydroCached/default/default028mm/1/0/2
HTTP: Requesting [4/4] https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/WMTS/tile/1.0.0/USGSHydroCached/default/default028mm/1/0/3

where the last tile does not exist. So it probably should stop at /1/0/2.
Isn't it a rounding error?

Best regards
Michał Kowalczuk


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241210/c73fe523/attachment.htm>


More information about the gdal-dev mailing list