You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GDAL reads the config file once, at driver registration - i.e. before this package can act. The file is therefore a discovery/provenance input in-process, but it is also the only lossless out-of-process serialization of a full gdal_config value: path-bound VSI credentials cannot be expressed as CLI --config flags at all (only [credentials] or in-process VSISetPathSpecificOption() carry them).
Reading a gdalrc should yield the package's value classes directly, so a file round-trips into the same machinery as everything else.
Grammar (GDAL >= 3.3 / 3.5 / 3.6)
[directives]ignore-env-vars=yes # GDAL >= 3.6: env vars ignored in favor of [configoptions][configoptions]GDAL_NUM_THREADS=ALL_CPUS # loaded into the in-memory store at GDAL init[credentials]# GDAL >= 3.5: path-bound VSI options[.private_bucket]# relative subsection, first key must be `path`path=/vsis3/my_private_bucket
AWS_SECRET_ACCESS_KEY=...
AWS_ACCESS_KEY_ID=...
API
gdal_config_file_read(path) -> classed gdal_config_file: configoptions as a gdal_config_opts, directives as a named vector, credentials as a list of gdal_vsi_optswith their vsi_path bound (from the subsection path key).
as_gdal_config.gdal_config_file() -> a gdal_config value (configoptions + credentials), closing the loop: read a gdalrc, apply it in-process via gdal_config_set().
gdal_config_file_write(x, path) -> the inverse; the faithful serialization target for a full gdal_config (config channel -> [configoptions], path-bound VSI channel -> [credentials] subsections). Secrets are written as-is by design (it is a credentials file); printing remains redacted.
Parser implementation: tidy line-classification (tibble + stringr + tidyr::fill for section/subsection context) rather than an imperative accumulator loop; gdalrc-specific rather than generic ini (the [.subsection] + path binding rules are format-specific).
Related
#8 (parent design), #12 (sitrep provenance), #14 (Phase 2: --optfile writer is the sibling serialization for algorithm arguments)
GDAL Configuration File (gdalrc) I/O
Formal, exported I/O for the GDAL configuration file format, as part of the configuration system (#8).
Why
gdal_configvalue: path-bound VSI credentials cannot be expressed as CLI--configflags at all (only[credentials]or in-processVSISetPathSpecificOption()carry them).Grammar (GDAL >= 3.3 / 3.5 / 3.6)
API
gdal_config_file_read(path)-> classedgdal_config_file:configoptionsas agdal_config_opts,directivesas a named vector,credentialsas a list ofgdal_vsi_optswith theirvsi_pathbound (from the subsectionpathkey).as_gdal_config.gdal_config_file()-> agdal_configvalue (configoptions + credentials), closing the loop: read a gdalrc, apply it in-process viagdal_config_set().gdal_config_file_write(x, path)-> the inverse; the faithful serialization target for a fullgdal_config(config channel ->[configoptions], path-bound VSI channel ->[credentials]subsections). Secrets are written as-is by design (it is a credentials file); printing remains redacted.gdal_config_file()(discovery, exists) returns the parsed object for the file GDAL actually loaded (GDAL_CONFIG_FILEenvvar, then~/.gdal/gdalrc), cached at package load for sitrep provenance ([Feature]: gdal_config_sitrep() - Configuration Situational Report #12).Parser implementation: tidy line-classification (tibble + stringr + tidyr::fill for section/subsection context) rather than an imperative accumulator loop; gdalrc-specific rather than generic ini (the
[.subsection]+pathbinding rules are format-specific).Related
#8 (parent design), #12 (sitrep provenance), #14 (Phase 2:
--optfilewriter is the sibling serialization for algorithm arguments)