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

Even Rouault even.rouault at spatialys.com
Mon Nov 2 12:16:57 PST 2020


Sean,

> We already have a way of passing "open" options for vsicurl:
> https://gdal.org/user/virtual_file_systems.html#vsicurl-http-https-ftp-files
> -random-access. What about reusing that conceptual framework and syntax?
> 
> For example:
> 
> "foo.csv?AUTODETECT_TYPE=YES&KEEP_GEOM_COLUMNS=NO"

I actually considered that, but realized that things would get messy if you want
to use that vsicurl syntax and open options...

You would then have strings like

/vsicurl?max_retry=5&url=http://example.com/foo.csv&AUTODETECT_TYPE=YES&KEEP_GEOM_COLUMNS=NO

and the GDALOpen() logic would have to figure out whas is the /vsicurl part and the open option part.

Or we would have to URL-escape the "/vsicurl?max_retry=5&url=http://example.com/foo.csv" part
to avoid using '?' and '&', like:

/vsicurl%3Fmax_retry=5%26url=http://example.com/foo.csv?AUTODETECT_TYPE=YES&KEEP_GEOM_COLUMNS=NO


Another issue is we have connection strings like "WFS:http://example.com/wfs?SERVICE=WFS&VERSION=2.0.0" (or actually
just the "/vsicurl?max_retry=5&url=http://example.com/foo.csv" string mentioned above).
GDALOpen() would then mis-interpret this as dataset name = "WFS:http://example.com/wfs"
with open options SERVICE=WFS and VERSION=2.0.0

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


More information about the gdal-dev mailing list