OneBusAway / onebusaway-ios

OneBusAway for iOS, written in Swift.
Other
82 stars 33 forks source link

Build Trip Planner module #450

Open aaronbrethorst opened 7 years ago

aaronbrethorst commented 7 years ago

Placeholder task for building an OTP module for the iOS app. This needs to get broken down into granular and tractable work items.

From Sean: https://github.com/OneBusAway/onebusaway-iphone/issues/618#issuecomment-298036471

barbeau commented 6 years ago

For reference with OBA Android - there is a system architecture diagram for OBA Android that includes the trip planning feature at https://github.com/OneBusAway/onebusaway-android/blob/master/SYSTEM_ARCHITECTURE.md#add-trip-planning-andor-bike-share-optional

We use an OpenTripPlanner server (http://www.opentripplanner.org/) for the trip planning server. OBA Android client makes REST API requests with origin/destination, and OTP server responds with route plan.

All of the OBA Android code that implements this communication with the OTP server is available in the https://github.com/OneBusAway/onebusaway-android/tree/master/onebusaway-android/src/main/java/org/onebusaway/android/directions package.

Main trip planning UI elements are TripPlanActivity and TripPlanFragment.

OTP servers are currently set up for the Tampa and Puget Sound regions (which you can see in the otpBaseUrl elements in the Regions API - http://regions.onebusaway.org/regions-v3.json) if you want to test

barbeau commented 6 years ago

Note that there is an OTP iOS app at: https://github.com/opentripplanner/OpenTripPlanner-iOS

The biggest limitation for using this project is that the open-source license is unknown. I opened an issue in Nov 2014 and followed up through 2016, but the organization that wrote the code, OpenPlans, no longer exists and no one associated with that organization was able to provide/obtain licensing info.

The most recent commit to that repo was also Dec. 27, 2012, so the code is very dated in terms of both OTP server and iOS development practices.

barbeau commented 3 years ago

An update - we've implemented a Kotlin multiplatform library for making API requests and parsing responses for OpenTripPlanner v2 (OTP2) servers here, which includes an iOS module (Swift package) that's intended for use by OBAKit: https://github.com/CUTR-at-USF/opentripplanner-client-library

OBA Android will eventually be transitioned to use this library as well (long story short - we needed to build an OTP2 client for a desktop application, and figured why not build it for iOS and Android at the same time? 😅 🤷).

The main caveat right now, though, is that all OTP servers in OBA regions are all running OTP1, not OTP2. So:

  1. It's not clear to me if our Kotlin multiplatform library is backwards compatible with OTP1 servers
  2. I don't know the update timeline for regions to migrate from OTP1 to OTP2