<div dir="ltr"><div dir="ltr"><div>Even,</div><div><br></div><div>I agree that there is an untidy legacy. And it's probably not worth formalizing the marginal filenames and connection strings. How about an RFC and formal syntax only for hierarchical datasets then? It seems like this is the direction the industry is growing.<br></div><div><br></div><div>Yes, I think a formal syntax for /vsi filenames would be useful. It's almost done already, right? Only in prose, not ABNF (or whatever), but that's a good start.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 14, 2023 at 10:21 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">
  
    
  
  <div>
    <p>Sean,</p>
    <p>It is far from obvious to me to find a universal pattern that
      would fit existing and future use cases. If we would find a
      universal syntax, there would be the problem of deciding what to
      do with code that doesn't match it: support only new way (breaking
      external code),  or supporting both old and new ways (additional
      complexity in our code base)<br>
    </p>
    <p>How would we deal with the existing practices which are very
      diverse ? Examples:</p>
    <p>- True filenames (most of the drivers)<br>
    </p>
    <p>- Database based drivers:<br>
    </p>
    <pre><span>PG</span><span>:</span><span>"dbname='databasename' host='addr' port='5432' user='x' password='y'"   (Postgis vector)
</span><span><span>PG</span><span>:</span><span>"[host=''] [port=''] [dbname='' [user=''] [password=''] [schema=''] [table=''] [column=''] [where=''] [mode=''] [outdb_resolution='']"</span>  (Postgis raster, consistent with previous one)
MYSQL:dbname,user="userid",password="password",host=x,port=y
OCI:u</span><span>sername</span><span>/</span><span>password</span><span>@host_name</span><span>:</span><span>port_number</span><span>/</span><span>service_name</span><span>:</span><span>MY_SCHEMA</span><span>.</span><span>MY_VIEW
</span>georaster:<user>{,/}<pwd>{,@}[db],[schema.][table],[column],[where]
georaster:<user>{,/}<pwd>{,@}[db],<rdt>,<rid><span></span>

</pre>
    <p>- Web services (some of them also accept plain filenames that are
      .xml files describing the service and parameters)</p>
    <pre><span>WMS:<a href="http://demo.opengeo.org/geoserver/gwc/service/wms?SERVICE=WMS&VERSION=1" target="_blank">http://demo.opengeo.org/geoserver/gwc/service/wms?SERVICE=WMS&VERSION=1</a>.</span><span>1.1&</span>
                            <span>REQUEST</span><span>=</span><span>GetMap</span><span>&</span><span>LAYERS</span><span>=</span><span>og</span><span>%</span><span>3</span><span>Abugsites</span><span>&</span><span>SRS</span><span>=</span><span>EPSG</span><span>:</span><span>900913</span><span>&</span>
                            <span>BBOX</span><span>=-</span><span>1.15841845090625E7</span><span>,</span><span>5479006.186718751</span><span>,</span><span>-</span><span>1.1505912992109375E7</span><span>,</span><span>5557277.703671876</span><span>&</span>
                            <span>FORMAT</span><span>=</span><span>image</span><span>/</span><span>png</span><span>&</span><span>TILESIZE</span><span>=</span><span>256</span><span>&</span><span>OVERVIEWCOUNT</span><span>=</span><span>25</span><span>&</span><span>MINRESOLUTION</span><span>=</span><span>0.0046653459640220</span><span>&</span><span>TILED</span><span>=</span><span>true</span><span>"
(note the mix of pure WMS GetMap request query parameters + GDAL specific properties TILESIZE, OVERVIEWCOUNT, MINRESOLUTION)
</span></pre>
    <p></p>
    <pre><span>WCS:<a href="http://194.66.252.155/cgi-bin/BGS_EMODnet_bathymetry/ows?VERSION=1.1.0&coverage=BGS_EMODNET_CentralMed-MCol" target="_blank">http://194.66.252.155/cgi-bin/BGS_EMODnet_bathymetry/ows?VERSION=1.1.0&coverage=BGS_EMODNET_CentralMed-MCol</a></span>
<span>WFS</span><span>:</span><span>http</span><span>:</span><span>//</span><span>www2</span><span>.</span><span>dmsolutions</span><span>.</span><span>ca</span><span>/</span><span>cgi</span><span>-</span><span>bin</span><span>/</span><span>mswfs_gmap
</span>OAPIF:<a href="https://www.ldproxy.nrw.de/rest/services/kataster" target="_blank">https://www.ldproxy.nrw.de/rest/services/kataster</a>
<span>WMTS:<a href="http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml,layer=lb" target="_blank">http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml,layer=lb</a></span>
( layer= is GDAL specific)
</pre>
    <br>
    <p>- Raster subdatasets (whether to surround filename with double
      quotes is driver specific)<br>
    </p>
    <p>NITF_IM:{image_number}:{filename}<br>
NITF_TOC_ENTRY:{product_type}_{chartname}_{scale}_{somenumber}_{anothernumber}:GNCJNCN/rpf/a.toc<br>
      ECRG_TOC_ENTRY:{product_name}:{disk_name}:{scale}:{filename}<br>
      GTIFF:{directory_number}:{filename}<br>
      GTIFF:off:{directory_offset}:{filename}<br>
      GPKG:{filename}:{tablename}<br>
      netCDF:{filename}:{variable_name}<br>
      HDF5:{filename}:{dataset_path}<br>
      ZARR:{filename}  (mostly when filename is /vsicurl/ and we don't
      have a ReadDirectory() API)<br>
      ZARR:{filename}:{path_to_array}<br>
ZARR:{filename}:{path_to_array}:{third_dim_index}[:{fourth_dim_index}[:{fifth_dim_index}...]]<br>
    </p>
    <p>- Other syntax</p>
    <p>vrt:// connection string
      (<a href="https://gdal.org/drivers/raster/vrt.html#vrt-connection-string" target="_blank">https://gdal.org/drivers/raster/vrt.html#vrt-connection-string</a>) .
      e.g.  vrt://my.tif?bands=3,2,1
    </p>
    <p>Do you have also /vsi syntax in mind ?<br>
    </p>
    <p>Even<br>
    </p>
    <pre><span></span><span></span><span></span></pre>
    <p></p>
    <div>Le 14/09/2023 à 17:14, Sean Gillies a
      écrit :<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div>Hi all,<br>
        </div>
        <div><br>
        </div>
        <div>In <a href="https://github.com/OSGeo/gdal/pull/8155#issuecomment-1704923263" target="_blank">https://github.com/OSGeo/gdal/pull/8155#issuecomment-1704923263</a>
          I think I see (for the first time?) the beginning of a
          specification of the syntax for GDAL "file names". I think it
          would be helpful if there was an RFC for this.</div>
        <div><br>
        </div>
        <div>I'm sure a lot of applications construct GDAL file names
          without much understanding of what's correct or incorrect. A
          formal spec could help make it more likely that anyone can
          construct a valid filename on the first try.</div>
        <div><br>
        </div>
        <div>A stretch goal for the RFC could be to come up with a
          syntax that is sufficiently general that authors of new format
          drivers don't have to create their own new idiosyncratic file
          names.<br>
        </div>
        <div><br>
        </div>
        <span class="gmail_signature_prefix">-- </span><br>
        <div dir="ltr" class="gmail_signature">Sean Gillies</div>
      </div>
      <br></blockquote></div>

</blockquote></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Sean Gillies</div></div>