Establishes the link to SAGA GIS by generating a SAGA help file and parsing all libraries, tools and options from the help files into a nested list of library, module and options, that are contained within an saga environment object object. Intended to be used internally by saga_gis

saga_env(
  saga_bin = NULL,
  opt_lib = NULL,
  raster_backend = "terra",
  vector_backend = "sf"
)

Arguments

saga_bin

An optional character vector to specify the path to the saga_cmd executable. Otherwise the function will perform a search for saga_cmd.

opt_lib

A character vector of a subset of SAGA-GIS tool libraries to generate dynamic functions that map to each tool. Used to save time if you only want to import a single library.

raster_backend

A character vector to specify the library to use for handling raster data. Currently, either "terra" or "stars" is supported. The default is "terra".

vector_backend

A character to specify the library to use for handling vector data. Currently, either "sf", "SpatVector" or "SpatVectorProxy" is supported. The default is "sf".

Value

A saga environment S3 object containing paths, settings and a nested list of libraries tools and options.