rasterio._env module¶
GDAL and OGR driver and configuration management
The main thread always utilizes CPLSetConfigOption. Child threads utilize CPLSetThreadLocalConfigOption instead. All threads use CPLGetConfigOption and not CPLGetThreadLocalConfigOption, thus child threads will inherit config options from the main thread unless the option is set to a new value inside the thread.
-
class
rasterio._env.ConfigEnv¶ Bases:
objectConfiguration option management
-
clear_config_options()¶ Clear GDAL config options.
-
get_config_options()¶
-
options¶
-
update_config_options()¶ Update GDAL config options.
-
-
class
rasterio._env.GDALDataFinder¶ Bases:
objectFinds GDAL data files
Note: this is not part of the public API in 1.0.x.
-
find_file(basename)¶ Returns path of a GDAL data file or None
- Parameters
basename (str) – Basename of a data file such as “header.dxf”
- Returns
- Return type
str (on success) or None (on failure)
-
search(prefix=None)¶ Returns GDAL data directory
Note well that os.environ is not consulted.
- Returns
- Return type
str or None
-
search_debian(prefix='/home/docs/checkouts/readthedocs.org/user_builds/rasterio-spestana/conda/latest')¶ Check Debian locations
-
search_prefix(prefix='/home/docs/checkouts/readthedocs.org/user_builds/rasterio-spestana/conda/latest')¶ Check sys.prefix location
-
search_wheel(prefix=None)¶ Check wheel location
-
-
class
rasterio._env.GDALEnv¶ Bases:
rasterio._env.ConfigEnvConfiguration and driver management
-
drivers()¶
-
start()¶
-
stop()¶
-
-
class
rasterio._env.PROJDataFinder¶ Bases:
objectFinds PROJ data files
Note: this is not part of the public API in 1.0.x.
-
has_data()¶ Returns True if PROJ’s data files can be found
- Returns
- Return type
bool
-
search(prefix=None)¶ Returns PROJ data directory
Note well that os.environ is not consulted.
- Returns
- Return type
str or None
-
search_prefix(prefix='/home/docs/checkouts/readthedocs.org/user_builds/rasterio-spestana/conda/latest')¶ Check sys.prefix location
-
search_wheel(prefix=None)¶ Check wheel location
-
-
rasterio._env.catch_errors()¶ Intercept GDAL errors
-
rasterio._env.del_gdal_config()¶ Delete a GDAL configuration option.
- Parameters
key (str) – Name of config option.
-
rasterio._env.driver_count()¶ Return the count of all drivers
-
rasterio._env.get_gdal_config()¶ Get the value of a GDAL configuration option. When requesting
GDAL_CACHEMAXthe value is returned unaltered.- Parameters
key (str) – Name of config option.
normalize (bool, optional) – Convert values of
"ON"'and"OFF"toTrueandFalse.
-
rasterio._env.set_gdal_config()¶ Set a GDAL configuration option’s value.
- Parameters
key (str) – Name of config option.
normalize (bool, optional) – Convert
Trueto “ON” andFalseto “OFF”`.
-
rasterio._env.set_proj_data_search_path()¶ Set PROJ data search path