[gdal-dev] Is there a way to put config options in a vrt?

Even Rouault even.rouault at spatialys.com
Mon Feb 20 05:36:01 PST 2023


Hi Mike,

no you can't specify configuration options in a VRT, since some of them 
have security implications (particularly the GDAL_VRT_ENABLE_PYTHON one 
that could lead to arbitrary code execution, but other ones might also 
have impacts).

One possibility would be to have a syntax like the following where we'd 
embed relevant parameters similarly to what is allowed for /vsicurl/:

/vsis3?no_sign_request=yes&s3_endpoint=s3.eu-central-1.wasabisys.com&object=/openlandmap/dtm/dtm.bareearth_ensemble_p10_30m_s_2018_go_epsg4326_v20230210.tif

But for that particular use case, you can probably just use the existing 
/vsicurl syntax, with a empty_dir=yes option (I realize this particular 
one isn't documented yet in 
https://gdal.org/user/virtual_file_systems.html#vsicurl-http-https-ftp-files-random-access. 
Cf https://github.com/OSGeo/gdal/issues/7163 for a related discussion), 
to avoid probing unexisting side car files:

/vsicurl/empty_dir=yes&url=https://s3.eu-central-1.wasabisys.com/openlandmap/dtm/dtm.bareearth_ensemble_p10_30m_s_2018_go_epsg4326_v20230210.tif

Even

Le 20/02/2023 à 12:56, michael.smith.erdc at gmail.com a écrit :
> Is there a method to add gdal configuration options to a VRT so that they are carried around with it?
>
> For example:
> gdalbuildvrt openlandmap_dtm.vrt /vsis3/openlandmap/dtm/dtm.bareearth_ensemble_p10_30m_s_2018_go_epsg4326_v20230210.tif --config AWS_NO_SIGN_REQUEST YES --config AWS_S3_ENDPOINT s3.eu-central-1.wasabisys.com
>
> works as those config options can be set at the command line or an env variables. But when the vrt is separated, it doesn’t. Is there a way to get them added to the vrt so those are applied at runtime?
>
> Mike
>
> Michael Smith
> US Army Corps
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list