[gdal-dev] WMTS Possible rounding error

Michał Kowalczuk michkowalczuk at gmail.com
Tue Dec 10 13:51:41 PST 2024


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
<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
<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
<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
<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
<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
<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/a7b830d2/attachment.htm>


More information about the gdal-dev mailing list