Skip to content

Add documentation for PlannerResource#mode - #2809

Merged
abyrd merged 4 commits into
opentripplanner:dev-1.xfrom
leonardehrenfried:dev-1.x
Sep 11, 2019
Merged

Add documentation for PlannerResource#mode#2809
abyrd merged 4 commits into
opentripplanner:dev-1.xfrom
leonardehrenfried:dev-1.x

Conversation

@leonardehrenfried

@leonardehrenfried leonardehrenfried commented Aug 16, 2019

Copy link
Copy Markdown
Member

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!

@leonardehrenfried
leonardehrenfried requested a review from a team August 16, 2019 11:50
* <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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transit isn't required with the BICYCLE mode. It's possible to send just BICYCLE and get a bike-only result.

Comment thread src/main/java/org/opentripplanner/api/common/RoutingResource.java

@evansiroky evansiroky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. An explanation of each of the modes and their prerequisites.
  2. 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.
  3. 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).

@leonardehrenfried

leonardehrenfried commented Aug 20, 2019

Copy link
Copy Markdown
Member Author

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)?
On the other hand, if we start putting more information in that place, it might serve as an encouragement for other parameters to be documented more extensively.

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).

There are also the qualifiers KEEP and HAVE, but they don't seem to be used. Am I seeing this correctly?

@evansiroky

Copy link
Copy Markdown
Contributor

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 KEEP and HAVE qualifiers, I also can confirm they aren't used anywhere and I think it'd be a good idea to remove them to avoid any confusion. However, I'll ping the original author of those qualifiers (@abyrd) just in case.

@leonardehrenfried

Copy link
Copy Markdown
Member Author

I've move the more extensive discussion to Configuration.md. Can you check it for correctness?

Comment thread docs/Configuration.md Outdated

- `WALK`: Walking some or all of the route.

_Prerequisite_: The maximum walking distance configured has not been exceeded.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prerequisite is not always true and is rather complex to explain why, so I'd just remove it altogether.

Comment thread docs/Configuration.md Outdated

_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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/Configuration.md Outdated

- `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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/Configuration.md Outdated

- `FERRY`: Taking a ferry.

- `GONDOLA`: Taking a hand-powered rowing boat.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/Configuration.md Outdated

- `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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@leonardehrenfried
leonardehrenfried force-pushed the dev-1.x branch 2 times, most recently from af844a3 to 4ea61cf Compare August 22, 2019 11:30
@leonardehrenfried

Copy link
Copy Markdown
Member Author

I've incorporated the review feedback.

Could you shed some light on how the mode AIRPLANE works?

Comment thread docs/Configuration.md Outdated

- `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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/Configuration.md Outdated

- `CAR`: Driving your own car the entirety of the route.

If this is combined with `TRANSIT` it can return routes with a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

@evansiroky

Copy link
Copy Markdown
Contributor

I've incorporated the review feedback.

Could you shed some light on how the mode AIRPLANE works?

This PR is looking better and better.

The AIRPLANE mode behaves just like any other transit mode (those modes are TRAM, SUBWAY, RAIL, BUS, FERRY, CABLE_CAR, GONDOLA, FUNICULAR). Although I've never ran an OTP instance using that mode, I believe airplane routes are defined in the GTFS like any other transit route except that the route type uses route_type=1100 as noted in the Extended GTFS Route Types document.

@leonardehrenfried

Copy link
Copy Markdown
Member Author

Thanks for the explanation.

I've amended the PR once more.

evansiroky
evansiroky previously approved these changes Aug 22, 2019

@evansiroky evansiroky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for all the amendments. This adds a lot of useful and clear information.

@leonardehrenfried

Copy link
Copy Markdown
Member Author

@evansiroky I found another piece of documentation which was showing the wrong default: areaVisbility. I also added a more extensive description of what areaVisibility means.

Could you please take a look?

@abyrd

abyrd commented Aug 28, 2019

Copy link
Copy Markdown
Member

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.

evansiroky
evansiroky previously approved these changes Aug 29, 2019
@leonardehrenfried

leonardehrenfried commented Sep 5, 2019

Copy link
Copy Markdown
Member Author

@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?

Comment thread docs/Configuration.md
`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 |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
abyrd merged commit ead9970 into opentripplanner:dev-1.x Sep 11, 2019
@t2gran

t2gran commented Sep 13, 2019

Copy link
Copy Markdown
Member

@abyrd Should this be cherry picked into OTP2 ?

@abyrd

abyrd commented Sep 13, 2019

Copy link
Copy Markdown
Member

@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.

@abyrd

abyrd commented Sep 13, 2019

Copy link
Copy Markdown
Member

@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.

@t2gran

t2gran commented Sep 13, 2019

Copy link
Copy Markdown
Member

Thank you I will cherry pick this one then.

@t2gran t2gran added the X OTP1 ~ Not in use any more ~ Fix or backport to the 1.x version of OTP label Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

X OTP1 ~ Not in use any more ~ Fix or backport to the 1.x version of OTP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants