Bug report #14658
Wmts layer not appearing
|Category:||Web Services clients/WMS|
|Affected QGIS version:||2.14.1||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||22622|
I have some issues with this wmts server: http://webapps.sit.puglia.it/arcgis/rest/services/Background/CatastoImpianto/ImageServer/WMTS/1.0.0/WMTSCapabilities.xml
I connect to the server, the layer appears but nothing is displayed. The same wmts layer is correctly displayed in arcmap so I suppose the wmts server is ok.
#1 Updated by Giovanni Manghi about 5 years ago
- Operating System deleted (
- Target version deleted (
this is the log
2016-04-11T18:20:17 0 repeat tileRequest 1 tile 0(retry 1) 2016-04-11T18:20:18 0 repeat tileRequest 1 tile 0(retry 2) 2016-04-11T18:20:18 0 repeat tileRequest 1 tile 0(retry 3) 2016-04-11T18:20:18 1 Tile request max retry error. Failed 3 requests for tile 0 of tileRequest 1 (url: http://webapps.sit.puglia.it/arcgis/rest/services/Background/CatastoImpianto/ImageServer/WMTS/tile/1.0.0/Background_CatastoImpianto/default/nativeTileMatrixSet/0/506/564.png)
#6 Updated by Giovanni Manghi about 5 years ago
- Status changed from Feedback to Open
Saber Razmjooei wrote:
Are you trying to add it from Layer > Add Layer > Add WMS or through the Browser panel.
I had some problems (with 2.8) when trying to add it from the Browser panel but from layer or toolbar it works fine.
this does not seems the case.
Other arcgis 10 based wmts services seems to work, like
but anyway in the log do still show similar log messages like the one posted above.
#7 Updated by Martin Dobias over 4 years ago
My impression is that the server does not follow WMTS specification properly.
Info from GetCapabilities ... layer's extent:
<ows:BoundingBox crs="urn:ogc:def:crs:EPSG::32633"> <ows:LowerCorner>494382.83364768786 4409764.91267182</ows:LowerCorner> <ows:UpperCorner>800070.7019800352 4683797.957030918</ows:UpperCorner> </ows:BoundingBox>
And the base tile matrix:
<TileMatrix> <ows:Identifier>0</ows:Identifier> <ScaleDenominator>7559.523809523809</ScaleDenominator> <TopLeftCorner>-5120900.0 9998100.0</TopLeftCorner> <TileWidth>256</TileWidth> <TileHeight>256</TileHeight> <MatrixWidth>565</MatrixWidth> <MatrixHeight>507</MatrixHeight> </TileMatrix>
Now, valid range of tiles for zoom level 0 are in interval <9807, 10313> for X tile numbers and <10362, 10926> for Y tile numbers - it is mentioned here  (look for Start Tile / End Tile links) but such information does not appear in WMTS GetCapabilities. QGIS makes use of the MatrixWidth and MatrixHeight values, so even though if it calculates correct tile for area within valid extent, e.g. tile [10062, 10702], see , it clamps the tile range to <0, MatrixWidth-1> for X tile numbers and <0, MatrixHeight-1> for Y tile numbers. (Optionally, it uses TileMatrixLimits if they are present, which is not the case here).
In my opinion, the server should report correct MatrixWidth and MatrixHeight values, and optionally it should make use of TileMatrixLimits to define valid range of tiles. A second opinion would be welcome to confirm or reject my theory.
If I remove bounds checking in QgsWmtsTileMatrix::viewExtentIntersection(), things work as expected. It may be possible to add an option to disable the bounds checking to work around issues with other ArcGIS WMTS servers.