<div dir="ltr">So we remain at the point that there is no good method that, using only GDAL, will allow to fully use the WMS service without additional work related to XML parsing...?<br><div><br></div><div>Best,</div><div>Michał Kowalczuk</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">wt., 10 wrz 2024 o 17:06 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">A sample from your link:<br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><i><Layer queryable="1" opaque="0"><br><Name>Rakennustietoruudukko_2017</Name><br><Title>Rakennustietoruudukko 2017</Title><br><Abstract>Tietoa rakennuksista 250 x 250m ruudukoissa pääkaupunkiseudulla</Abstract><br><KeywordList><br><Keyword>features</Keyword><br><Keyword>Rakennustietoruudukko_2017</Keyword><br></KeywordList><br><CRS>EPSG:3879</CRS><br><CRS>CRS:84</CRS><br><EX_GeographicBoundingBox><br><westBoundLongitude>24.50112802448554</westBoundLongitude><br><eastBoundLongitude>25.25849178466466</eastBoundLongitude><br><southBoundLatitude>60.052265324029165</southBoundLatitude><br><northBoundLatitude>60.39874702231777</northBoundLatitude><br></EX_GeographicBoundingBox><br><b><BoundingBox CRS="CRS:84" minx="24.50112802448554" miny="60.052265324029165" maxx="25.25849178466466" maxy="60.39874702231777"/><br><BoundingBox CRS="EPSG:3879" minx="6659998.5" miny="2.5472498E7" maxx="6698499.5" maxy="2.551425E7"/></b><br><Style><br><Name>polygon</Name><br><Title>Default polygon style</Title><br><Abstract>A sample style that just draws out a solid gray interior with a black 1px outline</Abstract><br><LegendURL width="20" height="20"><br><Format>image/png</Format><br><OnlineResource xmlns:xlink="<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.org/1999/xlink</a>" xlink:type="simple" xlink:href="<a href="https://kartta.hsy.fi/geoserver/asuminen_ja_maankaytto/ows?service=WMS&version=1.3.0&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=Rakennustietoruudukko_2017" target="_blank">https://kartta.hsy.fi/geoserver/asuminen_ja_maankaytto/ows?service=WMS&version=1.3.0&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=Rakennustietoruudukko_2017</a>"/><br></LegendURL><br></Style><br></Layer></i></blockquote></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">wt., 10 wrz 2024 o 17:05 Michał Kowalczuk <<a href="mailto:michkowalczuk@gmail.com" target="_blank">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"><div dir="auto">Ok, now I see the problem. Thank you Jukka for the explanation with a sample.</div><div>So maybe we can use information from <b>BoundingBox</b>?</div><div>and generate SUBDATASETS for each combination of Layer and BoundingBox definition that is usually defined for "best"/dedicated projections for a layer.</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><i>(7.2.4.6.8 )</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><i>A Layer may have multiple BoundingBox elements, but each one shall state a different CRS (...)</i></div><div><i>A Layer shall not provide a BoundingBox for a CRS it does not support. Conversely, a Layer may support CRSs</i></div><div><i>for which it does not provide a BoundingBox: a server that has the ability to transform data to different CRSs may</i></div><div><i>choose not to provide an explicit BoundingBox for every possible CRS available for each Layer. The server</i></div><div><i>should provide BoundingBox information for at least the native CRS of the Layer (that is, the CRS in which the</i></div><div><i>Layer is stored in the server’s database).</i></div><div><i><br></i></div></blockquote><div>Best,</div><div>Michał</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">W dniu wt., 10.09.2024 o 16:07 Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">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 lang="FI">
<div>
<p class="MsoNormal"><span>Hi<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<ul style="margin-top:0cm" type="disc">
<li style="margin-left:0cm"><span lang="EN-US">I meant to use CRSs only reported by GetCapabilities. I haven't seen that GetCapabilities returns so many (6782) possible projections...<u></u><u></u></span></li></ul>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I was meaning the same, CRSs reported in GetCapabilities. I used a search engine with phrase “service=WMS&version=1.3.0” and found in three minutes many examples, including this one
</span><a href="https://kartta.hsy.fi/geoserver/asuminen_ja_maankaytto/ows?service=WMS&version=1.3.0&request=GetCapabilities" target="_blank"><span lang="EN-US">kartta.hsy.fi/geoserver/asuminen_ja_maankaytto/ows?service=WMS&version=1.3.0&request=GetCapabilities</span></a><span lang="EN-US">.
If you want to see more, install Geoserver on your computer and have a look at the default GetCapabilities.<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">Finding the best CRS from WMS GetCapabilities is guesswork. The server above is a Finnish one so probably EPSG:3067 is the most native CRS because that is what we tend to use in Finland. However, there is also one and
only one additional BBOX for EPSG:3879 in GetCapabilities, but that would be somewhat odd selection for a country-wide CRS. It is also possible that for example some CRS of New Zealand does not really work in GetMap of the Finnish data even GetCapabilities
says it will. But when WMS is configured to show a short CRS list then I would trust that they are all good to use. Just be aware that the list can also be very long.<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">If you start implementing the LIST_ALL_SRS option, it should be noted that the service level CRS list applies to all layers, and each layer can add more CRSs to the list. Maybe in theory there could be even “crs-list-of-service-root
+ crs-list-of-group-layer + crs-list-of-child-layer”.<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">“7.2.4.6.7 CRS <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Every Layer is available in one or more layer coordinate reference systems. 6.7.3 discusses the Layer CRS. In
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">order to indicate which Layer CRSs are available, every named Layer shall have at least one <CRS> element that
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">is either stated explicitly or inherited from a parent Layer. The root <Layer> element shall include a sequence of
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">zero or more CRS elements listing all CRSs that are common to all subsidiary layers. A child layer may optionally
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">add to the list inherited from a parent layer. Any duplication shall be ignored by clients.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">When a Layer is available in several coordinate reference systems, the list of available CRS values shall be
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">represented as a sequence of <CRS> elements, each of which contains only a single CRS name.”<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>
<p class="MsoNormal"><span lang="EN-US"><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"><u></u> <u></u></span></p>
<div style="border-width:1pt medium medium;border-style:solid none none;padding:3pt 0cm 0cm;border-color:rgb(225,225,225) currentcolor currentcolor">
<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> tiistai 10. syyskuuta 2024 16.32<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></p></div></div></div><div lang="FI"><div><div style="border-width:1pt medium medium;border-style:solid none none;padding:3pt 0cm 0cm;border-color:rgb(225,225,225) currentcolor currentcolor"><p class="MsoNormal"><br>
<b>Aihe:</b> Re: [gdal-dev] WMS supported SRS<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Thank you for your feedback. My comments are below:<u></u><u></u></p>
<blockquote style="margin-left:30pt;margin-right:0cm">
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><i>It means that there are tens of thousands WMS services which support 6782 different projections for each layer (checked from Geoserver version 2.25.3). I would not like them all to be reported as subdatasets.</i><u></u><u></u></p>
</div>
</blockquote>
<div>
<p class="MsoNormal">I meant to use CRSs only reported by GetCapabilities. I haven't seen that GetCapabilities returns so many (6782) possible projections...<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<blockquote style="margin-left:30pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal"><i>WMS standard also does not define any default CRS and the first one on the list in GetCapabilities does not need to be the best.</i><u></u><u></u></p>
</div>
</div>
</div>
</blockquote>
<div>
<div>
<p class="MsoNormal">Therefore, the current form of the generating subdatasets names method for WMS driver is even more useless, if we have a non-default (not the best) projection for the data.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">And the only good way to work with it is to parse XML and generate paths manually... <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">That's why I favor Even's option to introduce open option LIST_ALL_SRS=YES/NO.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Any more thoughts? <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Michał Kowalczuk<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">wt., 10 wrz 2024 o 15:03 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-width:medium medium medium 1pt;border-style:none none none solid;padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)">
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi,</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">WMTS typically supports a rather small number of tilematrices and tiles are usually cached, so it makes a lot of sense to advertise the available matrices and
utilize them. On the other hand WMS maps are created on-the-fly and there is very low technical cost on the server side to support however many projections. WMS standard also does not define any default CRS and the first one on the list in GetCapabilities
does not need to be the best.</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">I guess that Geoserver is the most common WMS server in the world and amazingly many Geoservers run with the default settings. It means that there are tens of
thousands WMS services which support 6782 different projections for each layer (checked from Geoserver version 2.25.3). I would not like them all to be reported as subdatasets.</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">I can see that ogrinfo and the OGC API Features driver report the list of supported projections. Test with ogrinfo OAPIF:<a href="https://ogc-api.nrw.de/inspire-us-feuerwehr" target="_blank">https://ogc-api.nrw.de/inspire-us-feuerwehr</a>
-al -so shows “Supported SRS: OGC:CRS84, EPSG:25832, EPSG:25833, EPSG:4258, EPSG:4326, EPSG:3395, EPSG:3857, EPSG:3034, EPSG:3035”</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Something similar might be an option for gdalinfo, but still about 6782 EPSG codes per layer is too much to be viewed by default. Maybe the CRS list could be
reported under some metadata domain that user could read on demand?</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>
<p class="MsoNormal"><span lang="EN-US"> </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"> </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"> </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"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<div style="border-width:1pt medium medium;border-style:solid none none;padding:3pt 0cm 0cm;border-color:rgb(225,225,225) currentcolor currentcolor">
<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> tiistai 10. syyskuuta 2024 15.15<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] WMS supported SRS<u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">I found that there was a similar issue in 2021 without any specific answer:<u></u><u></u></p>
<div>
<p class="MsoNormal"><a href="https://www.mail-archive.com/gdal-dev@lists.osgeo.org/msg35549.html" target="_blank">https://www.mail-archive.com/gdal-dev@lists.osgeo.org/msg35549.html</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I wonder if getting SUBDATASETS shouldn't return the result in a similar way as it does for WMTS service,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">where GDAL generates paths to all layer/tilematrix/tilematrixset combination.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">For example if layer is available in 3 SRS, GDAL produces 3 subdatasets, so using only SUBDATASE_NAME property user has access to all map services shared by WMTS server.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">In my opinion, GDAL should use the same approach for WMS. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Does anyone object?<u></u><u></u></p>
</div>
<p class="MsoNormal">I will then submit a new feature request/bug report.<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Best regards and have a nice day<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Michał Kowalczuk<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">pon., 9 wrz 2024 o 16:17 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-width:medium medium medium 1pt;border-style:none none none solid;padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal">Does GDAL provides a method to get supported spatial reference systems by WMS service?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b>GDALGetMetadata(SUBDATASETS)
</b>generate links only for the first (default) SRS from GetCapabilities, so this won't be helpful.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Working with WFS I can get supported SRS using OGR <b>OGR_L_GetSupportedSRSList </b>function.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Does GDAL offers something similar for WMS, or should I get this information from GetCapabilities XML by myself?<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">Michal <u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>