Run QGIS algorithms. See the QGIS docs for a detailed description of the algorithms provided 'out of the box' on QGIS (versions >= 3.14).
qgis_run_algorithm(
algorithm,
...,
PROJECT_PATH = NULL,
ELLIPSOID = NULL,
.raw_json_input = NULL,
.quiet = FALSE
)
A qualified algorithm name (e.g., "native:filedownloader") or a path to a QGIS model file.
Named key-value pairs as arguments for each algorithm. Features of
rlang::list2()
are supported. These arguments
are converted to strings using as_qgis_argument()
.
Global values for QGIS project file and ellipsoid name for distance calculations.
The raw JSON to use as input in place of ...
.
Use TRUE
to suppress output from processing algorithms.
if (has_qgis()) {
qgis_run_algorithm(
"native:buffer",
INPUT = system.file("longlake/longlake_depth.gpkg", package = "qgisprocess"),
DISTANCE = 10
)
}
#> Argument `SEGMENTS` is unspecified (using QGIS default value).
#> Using `END_CAP_STYLE = "Round"`
#> Using `JOIN_STYLE = "Round"`
#> Argument `MITER_LIMIT` is unspecified (using QGIS default value).
#> Argument `DISSOLVE` is unspecified (using QGIS default value).
#> Using `OUTPUT = qgis_tmp_vector()`
#> JSON input ----
#> {
#> "inputs": {
#> "INPUT": "/home/runner/work/_temp/Library/qgisprocess/longlake/longlake_depth.gpkg",
#> "DISTANCE": 10,
#> "END_CAP_STYLE": 0,
#> "JOIN_STYLE": 0,
#> "OUTPUT": "/tmp/Rtmpu8dTGN/file2ee4600fbff9/file2ee4308b6b81.gpkg"
#> }
#> }
#>
#> Running qgis_process --json run 'native:buffer' -
#>
#> <Result of `qgis_run_algorithm("native:buffer", ...)`>
#> List of 1
#> $ OUTPUT: 'qgis_outputVector' chr "/tmp/Rtmpu8dTGN/file2ee4600fbff9/file2ee4308b6b81.gpkg"