<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>If you struggle with quoting, the easiest would be to "alias"
complex connections strings as VRT with</p>
<p>gdal_translate "STACIT: .. complex stuff here.." my_stacit.vrt</p>
<p>and the use "vrt://my_stacit.vrt?...."</p>
<p>There should be hardly any performance overhead doing that since
the VRT driver is optimized to detect situations like that where
it is used as a passthrough.<br>
</p>
<p>On Linux/Unix you can actually avoid creating an actual vrt file
and just create a symbolic link:</p>
<p>$ ln -sf
"STACIT:\<a class="moz-txt-link-rfc2396E" href="https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=naip&bbox=-100,40,-99,41&datetime=2019-01-01T00:00:00Z%2F..\">"https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=naip&bbox=-100,40,-99,41&datetime=2019-01-01T00:00:00Z%2F..\"</a>:asset=image"
my_stacit<br>
$ gdalinfo vrt://my_stacit <br>
</p>
<p>That's a trick I use often to make it easier in QGIS to use such
non-file datasets.<br>
</p>
<p></p>
<div class="moz-cite-prefix">Le 22/11/2024 à 10:53, Rahkonen Jukka
via gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:AS5PR09MB68975316515A04673EA72877FD232@AS5PR09MB6897.eurprd09.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator"
content="Microsoft Word 15 (filtered medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:"Segoe UI Emoji";
panose-1:2 11 5 2 4 2 4 2 2 3;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}pre
{mso-style-priority:99;
mso-style-link:"HTML-esimuotoiltu Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}span.HTML-esimuotoiltuChar
{mso-style-name:"HTML-esimuotoiltu Char";
mso-style-priority:99;
mso-style-link:HTML-esimuotoiltu;
font-family:Consolas;
mso-fareast-language:FI;}span.Shkpostityyli21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
mso-ligatures:none;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US">In case of STACIT, I can’t discover how to use
the vrt:// connection string
<a
href="https://gdal.org/en/latest/drivers/raster/vrt.html#vrt-connection-string"
moz-do-not-send="true" class="moz-txt-link-freetext">
https://gdal.org/en/latest/drivers/raster/vrt.html#vrt-connection-string</a>
with subdataset name (or even without). Can you?<br>
<br>
Start with <br>
gdalinfo
"STACIT:\<a class="moz-txt-link-freetext" href="https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=naip^&bbox=-100,40,-99,41^&datetime=2019-01-01T00:00:00Z%2F..\">https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=naip^&bbox=-100,40,-99,41^&datetime=2019-01-01T00:00:00Z%2F..\</a><br>
and try to show a vrt:// string for<br>
SUBDATASET_1_NAME=STACIT:<a class="moz-txt-link-freetext" href="https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=naip&bbox=-100,40,-99,41&datetime=2019-01-01T00:00:00Z%2F..:asset=image">https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=naip&bbox=-100,40,-99,41&datetime=2019-01-01T00:00:00Z%2F..:asset=image</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US">-Jukka-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"
lang="EN-US"><o:p> </o:p></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> Michael Sumner
<a class="moz-txt-link-rfc2396E" href="mailto:mdsumner@gmail.com"><mdsumner@gmail.com></a> <br>
<b>Lähetetty:</b> perjantai 22. marraskuuta 2024 11.10<br>
<b>Vastaanottaja:</b> Rahkonen Jukka
<a class="moz-txt-link-rfc2396E" href="mailto:jukka.rahkonen@maanmittauslaitos.fi"><jukka.rahkonen@maanmittauslaitos.fi></a><br>
<b>Aihe:</b> Re: [gdal-dev] Issue with the STACIT usage
examples<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Fri, 22 Nov 2024, 03:52 Rahkonen
Jukka via gdal-dev, <<a
href="mailto:gdal-dev@lists.osgeo.org"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a>>
wrote:<o:p></o:p></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>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-US">Understood, and good reason to
start using the new gdalinfo convenience option
"-sd" for selecting sub-datasets by their index.</span><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Do beware that index isn't necessarily
reliable (good old netcdf), it can change through an
ostensibly consistent dataset while name does remain
robust.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">vrt:// has sd_name for this purpose,
and to avoid driver declaration with full subdataset
syntax. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I may have considered sd_name for
gdalinfo ?? probably a good idea. And maybe something to
put on the 4.0 break list
<span
style="font-family:"Segoe UI Emoji",sans-serif">🙏</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers, Mike<o:p></o:p></p>
</div>
<div>
<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>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="SV">gdalinfo "STACIT:\</span><span
lang="EN-US"><a
href="https://paituli.csc.fi/geoserver/ogc/stac/v1/search?collections=corine_land_cover_at_geocubes%5C"
target="_blank" moz-do-not-send="true"><span
lang="SV">https://paituli.csc.fi/geoserver/ogc/stac/v1/search?collections=corine_land_cover_at_geocubes\</span></a></span><span
lang="SV">" -sd 2</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="SV"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="SV">-Jukka-</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="SV"> </span><o:p></o:p></p>
<div>
<div
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>Lähettäjä:</b>
Even Rouault <<a
href="mailto:even.rouault@spatialys.com"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">even.rouault@spatialys.com</a>>
<br>
<b>Lähetetty:</b> torstai 21. marraskuuta 2024
18.36<br>
<b>Vastaanottaja:</b> Rahkonen Jukka <<a
href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank"
moz-do-not-send="true"
class="moz-txt-link-freetext">jukka.rahkonen@maanmittauslaitos.fi</a>>;
Daniel Evans <<a
href="mailto:daniel.fred.evans@gmail.com"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">daniel.fred.evans@gmail.com</a>><br>
<b>Kopio:</b> '<a
href="mailto:gdal-dev@lists.osgeo.org"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a>'
(<a href="mailto:gdal-dev@lists.osgeo.org"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a>)
<<a href="mailto:gdal-dev@lists.osgeo.org"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a>><br>
<b>Aihe:</b> Re: [gdal-dev] Issue with the
STACIT usage examples<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><o:p> </o:p></p>
<blockquote
style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-US">However, the subdataset names
on the list are not accepted as-is without
small edits.<br>
Does not work:<br>
gdalinfo STACIT:<a
href="https://paituli.csc.fi/geoserver/ogc/stac/v1/search?collections=corine_land_cover_at_geocubes"
target="_blank" moz-do-not-send="true">"https://paituli.csc.fi/geoserver/ogc/stac/v1/search?collections=corine_land_cover_at_geocubes"</a>:asset=1000m</span><o:p></o:p></p>
</div>
</blockquote>
<p>That's "expected". Subdataset names are designed
to be used verbatim by GDALOpen(). The STACIT
driver isn't aware it has been invoked from a
shell and which quoting rules would apply.<o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><o:p> </o:p></p>
<pre>-- <o:p></o:p></pre>
<pre><a href="http://www.spatialys.com/"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
<pre>Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.<o:p></o:p></pre>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">gdal-dev@lists.osgeo.org</a><br>
<a
href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.</pre>
</body>
</html>