-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathqgis_extract_output.Rd
82 lines (70 loc) · 2.78 KB
/
qgis_extract_output.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qgis-result.R
\name{qgis_extract_output}
\alias{qgis_extract_output}
\alias{qgis_extract_output_by_name}
\alias{qgis_extract_output_by_position}
\alias{qgis_extract_output_by_class}
\title{Access processing output}
\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{
\item{x}{A \code{qgis_result} object returned by \code{\link[=qgis_run_algorithm]{qgis_run_algorithm()}}.}
\item{name}{The name of an output.}
\item{first}{Logical.
Should \code{qgis_extract_output_by_name()} fall back to the first
output element if the default \code{OUTPUT} or \code{output} element is not available?
Only takes effect if \code{name} is equal to \code{OUTPUT} or \code{output}, but not found.}
\item{which}{The index of an output.}
\item{class}{Character vector of classes.
At least one class must be inherited by an element of \code{x} for that element
to be selected.}
\item{single}{Logical.
Ensures the selection of a single output in \code{qgis_extract_output_by_class()}.
The \code{OUTPUT} or \code{output} element is taken if available and on condition that
it inherits a specified class; otherwise falls back
to the first element that inherits a specified class.}
}
\value{
A \verb{qgis_output*} object.
}
\description{
These functions extract one output element from the result of
\code{\link[=qgis_run_algorithm]{qgis_run_algorithm()}}, potentially more than one in the case of
\code{qgis_extract_output_by_class()}.
An output element can be extracted based on its name, its position in the
printed \code{qgis_result} object returned by \code{\link[=qgis_run_algorithm]{qgis_run_algorithm()}}, or its
class.
\code{qgis_extract_output()} is an alias to \code{qgis_extract_output_by_name()}.
}
\examples{
\dontshow{if (has_qgis()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
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)
\dontshow{\}) # examplesIf}
}
\seealso{
Other topics about accessing or managing processing results:
\code{\link{qgis_as_raster}()},
\code{\link{qgis_as_terra}()},
\code{\link{qgis_clean_result}()},
\code{\link{qgis_result_status}()},
\code{\link{st_as_sf}},
\code{\link{st_as_stars}}
}
\concept{main functions to access or manage processing results}
\concept{topics about accessing or managing processing results}