<div dir="auto">so maybe this little fix for this should be madę in gdal.</div><div dir="auto">if style isEmpty:</div><div dir="auto"> style=„default”</div><div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">W dniu pt., 13 gru 2024 o 14:32 Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="FI" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="m_7413682280990755690WordSection1">
<p class="MsoNormal"><span>Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">By the standard
</span><a href="https://www.ogc.org/publications/standard/wmts/" target="_blank"><span lang="EN-US">Web Map Tile Service - Open Geospatial Consortium</span></a>
<span lang="EN-US">”style” seems to be mandatory in the layer data “One or more (mandatory)”.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">And within “style”, the identifier is mandatory “An unambiguous reference to this style, identifying a specific version when needed, normally used by software”; multiplicity: One (mandatory).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I would say that this is a server side misconfiguration. Each style must have an identifier, even the default style. But the server does still understand the style named as “default”:<br>
<a href="https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/Ortho/default/EPSG:4326/EPSG:4326:7/27/129?format=image/jpeg" target="_blank">https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/Ortho/default/EPSG:4326/EPSG:4326:7/27/129?format=image/jpeg</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> gdal-dev <<a href="mailto:gdal-dev-bounces@lists.osgeo.org" target="_blank">gdal-dev-bounces@lists.osgeo.org</a>>
<b>Puolesta </b>Michal Kowalczuk via gdal-dev<br>
<b>Lähetetty:</b> perjantai 13. joulukuuta 2024 14.43<br>
<b>Vastaanottaja:</b> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<b>Aihe:</b> Re: [gdal-dev] WMTS generating GET URL problem<u></u><u></u></p>
</div></div></div><div lang="FI" link="blue" vlink="purple" style="word-wrap:break-word"><div class="m_7413682280990755690WordSection1">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">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" 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><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">pt., 13 gru 2024 o 13:15 Michał Kowalczuk <<a href="mailto:michkowalczuk@gmail.com" target="_blank">michkowalczuk@gmail.com</a>> napisał(a):<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal">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><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">One of the subdataset path generated by GDAL is<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><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><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">When I try to download a map I notice URL issue/error.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><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><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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="color:black;background:lime">//</span>EPSG:4326/EPSG:4326:7/27/129?format=image/jpeg</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">look at the double slash (//) chars in the above URL<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">When you go to service Capabilities you can find the following resource URL:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><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="color:black;background:lime">{style}</span>/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}?format=image/jpeg"/></b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">but in the layer definition <b>Style</b> tag is empty:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b><Style isDefault="true"><br>
<ows:Identifier/><br>
</Style></b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">This is probably the reason that GDAL make path using an empty string and this generate double slash chars.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If you remove redundant slash the server responses and returns a tile, the example:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><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><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">And the question is: is this service or GDAL bug? :-)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Wouldn't it be a good idea for GDAL to check the URL path for correctness before sending the request? <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Michał<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote></div></div>