[gdal-dev] Passing open options along dataset name in a string ?

Even Rouault even.rouault at spatialys.com
Mon Nov 2 02:10:11 PST 2020


Hi,

I've heard interest in having the capability of passing a GDAL dataset name 
and its open options in a single string, since this is easier for storing.

The syntax could be a JSON serialized string prefixed by GDAL_JSON: to avoid 
any ambiguity with drivers that would accept JSON as a connection string/
dataset name.

So something like:

GDAL_JSON:{"dataset":"foo.csv","open_options":["AUTODETECT_TYPE=YES", 
"KEEP_GEOM_COLUMNS=NO"]}

A "allowed_drivers" member could also be added to reflect the corresponding 
argument of GDALOpenEx()

GDALOpen()/GDALOpenEx() would parse this, and process that exactly as if it 
was called with the dataset name, open options and allowed drivers put in the 
dedicated C arguments. So no change in drivers, just in GDALOpenEx().

If using that syntax, it wouldn't make sense to have both serialized options 
and options passed as C-argument together, so a warning would be emitted if 
that happened

Thoughts ?

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list