Add documentation for PlannerResource#mode - #2809
Conversation
| * <ul> | ||
| * <li>WALK</li> | ||
| * <li>TRANSIT: General catch-all for all public transport modes.</li> | ||
| * <li>BICYCLE: Taking a bicycle onto the public transport and cycling from the arrival station to the destination.</li> |
There was a problem hiding this comment.
Transit isn't required with the BICYCLE mode. It's possible to send just BICYCLE and get a bike-only result.
evansiroky
left a comment
There was a problem hiding this comment.
The enunciate API docs certainly leaves a lot to be desired. I think it's a good idea to improve this piecemeal and I like the focus of the PR thus far. In its current form, I think this raises more questions than answers and could use the following improvements:
- An explanation of each of the modes and their prerequisites.
- An overall note that the availability of these modes depends on each OTP deployment and that some modes may not be available in certain deployments.
- An explanation of what mode qualifiers are and how although most won't make sense (eg FERRY_PARK) there are certain known combinations (eg BICYCLE_RENT, BICYCLE_PARK, CAR_PARK).
|
I appreciate the concern about completeness. Do you think it makes sense to put all of this information in the enunciate docs or would it be better to just give a list of possible values and link to a more fully-fledged documentation page (which I'd volunteer to write)?
There are also the qualifiers KEEP and HAVE, but they don't seem to be used. Am I seeing this correctly? |
|
I like the idea of only adding in a list of known mode strings and then putting in a link to more detailed documentation. I don't know what a good place for that would be though. Maybe a new section about modes in the Configuration docs (http://docs.opentripplanner.org/en/latest/Configuration/ which is derived from docs/Configuration.md)? Regarding the |
539a99c to
553c16a
Compare
|
I've move the more extensive discussion to Configuration.md. Can you check it for correctness? |
553c16a to
cb28af9
Compare
|
|
||
| - `WALK`: Walking some or all of the route. | ||
|
|
||
| _Prerequisite_: The maximum walking distance configured has not been exceeded. |
There was a problem hiding this comment.
This prerequisite is not always true and is rather complex to explain why, so I'd just remove it altogether.
|
|
||
| _Prerequisite:_ Bicycle parking stations near the station and visible to OTP by enabling the property `staticBikeParkAndRide` during graph build. | ||
|
|
||
| - `CAR`: Driving your own car the entirety of the route. |
There was a problem hiding this comment.
If the modes CAR,TRANSIT are sent over, this actually implies a "Kiss and Ride" type of search where a car will be driven through the street network from the origin until an opportune time when a transition to walking and then taking transit will occur. It might be good to note that.
|
|
||
| - `CAR_PARK`: Driving a car to the park-and-ride facilities near a station and taking public transport. | ||
|
|
||
| _Prerequisite:_ Park-and-ride areas near the station and visible to OTP by enabling the property `staticParkAndRide` during graph build. |
There was a problem hiding this comment.
The staticParkAndRide is set to true by default. It might also be worth noting that there need to be Park and Rides defined in the OpenStreetMap data that is being used.
There was a problem hiding this comment.
Also, it should be noted that for Park & Ride searches at least one transit mode should also be included, otherwise this will behave as if only the CAR mode were sent over.
|
|
||
| - `FERRY`: Taking a ferry. | ||
|
|
||
| - `GONDOLA`: Taking a hand-powered rowing boat. |
There was a problem hiding this comment.
The 7 above types, in general, refer to the route_type as defined in the GTFS specification. As such, the definition of BUS isn't quite right, the GONDOLA is not correct and FUNICULAR is missing.
|
|
||
| - `BICYCLE_PARK`: Leaving the bicycle at the departure station and walking from the arrival station to the destination. | ||
|
|
||
| _Prerequisite:_ Bicycle parking stations near the station and visible to OTP by enabling the property `staticBikeParkAndRide` during graph build. |
There was a problem hiding this comment.
It should be noted that for Bike Park & Ride searches at least one transit mode should also be included, otherwise this will behave as if only the BICYCLE mode were sent over.
af844a3 to
4ea61cf
Compare
|
I've incorporated the review feedback. Could you shed some light on how the mode |
4ea61cf to
0a82a9f
Compare
|
|
||
| - `BICYCLE_PARK`: Leaving the bicycle at the departure station and walking from the arrival station to the destination. | ||
|
|
||
| This mode needs to be combined with at least one transit mode (or `TRANSIT`) and with `WALK` otherwise it behaves like an ordinary bicycle journey. |
There was a problem hiding this comment.
The WALK mode is actually not required in order to make requests with the BICYCLE_PARK mode perform walking from the bike parking areas to transit and also walking after transit.
|
|
||
| - `CAR`: Driving your own car the entirety of the route. | ||
|
|
||
| If this is combined with `TRANSIT` it can return routes with a |
There was a problem hiding this comment.
I'd change this to be more explicit and say that If this is combined with TRANSIT or some other combination of transit modes the response will return routes...
This PR is looking better and better. The |
0a82a9f to
82a48f2
Compare
|
Thanks for the explanation. I've amended the PR once more. |
evansiroky
left a comment
There was a problem hiding this comment.
Awesome, thanks for all the amendments. This adds a lot of useful and clear information.
|
@evansiroky I found another piece of documentation which was showing the wrong default: Could you please take a look? |
|
Thanks @leonardehrenfried for the work on updating documentation. There are indeed many things in OTP that are not documented so it's good to make incremental improvements. This whole "mode qualifier" system was never totally completed - it was originally intended to allow specifying chains of allowed modes e.g. something like (WALK or BIKE) -> (TRANSIT) -> (BIKE or CAR). That depended on our "path parser" system which was eventually removed to reduce complexity. Then on top of that certain mode combinations were "recycled" to trigger things like park-and-ride or kiss-and-ride. So the end result is quite ad-hoc and I'm a bit hesitant to present it as if it were a coherent system, but of course at some point we need to describe things as they are. |
|
@abyrd Would you like me to change the documentation or is there anything else I can do to move this PR along? Would you like me to add your explanation? |
3c83f76 to
5f067a0
Compare
| `streets` | Include street input files (OSM/PBF) | boolean | true | | ||
| `embedRouterConfig` | Embed the Router config in the graph, which allows it to be sent to a server fully configured over the wire | boolean | true | | ||
| `areaVisibility` | Perform visibility calculations on OSM areas (these calculations can be time consuming) | boolean | true | | ||
| `areaVisibility` | Perform visibility calculations. If this is `true` OTP attempts to calculate a path straight through an OSM area using the shortest way rather than around the edge of it. (These calculations can be time consuming). | boolean | false | |
There was a problem hiding this comment.
The computations should not be time consuming during routing, only during graph build. We should clarify that here.
| * <p>The set of modes that a user is willing to use, with qualifiers stating whether vehicles should be parked, rented, etc.</p> | ||
| * <p>The possible values of the comma-separated list are:</p> | ||
| * | ||
| * <ul> |
There was a problem hiding this comment.
I'm a little hesitant to create such a list in documentation that we then have to manually maintain. Considering the limited number of "Qualified Modes" actually in use, it seems like we could just define an enum for all these values. But that would be a bigger refactor, I guess this is the best incremental improvement.
There was a problem hiding this comment.
I spent days debugging an issue with an unhappy customer that traced back to a lack of documentation of what value values were for leg.mode. Good, complete docs matter.
|
@abyrd Should this be cherry picked into OTP2 ? |
|
@t2gran yes, we should try to keep the documentation in sync. I expect that eventually when we do a 2.0 release we'll do a final sync of the documentation, Readme etc. to make sure all relevant changes are carried over. But like with the code changes, it will make any later merging easier if we cherry pick changes over right away. |
|
@t2gran also feel free to cherry pick documentation-only changes like this straight into dev-2.x, or merge equivalent PRs into 2.x without review as long as the equivalent 1.x PR has been approved and merged. |
|
Thank you I will cherry pick this one then. |
Since this is purely about documentation I took the liberty to remove the PR checklist. I hope this is acceptable.
I was confused about the mode parameter, and especially about the qualifiers like BICYCLE_PARK and BICYCLE_RENT so I experimented and dug through the code.
The documentation contained in the PR are the result of my findings.
I'm very happy to discuss the format and content.
Thanks for OTP - it's a great piece of software!