Hi,
Consider the following WMTS server:
*https://geoservices-urbis.irisnet.be/geoserver/gwc/service/wmts
<https://geoservices-urbis.irisnet.be/geoserver/gwc/service/wmts>*

One of the subdataset path generated by GDAL is
*WMTS:https://geoservices-urbis.irisnet.be/geoserver/gwc/service/wmts?SERVICE=WMTS&REQUEST=GetCapabilities&VERSION=1.0.0,layer=Ortho,tilematrixset=EPSG:4326
<https://geoservices-urbis.irisnet.be/geoserver/gwc/service/wmts?SERVICE=WMTS&REQUEST=GetCapabilities&VERSION=1.0.0,layer=Ortho,tilematrixset=EPSG:4326>*

When I try to download a map I notice URL issue/error.
*gdalinfo
"WMTS:https://geoservices-urbis.irisnet.be/geoserver/gwc/service/wmts?SERVICE=WMTS&REQUEST=GetCapabilities&VERSION=1.0.0,layer=Ortho,tilematrixset=EPSG:4326
<https://geoservices-urbis.irisnet.be/geoserver/gwc/service/wmts?SERVICE=WMTS&REQUEST=GetCapabilities&VERSION=1.0.0,layer=Ortho,tilematrixset=EPSG:4326>"
tile.png --debug on --config GDAL_ENABLE_WMS_CACHE NO*

from debug:
*HTTP: Requesting [1/4]
https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/Ortho
<https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/Ortho>//EPSG:4326/EPSG:4326:7/27/129?format=image/jpeg*
look at the double slash (//) chars in the above URL

When you go to service Capabilities you can find the following resource URL:
* <ResourceURL format="image/jpeg" resourceType="tile"
template="https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/urbisNL/
<https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/urbisNL/>{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/jpeg"/>*

but in the layer definition *Style* tag is empty:


*<Style isDefault="true"><ows:Identifier/></Style>*

This is probably the reason that GDAL make path using an empty string and
this generate double slash chars.

If you remove redundant slash the server responses and returns a tile, the
example:
*https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/Ortho/EPSG:4326/EPSG:4326:14/3567/16784?format=image/jpeg
<https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/Ortho/EPSG:4326/EPSG:4326:14/3567/16784?format=image/jpeg>*

And the question is: is this service or GDAL bug?  :-)

Wouldn't it be a good idea for GDAL to check the URL path for correctness
before sending the request?

Regards,
Michał
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to