-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathroute_dodgr.Rd
41 lines (38 loc) · 1.21 KB
/
route_dodgr.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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/route.R
\name{route_dodgr}
\alias{route_dodgr}
\title{Route on local data using the dodgr package}
\usage{
route_dodgr(from = NULL, to = NULL, l = NULL, net = NULL)
}
\arguments{
\item{from}{An object representing origins
(if lines are provided as the first argument, from is assigned to \code{l})}
\item{to}{An object representing destinations}
\item{l}{A spatial (linestring) object}
\item{net}{sf object representing the route network}
}
\description{
Route on local data using the dodgr package
}
\examples{
if (requireNamespace("dodgr")) {
from <- c(-1.5327, 53.8006) # from <- geo_code("pedallers arms leeds")
to <- c(-1.5279, 53.8044) # to <- geo_code("gzing")
# next 4 lines were used to generate `stplanr::osm_net_example`
# pts <- rbind(from, to)
# colnames(pts) <- c("X", "Y")
# net <- dodgr::dodgr_streetnet(pts = pts, expand = 0.1)
# osm_net_example <- net[c("highway", "name", "lanes", "maxspeed")]
r <- route_dodgr(from, to, net = osm_net_example)
plot(osm_net_example$geometry)
plot(r$geometry, add = TRUE, col = "red", lwd = 5)
}
}
\seealso{
Other routes:
\code{\link{route}()},
\code{\link{route_osrm}()}
}
\concept{routes}