Module gdal::config

source ·
Expand description

GDAL Configuration Functions

The GDAL library can be configured at runtime using environment variables or by using functions in this module. Options set by calling functions in this module override options set in environment variables.

use gdal::config::*;

// Increase GDAL's cache size to 1024Mb
set_config_option("GDAL_CACHEMAX", "1024").unwrap();

// Get the size of GDAL's cache
assert_eq!(get_config_option("GDAL_CACHEMAX", "").unwrap(), "1024");

// Set the cache size back to default
clear_config_option("GDAL_CACHEMAX").unwrap();

// Check the option has been cleared
assert_eq!(get_config_option("GDAL_CACHEMAX", "XXX").unwrap(), "XXX");

Refer to GDAL ConfigOptions for a full list of options.

Functions

Clear the value of a GDAL library configuration option
Get the value of a GDAL library configuration option
Set a GDAL library configuration option