Skip to content

Conversation

@leonardehrenfried
Copy link
Member

@leonardehrenfried leonardehrenfried commented Mar 20, 2023

Summary

This adds an integration with ride hailing services. At the moment Uber is the only supported provider but Lyft might be added later.

The implications for the core routing code are suprisingly small: we make use of the existing CAR_PICKUP/DROPOFF code and only dectorate the resulting itineraries in a filter with extra information about the estimated arrival duration and price.

Warning

This feature is considerably slower than regular OTP searches as it extensively talks to external services.

Issue

Closes #4832
Closes #2678

Unit tests

Lots added.

Documentation

Added.

cc @demory

Review instructions for IBI

@binh-dam-ibigroup @demory If you want to execute a car hailing query in the debug UI you can select the last entry from the mode drop-down "Car hailing & transit". The debug UI will not show any Uber related information though.

I recommend that you try out the GraphQL explorer with the following query:

{
  plan(
    from: {lat: 45.508271755944975, lon: -122.4288940}
    to: {lat: 45.579445114, lon: -122.7097320556}
    transportModes: [{mode: CAR, qualifier: HAIL}, {mode: TRANSIT}]
    numItineraries: 1
    carReluctance: 4
  ) {
    itineraries {
      duration
      legs {
        mode
        legGeometry {
          points
        }
        rideHailingEstimate {
          provider {
            id
          }
          arrival
          minPrice {
            currency {
              code
            }
            amount
          }
          maxPrice {
            currency {
              code
            }
            amount
          }
        }
      }
    }
  }
}

A complete configuration example is available at https://github.com/ibi-group/OpenTripPlanner/tree/car-hailing-uber/docs/examples/ibi/portland

@leonardehrenfried leonardehrenfried added !New Feature A functional feature targeting the end user. +Sandbox This will be implemented as a Sandbox feature IBI Developed by or important for IBI Group +Bump Serialization Id Add this label if you want the serialization id automatically bumped after merging the PR labels Mar 20, 2023
@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Patch coverage: 75.63% and project coverage change: +0.07 🎉

Comparison is base (560ea80) 64.32% compared to head (b534346) 64.39%.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #4979      +/-   ##
=============================================
+ Coverage      64.32%   64.39%   +0.07%     
- Complexity     13804    13856      +52     
=============================================
  Files           1689     1712      +23     
  Lines          66770    67079     +309     
  Branches        7189     7210      +21     
=============================================
+ Hits           42947    43196     +249     
- Misses         21417    21462      +45     
- Partials        2406     2421      +15     
Impacted Files Coverage Δ
...tripplanner/ext/fares/impl/GtfsFaresV2Service.java 95.96% <0.00%> (ø)
...raphqlapi/generated/LegacyGraphQLDataFetchers.java 0.00% <ø> (ø)
...legacygraphqlapi/generated/LegacyGraphQLTypes.java 7.57% <0.00%> (-0.01%) ⬇️
...tripplanner/ext/transmodelapi/support/GqlUtil.java 75.67% <ø> (ø)
...ostopheuristics/VehicleToStopSkipEdgeStrategy.java 0.00% <ø> (ø)
...ramework/graphql/scalar/DurationScalarFactory.java 60.00% <ø> (ø)
...ava/org/opentripplanner/model/GenericLocation.java 82.60% <ø> (ø)
...java/org/opentripplanner/model/plan/StreetLeg.java 71.42% <ø> (ø)
...m/filterchain/ItineraryListFilterChainBuilder.java 88.49% <0.00%> (-3.25%) ⬇️
...pplanner/routing/api/response/RoutingResponse.java 47.82% <0.00%> (-2.18%) ⬇️
... and 45 more

... and 15 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@leonardehrenfried leonardehrenfried force-pushed the car-hailing-uber branch 6 times, most recently from 6c4947a to 86b8fc9 Compare March 20, 2023 15:32
@leonardehrenfried leonardehrenfried marked this pull request as ready for review March 20, 2023 15:39
@leonardehrenfried leonardehrenfried requested a review from a team as a code owner March 20, 2023 15:39
Copy link
Member

@t2gran t2gran left a comment

Choose a reason for hiding this comment

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

My biggest consern so fare is the time-shift of the request.

@leonardehrenfried
Copy link
Member Author

leonardehrenfried commented Apr 12, 2023

Note for the dev meeting

The following items are still open:

  • How to represent fractional/cent money amounts in GraphQL?
  • How to insert wait time, rather than shifting the start time?

@leonardehrenfried
Copy link
Member Author

leonardehrenfried commented Apr 13, 2023

@t2gran I decided that I rather remove the timeshifting feature in order to get this merged more quickly.

I'm going to re-add it in a later PR.

Copy link
Member

@t2gran t2gran left a comment

Choose a reason for hiding this comment

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

I have made it through everything now, so just a few small things left.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

Works for me with the latest changes.

@leonardehrenfried leonardehrenfried merged commit cf53eee into opentripplanner:dev-2.x Apr 17, 2023
t2gran pushed a commit that referenced this pull request Apr 17, 2023
t2gran pushed a commit that referenced this pull request Apr 17, 2023
@leonardehrenfried leonardehrenfried deleted the car-hailing-uber branch April 17, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

+Bump Serialization Id Add this label if you want the serialization id automatically bumped after merging the PR IBI Developed by or important for IBI Group !New Feature A functional feature targeting the end user. +Sandbox This will be implemented as a Sandbox feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for ride sharing/car hailing/taxi services

3 participants