<div dir="ltr">I did it before I wrote here :-)<div>Thank you for your time.</div><div><br></div><div>Regards,</div><div>Michał Kowalczuk</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">pt., 13 gru 2024 o 14:52 Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</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 class="msg-1288237973756925105">
<div lang="FI" style="overflow-wrap: break-word;">
<div class="m_8055515420842109103WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<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">The idea behind all standardization work is not that every single client must be made to deal with servers which break the standard. Contact the server provided and ask them to fix their
configuration. There seems to be a contact address in GetCapabilities </span><span class="m_8055515420842109103html-tag"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New""><ows:ElectronicMailAddress></span></span><span style="font-size:10pt;font-family:"Courier New";color:black"><a href="mailto:irisline@paradigm.brussels%3c/ows:ElectronicMailAddress" target="_blank"><span lang="EN-US">irisline@paradigm.brussels</ows:ElectronicMailAddress</span></a></span><span class="m_8055515420842109103html-tag"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New"">><u></u><u></u></span></span></p>
<p class="MsoNormal"><span class="m_8055515420842109103html-tag"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New""><u></u> <u></u></span></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-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> Michał Kowalczuk <<a href="mailto:michkowalczuk@gmail.com" target="_blank">michkowalczuk@gmail.com</a>>
<br>
<b>Lähetetty:</b> perjantai 13. joulukuuta 2024 15.38<br>
<b>Vastaanottaja:</b> Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>><br>
<b>Kopio:</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>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">so maybe this little fix for this should be madę in gdal.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">if style isEmpty:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> style=„default”<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">W dniu pt., 13 gru 2024 o 14:32 Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>> napisał(a):<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></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)”.
</span><u></u><u></u></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).</span><u></u><u></u></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></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 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>
<div>
<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-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<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>
</div>
</div>
</div></blockquote></div>