Skip to content

Commit

Permalink
Doc: add generic config option description from Trac [skip travis] [s…
Browse files Browse the repository at this point in the history
…kip appveyor]
  • Loading branch information
rouault committed Dec 2, 2019
1 parent 8f1d98c commit 0db5542
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 10 deletions.
64 changes: 64 additions & 0 deletions gdal/doc/source/user/configoptions.rst
@@ -0,0 +1,64 @@
.. configoptions:
================================================================================
Configuration options
================================================================================

This page discussed runtime configuration options for GDAL, and is distinct from
options to the build-time configure script. Runtime configuration options apply
on all platforms, and are evaluated at runtime. They can be set programmatically,
by commandline switches or in the environment by the user.

Configuration optoins are normally used to alter the default behavior of GDAL/OGR
drivers and in some cases the GDAL/OGR core. They are essentially global
variables the user can set.

How to set configuration options ?
----------------------------------

One example of a config option is the GDAL_CACHEMAX option. It controls the size
of the GDAL block cache, in megabytes. It can be set in the environment on Unix
(bash/bourne) shell like this:

::

export GDAL_CACHEMAX=64

In a DOS/Windows command shell it is done like this:

::

set GDAL_CACHEMAX=64

It can also be set on the commandline for most GDAL and OGR utilities with the
``--config`` switch, though in a few cases these switches are not evaluated in
time to affect behavior.

::

gdal_translate --config GDAL_CACHEMAX 64 in.tif out.tif

In C/C++ configuration switches can be set programmatically with
:cpp:func:`CPLSetConfigOption`:

.. code-block:: c
#include "cpl_conv.h"
...
CPLSetConfigOption( "GDAL_CACHEMAX", "64" );
Normally a configuration option applies to all threads active in a program, but
they can be limited to only the current thread with
:cpp:func:`CPLSetThreadLocalConfigOption`

.. code-block:: c
CPLSetThreadLocalConfigOption( "GTIFF_DIRECT_IO", "YES" );
For boolean options, the values YES, TRUE or ON can be used to turn the option on;
NO, FALSE or OFF to turn it off.

List of configuration options and where they apply
--------------------------------------------------

.. include:: configoptions_index_generated.rst
9 changes: 0 additions & 9 deletions gdal/doc/source/user/configoptions_index.rst

This file was deleted.

2 changes: 1 addition & 1 deletion gdal/doc/source/user/index.rst
Expand Up @@ -14,4 +14,4 @@ User oriented documentation
ogr_sql_sqlite_dialect
GDAL Virtual File Systems <virtual_file_systems>
ogr_feature_style
configoptions_index
configoptions

0 comments on commit 0db5542

Please sign in to comment.