qgis_extract_output {qgisprocess} | R Documentation |
Access processing output
Description
These functions extract one output element from the result of
qgis_run_algorithm()
, potentially more than one in the case of
qgis_extract_output_by_class()
.
An output element can be extracted based on its name, its position in the
printed qgis_result
object returned by qgis_run_algorithm()
, or its
class.
qgis_extract_output()
is an alias to qgis_extract_output_by_name()
.
Usage
qgis_extract_output_by_name(x, name = "OUTPUT", first = TRUE)
qgis_extract_output(x, name = "OUTPUT", first = TRUE)
qgis_extract_output_by_position(x, which)
qgis_extract_output_by_class(x, class, single = TRUE)
Arguments
x |
A |
name |
The name of an output. |
first |
Logical.
Should |
which |
The index of an output. |
class |
Character vector of classes.
At least one class must be inherited by an element of |
single |
Logical.
Ensures the selection of a single output in |
Value
A qgis_output*
object.
See Also
Other topics about accessing or managing processing results:
qgis_as_raster()
,
qgis_as_terra()
,
qgis_clean_result()
,
qgis_result_status()
,
st_as_sf
,
st_as_stars
Examples
result <- qgis_run_algorithm(
"native:buffer",
INPUT = system.file("longlake/longlake_depth.gpkg", package = "qgisprocess"),
DISTANCE = 10
)
# the print() method of a qgis_result only prints its output elements:
result
# nevertheless, more elements are included:
length(result)
names(result)
# extract the output element 'OUTPUT':
qgis_extract_output(result)