-
Notifications
You must be signed in to change notification settings - Fork 0
/
ors_export.Rd
75 lines (62 loc) · 2.08 KB
/
ors_export.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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/export.R
\name{ors_export}
\alias{ors_export}
\title{Export graphs}
\usage{
ors_export(
bbox,
profile = get_profiles(),
network = TRUE,
instance = NULL,
...
)
}
\arguments{
\item{bbox}{\code{[various]}
An object created by \code{\link[sf]{st_bbox}} or any object that can be
coerced to a bbox object. Only graphs within these boundaries will be
exported.}
\item{profile}{\code{[character]}
Means of transport as supported by OpenRouteService.
Defaults to the first profile in a call to \code{\link{get_profiles}}.
For \code{ors_shortest_distances}, \code{profile} can be a character
vector, for all other functions it needs to be a character scalar.
For details on all profiles, refer to the
\href{https://giscience.github.io/openrouteservice/technical-details/tag-filtering}{backend reference}.}
\item{network}{\code{[logical]}
Whether to convert the output to an \code{\link[sfnetworks]{sfnetwork}}.}
\item{instance}{\code{[ors_instance]}
Object of an OpenRouteService instance that should be used for route
computations. It is recommended to use \code{\link{ors_instance}}
to set an instance globally. This argument should only be used if activating
an instance globally is not feasible.}
\item{...}{Additional arguments passed to the export API.}
}
\value{
If \code{sfnetworks} is installed, returns an
\code{\link[sfnetworks]{sfnetwork}}. Otherwise, returns a list with
fields \code{nodes} and \code{edges}. The nodes network contains a column
\code{weight} that represents the fastest routing duration with the
specified profile.
}
\description{
Retrieve the base graphs for different modes of transport. Includes all
nodes and edges that are used for routing.
}
\examples{
\dontrun{
library(sfnetworks)
library(ggplot2)
data("pharma")
# export graphs as sfnetwork
exp1 <- ors_export(pharma, network = TRUE)
plot(exp1)
# export graphs as list
exp2 <- ors_export(pharma, network = FALSE)
ggplot(exp2$edges) +
geom_sf(aes(lwd = weight))
ggplot() +
geom_sf(data = exp2$nodes, size = 1) +
geom_sf(data = exp2$edges)}
}