[gdal-dev] Question: is there a way to set the TileMatrix value (aka Tile Zoom Level) for GDAL_WMTS?

esacree esacree at knology.net
Tue Nov 22 12:51:59 PST 2016


Question: is there a way to set the TileMatrix value (aka Tile Zoom Level)
for GDAL_WMTS?

WMTS Tile Retrieval issue:  WMTS Is retrieving at the wrong TileMatrix
value.  WMTS retrieves tiles at the maximum tile matrix (tile level or zoom
level).  No data is being returned.

Server:       
http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS?
Capabilities: 
http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS?SERVICE=WMTS&REQUEST=GetCapabilities

1.  Tiles are always requested at the maximum tile zoom level.  Using the
max tile zoom level can result in many tiles returned. When zoomed out, a
smaller tile zoom level will give enough data and fewer tiles.  It really
needs to respond to the TileLevel like Google Maps running the TMS driver.


--------------------------------------------------
Possible Problem in WMTS Code:
--------------------------------------------------
The TileMatrix hard coded maximum tile matrix problem may be here:  GDAL
2.1.2 File: wmtsdataset.cpp, Function: WMTSDataset::Open, Line 1587 Loop
starts at Maximum matrix id value.  The loop breaks at end of processing the
maximum value.  At that point the tile matrix (tlie zoom level) is 19
(maximum).

--------------------------------------------------
Here's the first tile request built by GDAL 2.1.2:
--------------------------------------------------
AskMiniDriverForBlock - First Tile Request:
url =
"http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/default/default028mm/19/205501/135727.jpg"

For TileMatrix 19 the tile coordinates look right.  But the TileMatrix value
(tile zoom level) is set to the maximum for the TileMatrixSet.  TileMatrix
was requested at 14 based on the standard ESRI map scale computation.  Using
the WMS/TMS driver, Google Maps honors the TileLevel request.  I added the
TileMatrix and/or TileLevel parameters in the GDAL_WMTS request below.  It
did not make any difference.

--------------------------------------------------
Here's the WMTS XML Request file:
--------------------------------------------------
<GDAL_WMTS>
       
<GetCapabilitiesUrl>http://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/1.0.0/WMTSCapabilities.xml</GetCapabilitiesUrl>
        <Layer>USGSShadedReliefOnly</Layer>
        
        <TileMatrixSet>default028mm</TileMatrixSet>
        <Format>image/jpg</Format>
    <DataWindow>
        <UpperLeftX>-9662904.298813</UpperLeftX>
        <UpperLeftY>4329581.328124</UpperLeftY>
        <LowerRightX>-9647611.198187</LowerRightX>
        <LowerRightY>4319814.305876</LowerRightY>
        <TileMatrix>14</TileMatrix>   	// DOES NOT WORK, IGNORED
        <TileLevel>14</TileLevel> 	// DOES NOT WORK, IGNORED
        </DataWindow>
    <BandsCount>4</BandsCount>
    <Cache/>
    <UnsafeSSL>true</UnsafeSSL>
    <ZeroBlockHttpCodes>404</ZeroBlockHttpCodes>
    <ZeroBlockOnServerException>true</ZeroBlockOnServerException>
</GDAL_WMTS>





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Question-is-there-a-way-to-set-the-TileMatrix-value-aka-Tile-Zoom-Level-for-GDAL-WMTS-tp5297011.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list