[GIS] How to use the OGR/GDAL configure options in QGIS Python environment

gdalgmlogrpythonqgis

I'm looking for a solution how to use the OGR/GDAL configure options (–config) in the QGIS Python environment. http://trac.osgeo.org/gdal/wiki/ConfigOptions

Setting special configure options is necessary to load some data correctly (OGR Driver).

QgsVectorLayer(filename, title, "ogr") 

Best Answer

One usually sets options in C with CPLSetConfigOption. In python it would be gdal.SetConfigOption(option, value), e.g., gdal.SetConfigOption('PG_USE_COPY', 'YES')