-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Restructure walk/bicycle/car preferences in router-config.json #5582
Restructure walk/bicycle/car preferences in router-config.json #5582
Conversation
3813de5
to
cbf2406
Compare
…ngle configuration
cbf2406
to
831a4d8
Compare
/** | ||
* Bicycle optimization types that are only meant to be used by the REST API. Related to {@link org.opentripplanner.routing.core.BicycleOptimizeType} | ||
*/ | ||
public enum LegacyBicycleOptimizeType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice separation here.
src/main/java/org/opentripplanner/routing/api/request/preference/VehicleWalkingPreferences.java
Outdated
Show resolved
Hide resolved
// triangle overrides the optimization type if defined | ||
.withForcedOptimizeTriangle(it -> mapOptimizationTriangle(cb, it)) | ||
.withWalking(it -> mapVehicleWalking(cb, it)) | ||
.withParking(it -> mapParking(cb, it)) | ||
.withRental(it -> mapRental(cb, it)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very nice cleanup. 👍
) | ||
.withRental(it -> setVehicleRental(c, it)); | ||
// triangle overrides the optimization type if defined | ||
.withForcedOptimizeTriangle(it -> mapOptimizationTriangle(cb, it)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favour of this behaviour but doesn't this change how the API works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used by the configuration which we can break now. Later on I will use it for the new plan query as well. All the other places use the old method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few comments but generally I think this is a great PR.
…ce/VehicleWalkingPreferences.java Co-authored-by: Leonard Ehrenfried <[email protected]>
It's not directly related to this PR but I realised that we don't have a test for mapping the Do you think you can pull it into this branch? |
Thanks, I've included it now. |
Summary
Make own wrapper objects for bicycle, car and walk in router-config.json. Additionally, make parking and rental objects for car and triangle, walk, rental and parking objects for bicycle.
Issue
This is related to #4803
Unit tests
Added and updated tests
Documentation
Updated documentation
Changelog
From title