Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancies between max_walk_dist and max_bike_dist and actual distances travelled during routing #273

Closed
mvpsaraiva opened this issue Jun 8, 2022 · 2 comments
Assignees
Labels
v1.0 Features to be included in r5r 1.0

Comments

@mvpsaraiva
Copy link
Collaborator

The max_walk_dist and max_bike_dist parameters define the max travelling distance to access transit stops or for direct trips in all routing functions. r5r converts those parameters to max walk and bike times under the hood, according to walking and cycling speeds provided.

The issue here is that the conversion is not as straightforward as it used to be, now that R5 takes the city's topography into account. Thus, a trip that is well within max_walk_dist is not retrieved because its adjusted walking time (due to topography) is longer than the pre-calculated walking time considering flat terrain.

Reproducible example:

library("r5r")

# build transport network
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path, elevation = "TOBLER", overwrite = T)

# load origin/destination points
points <- read.csv(file.path(data_path, "poa_points_of_interest.csv"))

# inputs
departure_datetime <- as.POSIXct("13-05-2019 14:00:00",
                                 format = "%d-%m-%Y %H:%M:%S")

# a <- capture.output(
  dit <- detailed_itineraries(r5r_core,
                              origins = points[1,],
                              destinations = points[3,],
                              mode = c("WALK", "TRANSIT"),
                              departure_datetime = departure_datetime,
                              max_walk_dist = 1800,
                              max_trip_duration = 30,
                              shortest_path = F)

In the example above, the first trip is 1583 meters long, but it's only retrieved when max_walk_dist is above 1800. If elevation = "NONE" in setup_r5(), max_walk_dist works as expected.

The only solution for this problem that I can think of is to change the parameters to max_walk_time and max_bike_time, because that's how R5 works natively.

@dhersz dhersz added the v1.0 Features to be included in r5r 1.0 label Jun 8, 2022
@rafapereirabr
Copy link
Member

I agree. It would make sense to replace the max_*_dist parameters with max_*_time.

@rafapereirabr
Copy link
Member

rafapereirabr commented Jun 15, 2022

closed with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.0 Features to be included in r5r 1.0
Projects
None yet
Development

No branches or pull requests

3 participants