Skip to content

route_dodger route_fun doesn't accept other dodgr parameters #572

@meptrsn

Description

@meptrsn

Is there a way to pass dodgr arguments (wt_profile, turn_penalty) through route() to set the routing settings? Currently, I'm routing an OD table over two similar networks, with small changes to street directionality. However, the outputs are all basically the same, and make it seem like street directionality isn't being taken into account as it should. Basically, I'd like to make sure it uses wt_profile = motorcar in order to ensure that directionality is respected in the routing process.

Here's a minimum reproducible example showing the similar outcomes, with the related shapefiles so you can try it out. The Zip file has the script as well, so you can just run it in the extracted directory.

library(stplanr)
library(sf)
library(dplyr)



AV_roads_exist <- read_sf("AV_roads_filter_sh.shp") %>% rename(highway = type)

AV_roads_gyr <- read_sf("AV_roads_filter_gyr_sh.shp") %>% rename(highway = type)

AV_dl_wkdy_AM <- read_sf("AV_dl_wkdy_AM.shp")

AV_rt_am <- route(l = AV_dl_wkdy_AM, route_fun = route_dodgr, net = AV_roads_exist)

AV_rt_gyr_am <- route(l = AV_dl_wkdy_AM, route_fun = route_dodgr, net = AV_roads_gyr)

AV_reprex.zip

I used ggraph(as_sfnetwork(...), 'sf') + geom_edge_sf(aes(lwd = A_D_O_D)) + geom_node_sf(size = 0.3) to plot the routes, and you can see that there's basically no difference, an lot of volume on streets that shouldn't (based on the data) be getting those trips.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions