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

segment_duration is not equal to distance/walkSpeed for walk trip legs #357

Closed
luyuliu opened this issue Nov 28, 2023 · 3 comments
Closed

Comments

@luyuliu
Copy link
Contributor

luyuliu commented Nov 28, 2023

As title. I guess it's not a r5r problem but a r5's engine problem. Some extreme examples can be rather ridiculous, like this short trip.

from_1000_999.csv

I made the adjustment so that the unit of distance and segment_duration are meters and seconds.

I guess it's because shorter trips will skip some shorter link from the o/d point to the network?

Longer trips' trip legs can also deviate from the walk speed given in the setting. The last-mile leg would usually be slower than the given value, while the first-mile leg would usually be faster than the given value.

from_1094_851.csv

Notice that the short transfer leg too. The speed can also exceed the given walking speed of 1 m/s.

Is this intentional or a bug?

@rafapereirabr
Copy link
Member

@luyuliu , thanks for reporting this. I suspect these strange results occur because of where R5 is snapping origin and destination points to the network. So this would be in some ways related to Q1 in our FAQ

You can run find_snap() to determine precisely where R5 is snapping points to. This could give an idea of where the strange results are comming from.

r5r::find_snap(r5r_core, points, mode = "WALK")

@luyuliu
Copy link
Contributor Author

luyuliu commented Nov 28, 2023

Thanks. I notice the non-zero results of OD pairs with same O and D. I also guess the same for the first-mile leg, but the last-mile leg is always faster than the set speed, which I don't know why. I think snapping can only increase the total length but not decrease it?

@luyuliu luyuliu closed this as completed Dec 1, 2023
@rafapereirabr
Copy link
Member

R5 considers that the person would walk in Euclidean distance from the input point to the snapped location. This sould be the same when travelling between the destination point and its respective snapped location.

In both segments, we would expect the person would travel using the speed set by the user. If there is a simple reproducible example where the speed is different than the set speed, this could possibly be a bug upstream in R5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants