Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions R/route.R
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ most_common_class_of_list <- function(l, class_to_find = "sf") {
#'
#' @inheritParams route
#' @param net sf object representing the route network
#' @param wt_profile string corresponding to dodgr function weight_streetnet() parameter wt_profile
#' @family routes
#' @export
#' @examples
Expand All @@ -172,14 +173,16 @@ most_common_class_of_list <- function(l, class_to_find = "sf") {
#' # 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)
#' r <- route_dodgr(from, to, net = osm_net_example, wt_profile = "bicycle")
#' plot(osm_net_example$geometry)
#' plot(r$geometry, add = TRUE, col = "red", lwd = 5)
#' }
route_dodgr <- function(from = NULL,
to = NULL,
l = NULL,
net = NULL
net = NULL,
wt_profile = "bicycle"
# mimic the default behaviour of weight_streetnet
# ,
# return_net = FALSE
) {
Expand All @@ -198,7 +201,7 @@ route_dodgr <- function(from = NULL,

ckh <- dodgr::dodgr_cache_off()
suppressMessages(
ways_dg <- dodgr::weight_streetnet(net)
ways_dg <- dodgr::weight_streetnet(net, wt_profile = wt_profile)
)

verts <- dodgr::dodgr_vertices(ways_dg) # the vertices or points for routing
Expand Down
2 changes: 1 addition & 1 deletion man/rnet_group.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions man/route_dodgr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading