<div dir="ltr"><div>Hi Even,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 4, 2020 at 9:01 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> > Another particularity we have in GDAL is that the dataset name might be<br>
> > almost<br>
> > anything. Most of the time, it is a regular file path, or some /vsi path.<br>
> > But<br>
> > sometimes, it can be JSON content (the GeoJSON driver accepts the content<br>
> > to<br>
> > be directly provided as the dataset name), or XML (VRT, WMS drivers).<br>
> > We have also the subdataset syntax "HDF5:foo.hdf:my_variable"<br>
> <br>
> Could VRT XML and JSON be exempted? We already have a way to embed open<br>
> options in the XML.<br>
<br>
If the gdn: mechanism is a new possibility offered that doesn't exclude <br>
existing ones (otherwise that would be a pretty big breaking change), we could <br>
possibly exempt the odd cases I mentioned (or have some quoting/escaping rules <br>
to enable that payload to be seen as a file), which generally don't need a <br>
"permanent" way of refering to the dataset like gdn: would offer, since this <br>
is content often generated programatically or retrieved dynamically.<br>
<br>
Covering subdataset would be a more important use case. Something that would <br>
have to be decided if the way we express subdatasets would be somehow <br>
standardized or if it would be a black-box string for the gdn: encapsulation. <br>
For a black-box approach, we would have to define some escaping/quoting rules <br>
to avoid any potential issue with separators of the gdn syntax. If we decide <br>
that the subdataset syntax is part of what is standardized by GDN that would <br>
be a more challenging exercice, because the subdataset syntax varies from <br>
driver to driver.<br></blockquote><div><br></div><div><div>The variation of subdataset syntax among drivers is a bug, let's try to fix this.</div><div></div></div><div><br></div><div>It seems to me that the internet way to address subdatasets would be to use a # URL fragment. But since most of our formats and the servers that serve files of these formats are not aware, we may have to come up with something different. We may need to consider making subdatasets a layer opening option?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">pending on how we design things, that might impact between:<br>
- just GDALOpen() generic code if GDALOpen() decodes the gdn: string to <br>
decompose it into 'classic' dataset names and open options<br>
- all drivers if the gdn: string would be passed to each GDALDriver::pfnOpen() <br>
implementation<br>
- intermediate situation if we decide to drop (at least for future drivers) <br>
per-driver subdataset syntax (which has deficiencies has the quoting rules to <br>
separate the filename from the non-filename component vary from driver to <br>
driver, and are most of the time not defined) to come up with something more <br>
standardized<br>
<br>
To help brainstorming, a non-exhaustive overview of a few situations mixing <br>
driver prefixing, subdataset syntax and open options:<br>
<br>
gdalinfo my.tif<br></blockquote><div><br></div><div>Yes. We have to handle bare paths to local dataset files.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
gdalinfo my.tif -oo GEOREF_SOURCES=WORLDFILE,PAM<br></blockquote><div><br></div><div>Ideally this would be baked into the format, but, yes, I think we've got a bead on dataset open options.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
gdalinfo GTIFF_DIR:0:d:\my.tif<br></blockquote><div><br></div><div>WTF is this? :)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
gdalinfo EEDAI:my/asset<br>
gdalinfo EEDAI: -oo ASSET=my/asset<br>
gdalinfo EEDAI:my/asset:band1, band2<br>
gdalinfo EEDAI: -oo ASSET=my/asset -oo BANDS=band1,band2<br></blockquote><div><br></div><div>Never seen these.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
gdalinfo BAG:"data/test_vr.bag":supergrid:0:1<br></blockquote><div><br></div><div>DRIVER:"file":something</div><div><br></div><div>Right. This will require some work because of multiple colons. Though I've never seen BAG driver data in the wild. Is this a real live format?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
gdalinfo data/test_vr.bag -oo MODE=RESAMPLED_GRID -oo SUPERGRIDS_MASK=YES<br>
gdalinfo HDF5:"d:\foo.he5"://HDFEOS/SWATHS/foo/bar<br></blockquote><div><br></div><div>HDF5 driver, filename using Windows drive, and UNC path within it. This is marginal, right?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
gdalinfo netCDF:"/vsicurl/<a href="http://example.com/my.nc" rel="noreferrer" target="_blank">http://example.com/my.nc</a>":my_var<br></blockquote><div><br></div><div>This looks less complicated than some of the examples above.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
ogrinfo "PG:dbname=testdb user=foo"<br>
ogrinfo "mySQL:testdb,user=foo"<br></blockquote><div><br></div><div>These seem like they could be driver specific, but generalized key-value parameters.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
ogrinfo OCI:warmerda/<a href="mailto:password@gdal800.dreadfest.com" target="_blank">password@gdal800.dreadfest.com</a></blockquote><div><br></div><div>Wat?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
GDALOpen() is not even aware that HDF5:bla means that the dataset will be <br>
recognized by the HDF5 driver<br>
<br></blockquote><div><br></div><div>Wait what?</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Sean Gillies</div></div></div>