GDAL Options

Each GDAL driver has a set of specific options to modify the behavior of the driver. These options can be configured in the GeoDMS.

Consult the vector drivers and/or raster drivers specification of the driver to see what options are supported.

Options are configured as Parameter (1 option) or Attribute (1 or more options). If configured as attribute the Domain unit is usually named: optionSet.

An important distinction is made between open/read options for reading data with GDAL and creations options for writing data with GDAL.

open/read options

Open/read options are configured with Tree item name: GDAL_Options.

The following examples show how to configure the option for reading a Csv file without a header:

1. parameter<string> GDAL_Options: [ 'HEADERS=NO'];

2. unit<uint32> optionSet := range(uint32, 0, 1);
   attribute<string> GDAL_Options (optionSet) : [ 'HEADERS=NO'];

create/write options

Create/write options are configured with Tree item name: GDAL_LayerCreationOptions.

The following examples show how to configure the option for writing a Csv file with a comma as separator:

1. parameter<string> GDAL_LayerCreationOptions: [ 'SEPARATOR=COMMA'];

2. unit<uint32> optionSet := range(uint32, 0, 1);
   attribute<string> GDAL_LayerCreationOptions (optionSet) : [ 'SEPARATOR=COMMA'];

configuration options

GDAL configuration options are configured with Tree item name: GDAL_ConfigurationOptions. For instance setting SQLite journal file to ‘OFF’:

1. parameter<string> GDAL_ConfigurationOptions: ['OGR_SQLITE_JOURNAL=OFF'];

Every read with Gdal.vect sets OGR_PARQUET_COMPUTE_GEOMETRY_TYPE=NO, unless GDAL_ConfigurationOptions or an environment variable sets that option; see Parquet for why and what it changes.

where to configure the options

The GeoDMS looks the option items up by name from the item with the StorageName: first among its own subitems, then in the containers around it, as for any other name. So they can be configured in the storage item itself or next to it, as the examples on Csv and ESRI Shapefile do.

An option item that is a subitem of a storage being written with Gdalwrite.vect or gdalwrite.grid is not written to that storage itself.

combining options

Options can be combined, for multiple options always use an Attribute. The following example shows the configuration of reading a geoTiff with LZW compression, predictor level 2 and multithreading:

unit<uint32> optionSet := range(uint32, 0, 3);
attribute<string> GDAL_Options (optionSet): ['NUM_THREADS=ALL_CPUS', 'COMPRESS=LZW', 'PREDICTOR=2'];

files written by older versions

A version before 20.29.0 takes an option item that is a subitem of a storage written with Gdalwrite.vect or gdalwrite.grid for a column of that storage: gdalwrite.vect ends with Domain mismatch between Domain of attribute (…) and layerDomain ( : void), gdalwrite.grid with Failure during Writing, and a layer Unit that is itself the storage loses its geometry. Options configured next to the storage work in every version.