Learn R Programming

RQGIS (version 0.1.0)

get_args_man: Get GIS arguments and respective default values

Description

get_args_man retrieves automatically function arguments and respective default values for a given GIS algorithm.

Usage

get_args_man(alg = NULL, options = FALSE, qgis_env = set_env())

Arguments

alg
The name of the algorithm for which you wish to retrieve arguments and default values.
options
Sometimes you can choose between various options for a function argument. Setting option to TRUE will automatically assume you wish to use the first option (default: FALSE).
qgis_env
Environment containing all the paths to run the QGIS API. For more information, refer to set_env.

Value

The function returns a list whose names correspond to the function arguments you need 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, you still need to specify some function arguments by your own such as input and output layers.

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. Additionally, you can indicate that you want to use the first option if a function argument has several options (see also get_options), which is the QGIS GUI default behavior.

Examples

Run this code
## Not run: 
# get_args_man(alg = "qgis:addfieldtoattributestable")
# # and using the option argument
# get_args_man(alg = "qgis:addfieldtoattributestable", options = TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab