Run an algorithm using 'qgis_process': pipe-friendly wrapper
Source:R/qgis-function.R
qgis_run_algorithm_p.Rdqgis_run_algorithm_p() wraps qgis_run_algorithm(), passing
its first argument to the first argument of the QGIS algorithm.
This makes it more convenient in a pipeline (hence '_p' in the name).
Usage
qgis_run_algorithm_p(
.data,
algorithm,
...,
.select = "OUTPUT",
.clean = TRUE,
.quiet = TRUE
)Arguments
- .data
Passed to the first input of
algorithm. If.datais aqgis_result(the result of a previous processing step),.data[[.select]]is passed instead.- algorithm
A qualified algorithm name (e.g.,
"native:buffer").- ...
Other algorithm arguments. These values are evaluated once and immediately, so you shouldn't call
qgis_tmp_file()here.- .select
String. The name of the element to select from
.dataif the latter is aqgis_result. Defaults to"OUTPUT".- .clean
Logical. Should an incoming
qgis_resultbe cleaned (usingqgis_clean_result()) after processing?- .quiet
Use
FALSEto get extra output from 'qgis_process'. This can be useful in debugging.
Details
Uses qgis_function() under the hood.
See also
Other functions to run one geoprocessing algorithm:
qgis_run_algorithm()
Examples
system.file(
"longlake/longlake_depth.gpkg",
package = "qgisprocess"
) |>
qgis_run_algorithm_p(
"native:buffer",
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).
#> Argument `SEPARATE_DISJOINT` is unspecified (using QGIS default value).
#> Using `OUTPUT = qgis_tmp_vector()`
#> <Result of `qgis_run_algorithm("native:buffer", ...)`>
#> List of 1
#> $ OUTPUT: 'qgis_outputVector' chr "/tmp/RtmpYRKnrl/file2bd74c64ebaa/file2bd777730312.gpkg"