@@ -161,6 +161,7 @@ most_common_class_of_list <- function(l, class_to_find = "sf") {
161161# '
162162# ' @inheritParams route
163163# ' @param net sf object representing the route network
164+ # ' @param wt_profile string corresponding to dodgr function weight_streetnet() parameter wt_profile
164165# ' @family routes
165166# ' @export
166167# ' @examples
@@ -172,14 +173,16 @@ most_common_class_of_list <- function(l, class_to_find = "sf") {
172173# ' # colnames(pts) <- c("X", "Y")
173174# ' # net <- dodgr::dodgr_streetnet(pts = pts, expand = 0.1)
174175# ' # osm_net_example <- net[c("highway", "name", "lanes", "maxspeed")]
175- # ' r <- route_dodgr(from, to, net = osm_net_example)
176+ # ' r <- route_dodgr(from, to, net = osm_net_example, wt_profile = "bicycle" )
176177# ' plot(osm_net_example$geometry)
177178# ' plot(r$geometry, add = TRUE, col = "red", lwd = 5)
178179# ' }
179180route_dodgr <- function (from = NULL ,
180181 to = NULL ,
181182 l = NULL ,
182- net = NULL
183+ net = NULL ,
184+ wt_profile = " bicycle"
185+ # mimic the default behaviour of weight_streetnet
183186 # ,
184187 # return_net = FALSE
185188) {
@@ -198,7 +201,7 @@ route_dodgr <- function(from = NULL,
198201
199202 ckh <- dodgr :: dodgr_cache_off()
200203 suppressMessages(
201- ways_dg <- dodgr :: weight_streetnet(net )
204+ ways_dg <- dodgr :: weight_streetnet(net , wt_profile = wt_profile )
202205 )
203206
204207 verts <- dodgr :: dodgr_vertices(ways_dg ) # the vertices or points for routing
0 commit comments