get_args_man: Get GIS arguments and respective default values

Description Usage Arguments Details Value Note Author(s) Examples

Description

get_args_man retrieves automatically function arguments and respective default values for a given QGIS geoalgorithm.

Usage

1
get_args_man(alg = "", options = TRUE, qgis_env = set_env())

Arguments

alg

The name of the algorithm for which one wishes to retrieve arguments and default values.

options

Sometimes one can choose between various options for a function argument. Setting option to TRUE, the default, will automatically assume one wishes to use the first option (QGIS GUI behavior).

qgis_env

Environment containing all the paths to run the QGIS API. For more information, refer to set_env().

Details

get_args_man basically mimics the behavior of the QGIS GUI. That means, for a given GIS algorithm, it captures automatically all arguments and default values. In the case that a function argument has several options, one can indicate to use the first option (see also get_options()), which is the QGIS GUI default behavior.

Value

The function returns a list whose names correspond to the function arguments one needs to specify. The list elements correspond to the argument specifications. The specified function arguments can serve as input for run_qgis()'s params argument. Please note that although get_args_man tries to retrieve default values, one still needs to specify some function arguments manually such as the input and the output layer.

Note

Please note that some default values can only be set after the user's input. For instance, the GRASS region extent will be determined automatically by run_qgis() if left blank.

Author(s)

Jannes Muenchow, Victor Olaya, QGIS core team

Examples

1
2
3
4
5
6
## Not run: 
get_args_man(alg = "qgis:addfieldtoattributestable")
# and using the option argument
get_args_man(alg = "qgis:addfieldtoattributestable", options = TRUE)

## End(Not run)

RQGIS documentation built on May 2, 2019, 8:23 a.m.