Skip to contents

qgis_run() offers full access to 'qgis_process'. Run cat(qgis_run("--help")$stdout) to get the command's help.

Usage

qgis_run(args = character(), ..., env = qgis_env(), path = qgis_path())

Arguments

args

Command-line arguments

...

Passed to processx::run().

env

A list() of environment variables. Defaults to getOption("qgisprocess.env", list(QT_QPA_PLATFORM = "offscreen")).

path

A path to the 'qgis_process' executable. Defaults to qgis_path().

Value

A processx::run() return value, i.e. a list with status, stdout, stderr and timeout elements.

See also

Other topics about programming or debugging utilities: qgis_result_status(), qgis_tmp_file(), qgis_unconfigure(), qgis_using_json_input()

Other topics about configuring QGIS and qgisprocess: qgis_configure(), qgis_enable_plugins()

Examples

processx_list <- qgis_run(args = "--help")
cat(processx_list$stdout)
#> QGIS Processing Executor - 3.38.3-Grenoble 'Grenoble' (3.38.3-Grenoble)
#> Usage: /usr/bin/qgis_process.bin [--help] [--version] [--json] [--verbose] [--no-python] [--skip-loading-plugins] [command] [algorithm id, path to model file, or path to Python script] [parameters]
#> 
#> Options:
#> 	--help or -h		Output the help
#> 	--version or -v		Output all versions related to QGIS Process
#> 	--json			Output results as JSON objects
#> 	--verbose		Output verbose logs
#> 	--no-python		Disable Python support (results in faster startup)
#> 	--skip-loading-plugins	Avoid loading enabled plugins (results in faster startup)
#> Available commands:
#> 	plugins		list available and active plugins
#> 	plugins enable	enables an installed plugin. The plugin name must be specified, e.g. "plugins enable cartography_tools"
#> 	plugins disable	disables an installed plugin. The plugin name must be specified, e.g. "plugins disable cartography_tools"
#> 	list		list all available processing algorithms
#> 	help		show help for an algorithm. The algorithm id or a path to a model file must be specified.
#> 	run		runs an algorithm. The algorithm id or a path to a model file and parameter values must be specified. Parameter values are specified after -- with PARAMETER=VALUE syntax. Ordered list values for a parameter can be created by specifying the parameter multiple times, e.g. --LAYERS=layer1.shp --LAYERS=layer2.shp
#> 			Alternatively, a '-' character in place of the parameters argument indicates that the parameters should be read from STDIN as a JSON object. The JSON should be structured as a map containing at least the "inputs" key specifying a map of input parameter values. This implies the --json option for output as a JSON object.
#> 			If required, the ellipsoid to use for distance and area calculations can be specified via the "--ELLIPSOID=name" argument.
#> 			If required, an existing QGIS project to use during the algorithm execution can be specified via the "--PROJECT_PATH=path" argument.
#> 			When passing parameters as a JSON object from STDIN, these extra arguments can be provided as an "ellipsoid" and a "project_path" key respectively.