[gdal-dev] Formalizing GDAL "file name" syntax in an RFC?

ElPaso elpaso at itopen.it
Fri Sep 15 07:23:52 PDT 2023


Il 14/09/23 17:14, Sean Gillies ha scritto:
> Hi all,
>
> In https://github.com/OSGeo/gdal/pull/8155#issuecomment-1704923263 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.
>
> 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.
>
> 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.
>

Hi Sean,


I totally agree that it would be useful to have a formally defined 
syntax to describe data sources, we have the same problem with QGIS 
QgsDataSourceUri and we are treating the URIs as a private 
implementation detail, but in QGIS we have a GUI to set the data source 
strings that partially mitigatest the issue.


We discussed a few times what it could be the best format to encode a 
data source and URL encoding is probably a good candidate because it's 
well known and well supported by libraries.


Maybe something like:


<driver_name>://<path|connection>/<arguments ...>

mssql://username:password@hostname:port/?table=table_name&arg1=arg1...

gpkg:///path/to.gpkg?table=table_name&arg1=arg1...

postgis://username:password@hostname:port/?table=table_name&arg1=arg1...

shapefile:///path/to.shp/?arg1=arg1...


-- 
Alessandro Pasotti
w3: www.itopen.it



More information about the gdal-dev mailing list