Hi,
While waiting their reaction, download the GetCapabilities into a local file,
for example "wmts.xml". Edit the 24 occasions of style into
<Style isDefault="true">
<ows:Identifier>default</ows:Identifier>>
</Style>
Then you can do:
gdal_translate -srcwin 0 0 12235811 6137602 -outsize 512 512
WMTS:wmts.xml,layer=Ortho,tilematrixset=EPSG:4326 tile.png --debug on --config
GDAL_ENABLE_WMS_CACHE NO
The WMTS service comea from a GeoWebCache software and it seems that it is
possible to configure GWC so that the style has no identifier. It is a
GeoWebCache bug. I will make some more tests and create a ticket once I have
understood how such GWC misconfiguration can be done and corrected. Perhaps it
can happen only if the layer in the GWC cache comes from a layer group from
the WMS side. Maybe the service provider has not done anything wrong.
-Jukka Rahkonen-
Lähettäjä: Michał Kowalczuk <[email protected]>
Lähetetty: perjantai 13. joulukuuta 2024 16.02
Vastaanottaja: Rahkonen Jukka <[email protected]>
Kopio: [email protected]
Aihe: Re: [gdal-dev] WMTS generating GET URL problem
I did it before I wrote here :-)
Thank you for your time.
Regards,
Michał Kowalczuk
pt., 13 gru 2024 o 14:52 Rahkonen Jukka
<[email protected]<mailto:[email protected]>>
napisał(a):
Hi,
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
<ows:ElectronicMailAddress>[email protected]</ows:ElectronicMailAddress<mailto:[email protected]%3c/ows:ElectronicMailAddress>>
-Jukka Rahkonen-
Lähettäjä: Michał Kowalczuk
<[email protected]<mailto:[email protected]>>
Lähetetty: perjantai 13. joulukuuta 2024 15.38
Vastaanottaja: Rahkonen Jukka
<[email protected]<mailto:[email protected]>>
Kopio: [email protected]<mailto:[email protected]>
Aihe: Re: [gdal-dev] WMTS generating GET URL problem
so maybe this little fix for this should be madę in gdal.
if style isEmpty:
style="default"
W dniu pt., 13 gru 2024 o 14:32 Rahkonen Jukka
<[email protected]<mailto:[email protected]>>
napisał(a):
Hi,
By the standard Web Map Tile Service - Open Geospatial
Consortium<https://www.ogc.org/publications/standard/wmts/> "style" seems to be
mandatory in the layer data "One or more (mandatory)".
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).
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":
https://geoservices-urbis.irisnet.be/geowebcache/service/wmts/rest/Ortho/default/EPSG:4326/EPSG:4326:7/27/129?format=image/jpeg
-Jukka Rahkonen-
Lähettäjä: gdal-dev
<[email protected]<mailto:[email protected]>>
Puolesta Michal Kowalczuk via gdal-dev
Lähetetty: perjantai 13. joulukuuta 2024 14.43
Vastaanottaja: [email protected]<mailto:[email protected]>
Aihe: Re: [gdal-dev] WMTS generating GET URL problem
Sorry for the mistake in the last email. Instead of pasting gfdalinfo command i
should paste this:
gdal_translate -srcwin 0 0 12235811 6137602 -outsize 512 512
"WMTS: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
pt., 13 gru 2024 o 13:15 Michał Kowalczuk
<[email protected]<mailto:[email protected]>> napisał(a):
Hi,
Consider the following WMTS server:
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
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"
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//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/{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
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
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev