rsaga.geoprocessor(lib, module = NULL, param = list(), show.output.on.console = TRUE, invisible = TRUE, intern = TRUE, prefix = NULL, flags = ifelse(show.output.on.console, "q", "s"), cores, env = rsaga.env(), display.command = FALSE, reduce.intern = TRUE, check.module.exists = TRUE, warn = options("warn")$warn, argsep = " ", ...)
>=0
) or name of the module to called within the library lib
(see Details).TRUE
), indicates whether to capture the output of the command and show it on the R console (see system
)."-h"
used in the saga_cmd
call; mostly for internal purposes; call saga_cmd -h
from the command line for details; see also flags
"q"
: no progress report (the default for show.output.on.console=TRUE
); "r"
: no messages report; "s"
: silent mode, i.e. no progress and no messages report (the default for show.output.on.console=FALSE
); other flag options probably not relevant within RSAGANA
: number of cores used by SAGA GIS; supported only by SAGA GIS 2.1.0 (and higher), ignored otherwise (with a warning); overwrites the cores
setting specified in the env
argument (see rsaga.env
). Multicore-enabled SAGA GIS modules such as the one used by rsaga.pisr
seem to run in multicore mode by default when this argument is not specified, therefore cores
should only be specified to use a smaller number of cores than available on a machine.rsaga.env
.)FALSE
.intern=TRUE
, reduce the text output of SAGA returned to R by eliminating redundant lines showing the progress of module execution etc. (default: TRUE
).TRUE
): call rsaga.module.exists
to determine if the specified module can be called in the current SAGA installationTRUE
): for internal purposes - can be used to suppress warning messages generated by failed SAGA_CMD calls; currently used by rsaga.get.lib.modules
and related functions; see options
argument warn
for details" "
; currently for internal use): defines the character symbol used as a separator between each argument name and argument value passed to saga_cmd
. SAGA GIS 2.1.0 (RC1) seems to move toward "="
as a separator, but " "
still works and some modules (e.g. the used by rsaga.pisr
) don't seem to work with argsep="="
. Future releases of RSAGA may change the default argsep
value and/or delete or ignore this argument and/or move it to rsaga.env
.system
.intern
argument passed to system
.If intern=FALSE
, a numerical error/success code is returned, where a value of 0
corresponds to success and a non-zero value indicates an error. Note however that the function always returns a success value of 0
if wait=FALSE
, i.e. if it does not wait for SAGA to finish.If intern=TRUE
(default), the console output of SAGA is returned as a character vector. This character vector lists the input file names and modules arguments, and gives a more or less detailed report of the function's progress. Redundant information can be cancelled out by setting reduce.intern=TRUE
.
rsaga.hillshade
are intended to be more user-friendly interfaces to the most frequently used SAGA modules. These higher-level interfaces support default values for the arguments and perform some error checking; they should therefore be preferred if available.A warning is issued if the RSAGA version is not one of 2.0.4-2.0.8 or 2.1.0-2.1.4
rsaga.env
, rsaga.get.libraries
, rsaga.get.modules
, rsaga.search.modules
, rsaga.get.usage
; rsaga.esri.wrapper
for a wrapper for ESRI ASCII/binary grids; rsaga.hillshade
and other higher-level functions.
## Not run:
# rsaga.hillshade("dem","hillshade",exaggeration=2)
# # using the RSAGA geoprocessor:
# rsaga.geoprocessor("ta_lighting",0,list(ELEVATION="dem.sgrd",SHADE="hillshade",EXAGGERATION=2))
# # equivalent DOS command line call:
# # saga_cmd.exe ta_lighting 0 -ELEVATION dem.sgrd -SHADE hillshade -EXAGGERATION 2
# ## End(Not run)
Run the code above in your browser using DataLab