<div dir="ltr">Hi,<div>Consider the following WMTS server:<br><b style=""><a href="https://geoservices-urbis.irisnet.be/geoserver/gwc/service/wmts">https://geoservices-urbis.irisnet.be/geoserver/gwc/service/wmts</a></b></div><div><br></div><div>One of the subdataset path generated by GDAL is</div><div><b>WMTS:<a href="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</a></b></div><div><b><br></b></div><div>When I try to download a map I notice URL issue/error.</div><div><b>gdalinfo "WMTS:<a href="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</a>" tile.png --debug on --config GDAL_ENABLE_WMS_CACHE NO</b></div><div><br></div><div>from debug:<br><b>HTTP: Requesting [1/4] <a href="https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/Ortho">https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/Ortho</a><span style="background-color:rgb(0,255,0)">//</span>EPSG:4326/EPSG:4326:7/27/129?format=image/jpeg</b></div><div>look at the double slash (//) chars in the above URL</div><div><br></div><div>When you go to service Capabilities you can find the following resource URL:</div><div><b> <ResourceURL format="image/jpeg" resourceType="tile" template="<a href="https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/urbisNL/">https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/urbisNL/</a><span style="background-color:rgb(0,255,0)">{style}</span>/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/jpeg"/></b></div><div><br></div><div>but in the layer definition <b>Style</b> tag is empty:</div><div><b><Style isDefault="true"><br><ows:Identifier/><br></Style></b><br></div><div><br></div><div>This is probably the reason that GDAL make path using an empty string and this generate double slash chars.</div><div><br></div><div>If you remove redundant slash the server responses and returns a tile, the example:</div><div><b><a href="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</a></b></div><div><br></div><div>And the question is: is this service or GDAL bug?  :-)</div><div><br></div><div>Wouldn't it be a good idea for GDAL to check the URL path for correctness before sending the request? </div><div><br></div><div>Regards,</div><div>Michał</div><div><br></div><div><br></div></div>