<div dir="ltr">Sorry for the mistake in the last email. Instead of pasting <b>gfdalinfo </b>command i should paste this:<br><b>gdal_translate -srcwin 0 0 12235811 6137602 -outsize 512 512 "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><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">pt., 13 gru 2024 o 13:15 Michał Kowalczuk <<a href="mailto:michkowalczuk@gmail.com">michkowalczuk@gmail.com</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div>Consider the following WMTS server:<br><b><a href="https://geoservices-urbis.irisnet.be/geoserver/gwc/service/wmts" target="_blank">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" target="_blank">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" target="_blank">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" target="_blank">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/" target="_blank">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" target="_blank">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>
</blockquote></div>