Repository navigation
Improve bike speed handling - #3214
Merged
Merged
Conversation
…al for all bike types
…hould use consistent speed for cycleway; BikeCustomModelTest is meaningless if priority is 0
This reverts commit 8f77c3f.
… certain surfaces
ratrun
approved these changes
Oct 18, 2025
ratrun
left a comment
Contributor
There was a problem hiding this comment.
Looks excellent. I only detected one further suggestion.
| GHResponse response = gh.route(req); | ||
| ResponsePath path = response.getBest(); | ||
| assertEquals(5436, path.getDistance(), 5); | ||
| assertEquals(5158, path.getDistance(), 5); |
Contributor
There was a problem hiding this comment.
Question: Did you cross check the reason for this pretty big difference?
Member
Author
There was a problem hiding this comment.
It is the result of increasing the speed of highway=pedestrian from 4 to 6km/h resulting in this IMO more realistic route:
instead of this:
(Note that the OSM data in the repo is heavily outdated and the route in reality is something completely different. Also note that this test does not use bike.json and instead a simplified bike profile for testing purposes which is without e.g. soft reverse oneway.)
karussell
commented
Oct 20, 2025
Member
Author
|
Thanks for the discussion @ratrun! |
Merged
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change makes the bike speed more consistent across the different bike types. Here a link for easier comparison as the tests were restructured a bit (i.e. the link avoids the first two commits and the master commits).
Furthermore it tries to make the decision when to pick which speed more consistent. And the theory is that there are 4 cases bicycles=yes/no & surface=good/bad using different default assumptions:
trackwe assume by default a) bicycles allowed and b) bad surfacefootway,pedestrianandplatformwe assume by default a) bicycles not allowed and b) good surfacepathandbridlewaywe assume by default a) bicycles not allowed and b) bad surfaceAnd for cases 2. to 4. the speed can increase, because of allowed/designated bike access or a good surface.
Furthermore "bike designated" is also true if the way is part of an official bike network (taken from the relationFlags).
See previous discussion here.