Skip to content
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

Add new features from work on TriMet’s OpenTripPlanner Shared-Use Mobility (OTP SUM) project. Resolves #2642 #2664

Closed
wants to merge 131 commits into from

Conversation

evansiroky
Copy link
Contributor

@evansiroky evansiroky commented Nov 1, 2018

Not sure if this should be one giant PR or multiple different ones, but sort of starting the process here. This is a PR to add the work being done on TriMet’s OpenTripPlanner Shared-Use Mobility (OTP SUM) project to OTP master. Some of the items in this PR (especially with TNC and car rental routing build on the work done for each).

Issues and Roadmap

  • issue: Link to or create an issue that describes the relevant feature or bug. Add GitHub keywords to this PR's description (e.g., closes #45).
  • roadmap: Check the roadmap for this feature or bug. If it is not already on the roadmap, PLC will discuss as part of the review process.

Items with issues

#2642 (add TNC routing).

Transportation Network Company (TNC) routing has been added from inspiration of how the current Park and Ride and Kiss and Ride routing works. TNC routing is currently implemented to work with either Uber or Lyft. In a shortest path search, it is possible to hail a TNC vehicle while on a StreetEdge. The TNC must be used a minimum amount of distance before deboarding and is alighted whenever a StreetEdge that forbids driving is encountered or when a StreetTransitLink is encountered or the destination is reached. While traversing streets, the weight is increased by multiplying the weight with a drive time reluctance factor and a drive distance reluctance factor which are configurable. A postprocessing check will occur that will remove certain itineraries that do not have a certain percent of the distance of the overall journey using transit.

Part of the TNC routing includes an updater that doesn't actually update the graph, but does allow for querying the TNC APIs for arrival, trip duration and price estimates. The arrival estimates are used to determine if a TNC is avaible to pickup at a certain location and will result in no results being found if no service is reported to exist. Each response with a TNC leg is returned with arrival, duration and price estimates.

This code also attempts to read OSM way tags to determine if a particular way is suitable for a TNC pickup/dropoff. Currently, the first parking:lane tag is read and if the value is either no_stopping or fire_lane then TNC pickups/dropoffs are not allowed. This has limitations of data quality since there are only 597 ways with a parking:lane:* tag in the Portland Metro area at the time of the creation of this PR.

Items without issues, but listed in OTP Project in 1.4

Add Car Rental routing

Car rental routing has been added by heavily copying the bike rental codebase. The car rental code also uses a lot of code copied from on-going work from Coord's bike rental routing work in their own branch/fork of OTP. The car rental routing has an updater that consumes data from a file or url about Car2Go locations. The updater also reads in an optional GeoJson feature representing a car rental region that vehicles must be dropped off inside of. Almost all of the rental region code was copied from the Coord fork. It is however possible to configure a car rental trip request that allows the car to be dropped off outside of a region. New edge and vertex types for car rental stations are added. Furthermore, car rentals are allowed to be dropped off on any street edge that allows that. That code is also copied and modified from Coord's work.

This code also attempts to read OSM way tags to determine if a particular way is suitable for a car rental dropoff. Currently, the first parking:lane tag is read and if the value is either no_stopping or fire_lane or no_parking then car rental dropoffs are not allowed. This has limitations of data quality since there are only 597 ways with a parking:lane:* tag in the Portland Metro area at the time of the creation of this PR.

Custom walk configuration

TODO: explain this a little more

Items without issues and not listed in OTP

Park and Ride improvements

A new API endpoint for fetching a list of Park and Rides has been added at /routers/{routerId}/park_and_ride.

Some stuff with elevation metadata

TODO: explain this a little more

Improvements to InterleavedBidirectionalHeuristic

There were some bug fixes and improvements. This heuristic is being used as a way to speed up searches with transit by attempting to traverse and score ways close to the origin and destination before doing the main graph search. A number of problems were identified in this issue here that were the result of problems with the InterleavedBidirectionalHeuristic. There was an issue with the heuristic not adding bike rental stations or car rental stations, thus ignoring them in searches. One-way streets were being traversed backwards while walking a bike which led to trips that did not respect the maxWalkDistance parameter. Also, trips with cars were traversing the entire graph, so now, if the car mode is enabled, the pretransit search isn't done at all and a limiter on the posttransit search was implemented to stop the search once the origin was reached. And finally, forked states weren't being analyzed so that was fixed.

Tests

Some tests have been added (especially for the TNC and Car Rental updaters), but elsewhere tests have not been added. All tests are currently passing. Should this PR also add code coverage checking to OTP? At Conveyal, we use codecov.io for this which is free for open-source projects.

Formatting

Yes

To be completed by @opentripplanner/plc:

  • reviews and approvals by 2 members, ideally from different organizations
  • before merging: add a bullet point to the changelog file with description and link to the linked issue
  • after merging: update the relevant card on the roadmap

David Emory and others added 30 commits October 30, 2017 17:03
Also, update to junit 4.12 so that wiremock can work
Go all-in on ObjectMapper deserialization and make packages for the
lyft and uber updaters to organize all the files
@evansiroky evansiroky changed the base branch from master to dev-1.x May 2, 2019 21:03
@evansiroky
Copy link
Contributor Author

I no longer intend to merge this specific PR as a whole into OTP as almost all of the items that were added to this trimet-dev branch have been broken out into other PRs. However, if it's ok with the repository owners, I would like to keep this PR open until all the other branches get merged in. That way I should be able to reconcile that against what is in this development branch to see if anything hasn't yet been merged into the primary branches of this repository.

@evansiroky
Copy link
Contributor Author

Active development on this branch has moved to https://github.com/ibi-group/OpenTripPlanner/tree/trimet-dev. Therefore, I'm closing this PR.

@evansiroky evansiroky closed this May 10, 2019
t2gran pushed a commit to entur/OpenTripPlanner that referenced this pull request Feb 25, 2020
t2gran pushed a commit to entur/OpenTripPlanner that referenced this pull request Feb 25, 2020
t2gran pushed a commit to entur/OpenTripPlanner that referenced this pull request Feb 25, 2020
t2gran pushed a commit that referenced this pull request Feb 26, 2020
Relevant code changes extracted from #2664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants