-
Notifications
You must be signed in to change notification settings - Fork 449
feat: improvements to road bike routing #2076
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
base: main
Are you sure you want to change the base?
Conversation
c803c1e
to
f7f7afe
Compare
f7f7afe
to
0ed8e24
Compare
The remaining task is to properly implement cycleway and footway avoidance via adjusted way priority values rather than decreased average speed values. This could be achieved by keeping most of the changes proposed in the original PR, but accompany them with corresponding changes to the priority values. Such approach should hopefully address the routing issues mentioned in the examples from the original PR's comments while keeping the overall road-bike routing experience. |
0ed8e24
to
3edec3c
Compare
Original examples by @marq24 where the road bike profile (left hand-side in the screens below) is expected to return a different route than the regular bike profile (right hand-side). |
Example on the Heidelberg test graph where the road bike profile is expected to return the same route as the car profile. ![]() |
In Germany, I would expect the routes in the RHS images illegal because cycling on the left side of a street is generally not permitted unless explicitly allowed through street signs. |
Thanks @sfendrich, interesting point! The cycleway and path from the examples are not tagged as ![]() ![]() |
593fb42
to
de85392
Compare
Dear @marq24, Long time no see! 😅 I hope things are good at your end 🤞 I'm reaching out regarding this PR which is based on PR #778 from a few years ago by @steventebrinke who tried to improve road bike routing by addressing inconsistent speed assignments where e.g. paved footways had higher speeds than cycleways. I've tried to take over most of his suggested changes while accommodating your comments from the original discussion. In particular, routing on ways shared with pedestrians such as paths or cycleways along sidewalks is now discouraged via a lower priority rather than decreased speed. Such approach will hopefully improve travel time estimates (based on avg. speed) while keeping the overall road bike experience such as cycleway avoidance. You are most welcome to give it a try! 🚀 I'm looking very much for your feedback 🙏 Cheers, |
@aoles - Thanks for waking me up :-D... Of course I am very interested to support the project! - So even if this all is a long time ago - I hope I can provide valuable feedback... And Indeed "key" problem was (or might be is), that official cycle path routes will not be "optimal" for roadbikes - specially in roundabout situations (in inner cities)... That's why cyclepath-path's got quite speed "penalty" ... to keep the routing on the street - and ONLY allow cyclepath if there is "no real" alternative "car-wise"... |
Thanks a lot @marq24 for getting back to me! ❤️ Do you think you could test a few critical routes / edge cases you know about to check whether the results produced with the code from this PR meet your requirements? Cheers! 🚀 |
YES of course - the 'only' thing the grumpy old me needs is either access to a instance (preferred) where the current feature is rolled out (so I can adjust my local client app to use this "dev-backend") - or - and that probably take quite some time - you have to guide me through the current dev install & data import process, so that I am able to run my own backend again... that I did something like that is indeed quite a long time ago... |
Dear @marq24, I very much appreciate your help! 🙏 There have been quite some changes to the setup of openrouteservice over the past few years. It should be now relatively easy and painless for you to run it locally by following these 3 simple steps: 1. Get the codegit clone https://github.com/GIScience/openrouteservice.git
cd openrouteservice
git checkout feat/road_bike_speeds 2. Get the datawget https://download.geofabrik.de/europe/germany/nordrhein-westfalen-latest.osm.pbf 3. Run ORSexport ORS_ENGINE_PROFILE_DEFAULT_BUILD_SOURCE_FILE=nordrhein-westfalen-latest.osm.pbf
export ORS_ENGINE_PROFILES_DRIVING_CAR_ENABLED=false
export ORS_ENGINE_PROFILES_CYCLING_ROAD_ENABLED=true
export ORS_ENGINE_PROFILES_CYCLING_ROAD_BUILD_PREPARATION_METHODS_LM_ENABLED=false
./mvnw spring-boot:run Depending on your machine the instance should be up and running within 2-3 minutes. You can verify that by navigating to http://localhost:8082/ors/v2/health. To easily query for routes you can hook up your local ORS instance against the online maps client. To do so, go to settings (1) expand the "hidden" advanced section (2) and select ![]() |
just as little update - currently the graphs being build - I am doing this for germany-latest (and decided to include the car's - so that I can compare some stuff) - my hardware running in the basement (where the process is executed should be able to handle all that stuff) - not sure if you aware, that I am running my own vector map tile server (on planet pbf base) [https://maps.emac.de (might be currently a bit slow - since "another" process is running :-D]... I hope I can convince my hosted 'https://route.emacberry.com/' to use my local server - at least the developer options are present - and as long as there is no CORS issue I might have everything ready (once all this generated) |
Thanks a lot for the update! 🚀 If you plan on requesting only local routes (say up to 50 km) you might want to disable the preparations for the speed-up algorithms for car as well in order to get faster graph builds. export ORS_ENGINE_PROFILES_DRIVING_CAR_BUILD_PREPARATION_METHODS_CH_ENABLED=false
export ORS_ENGINE_PROFILES_DRIVING_CAR_BUILD_PREPARATION_METHODS_CORE_ENABLED=false |
building the graphs was/is not an issue - since as I tried to explain - I am using the same hardware to do planet.pdf stuff for my own tiles server...
[update] - building now also the default bike, mtb and electric profiles to compare the results - also with the current live prod |
as human I would always ride how it's illustrated in my sample - #2076 (comment) - but of course the current LIVE server will create the result on the "right" and that's the one I would choose - since when I tried (when I can remember correctly) that my "human preferred" route would be returned, then this had so many other negative effects at different places, that I decided for this compromise... Since I could "fix" it (when planing my cycle routes by adding just an additional waypoint like this https://classic-maps.openrouteservice.org/directions?n1=51.704481&n2=8.623452&n3=14&a=51.688787,8.615942,51.706768,8.619633,51.72015,8.632631&b=1c&c=0&k1=en-US&k2=km So the current LIVE road bike profile is not always "perfect" - here is another example where it has a glitch (just in the opposite direction - 'here' I will stay on the main-road - yes Humans are inconsequent :-D https://classic-maps.openrouteservice.org/directions?n1=51.700973&n2=8.489792&n3=17&a=51.700006,8.487893,51.702646,8.484836&b=1c&c=0&k1=en-US&k2=km - so I cycle this route here very time https://classic-maps.openrouteservice.org/directions?n1=51.700973&n2=8.489792&n3=17&a=51.700006,8.487893,51.700611,8.485844,51.702646,8.484836&b=1c&c=0&k1=en-US&k2=km I just hope that this is not adding additional confusion - since the general guideline is, that I want to stay on paved road - avoid cycle-ways when there is also a "good" car-based alternative - and small/tiny roads are preferred for anything that is longer then 250-500m (and specially like in the last case, when I need to get on the main-road anyhow (later)) - just to illustrate it a bit more - this is my typical path I take - https://classic-maps.openrouteservice.org/directions?n1=51.700704&n2=8.531055&n3=13&a=51.695398,8.500993,51.700611,8.485844,51.747864,8.448744&b=1c&c=0&k1=en-US&k2=km |
Awesome, thanks for the clarification and providing some additional context! 👍 |
I would appreciate if the road bike flag encoder would be refactored such that common bike flag encoder does not need reflection. I am willing to do this refactoring but am busy with other stuff currently. |
…fied ways According to OSM wiki both `highway = unclassified` and `highway = road` are synonyms and can be used interchangeably as "The word 'unclassified' is a historical artefact of the UK road system and does not mean that the classification is unknown; you can use highway=road for that."
…road bike behaviour The first example with "asphalt cycleway vs asphalt roundabout" did not work as expected.
… used by vehicle profiles The original "walking speed" of 6 km/h was unrealistically low for a road bike.
3782dc9
to
f4fa4d4
Compare
|
Dear @marq24, thanks again for all your feedback so far! ❤️ I've looked into the reported differences as compared to the original (production) road bike profile and did some small adjustments in order to address these issues. The routes from the examples above should be now consistent between production and the feature branch. Please feel free to give it a try 😉 Cheers! 🚀 |
I have to admit, that I am clueless HOW I could miss this note once again - the new build is preparing graphs right now... |
Initial tests looks good - I am not sure - why is here the new route taking the L937 - while using the "Unterer Weg" would be the road-bike route I would choose (and the old routing does)? |
Thanks a lot for taking the time to set up the instance and to run some tests! 👍 The provided example is indeed very interesting: I would also expect the routing to prefer Unterer Weg over L937 considering that it is
I will definitely follow up on it 🧐 Have you found any other unexpected routes? Cheers! |
as soon as I found "more" - I will share the links here |
Awesome, I really appreciate your help! 👍 |
Pull Request Checklist
have been resolved.
[Unreleased] heading.
along with a short description of what it is for, and documented this in the Pull Request (below).
(at least Germany), and the graphs build without problems (i.e. no out-of-memory errors).
importer etc.), I have generated longer distance routes for the affected profiles with different options
(avoid features, max weight etc.) and compared these with the routes of the same parameters and start/end
points generated from the current live ORS.
If there are differences then the reasoning for these MUST be documented in the pull request.
and why the change was needed.
Original PR: #778.
Information about the changes
Examples and reasons for differences between live ORS routes, and those generated from this pull request
Required changes to ors config (if applicable)