PROJ configuration

libproj_version()

libproj_has_libtiff()

libproj_has_libcurl()

libproj_default_writable_dir()

libproj_default_data_dir()

with_libproj_configuration(config, expr)

libproj_configuration()

warn_for_configuration()

libproj_configure(
  search_path = c(system.file("proj", package = "libproj"),
    getOption("libproj.search_path", libproj_default_data_dir())),
  db_path = getOption("libproj.db_path", system.file("proj/proj.db", package =
    "libproj")),
  ca_bundle_path = NA,
  network_endpoint = getOption("libproj.network_endpoint", "https://cdn.proj.org"),
  network_enabled = getOption("libproj.network_enabled", FALSE),
  log_level = getOption("libproj.log_level", 1L),
  restore_previous_on_error = TRUE
)

Arguments

config

A named list() with elements used to temporarily override elements of the current libproj_configuration().

expr

An expression to evaluate with the specified state

search_path

A character vector of paths where libproj will look for resource files (e.g., gridshift, database, init files). Defaults to the internal database and init files distributed with the PROJ source.

db_path

Independent of search_path, a character vector of SQLite databases that may contain updated or alternative coordinate operations from the default proj.db included in this package. You must specify at least one database as part of this configuration; do not rely on search_path to find this value for you.

ca_bundle_path

A directory that contains the certificate bundle when network is enabled. Can be NA.

network_endpoint

A mirror of the PROJ CDN of gridshift files. By default, this is set to https://cdn.proj.org.

network_enabled

Whether or not to download gridshift files on the fly. This defaults to FALSE.

log_level

An integer describing the log level: 0 (none), 1 (error), 2 (debug), 3 (trace), or 4 (tell)

restore_previous_on_error

Use FALSE to skip resetting the previous configuration if the configuration fails.

Value

  • libproj_version(): A character vector of the proj release.

  • libproj_has_libtiff(): TRUE if built against libtiff, FALSE otherwise.

  • libproj_has_libcurl(): TRUE if built against curl, FALSE otherwise.

  • libproj_default_writable_dir(): A character vector of the path where libproj-specific tempfiles are written.

  • libproj_default_data_dir(): A character vector of the path where the default PROJ-data installation is kept.

  • libproj_configuration(): A list() of values that can be passed to libproj_configure().

  • with_libproj_configuration(): The value of expr.

  • libproj_configure(): NULL, invisibly.

Examples

libproj_version()
#> [1] "8.1.0"
libproj_configuration()
#> $db_path #> [1] "/Users/runner/work/_temp/Library/libproj/proj/proj.db" #> #> $search_path #> [1] "/Users/runner/work/_temp/Library/libproj/proj" #> [2] "/Users/runner/Library/Application Support/R-libproj/data" #> #> $network_endpoint #> [1] "https://cdn.proj.org" #> #> $log_level #> [1] 1 #> #> $ca_bundle_path #> [1] NA #> #> $network_enabled #> [1] FALSE #>