Regarding Bus Routes using OneBusAway API

68 vues
Accéder directement au premier message non lu

vishnuthej kandukuru

non lue,
21 avr. 2016, 14:09:5021/04/2016
à OneBusAway API
Hi all,

I have created a new REST API that gives list of available Bus Routes between starting(lat,long) and destination(Lat,Long) using available OneBusAway REST api's.

i got successful in getting all available bus routes but the problem here is I am not able to get bus routes if there is no direct route available for given starting and destination locations.

I am using these 4 api to get available bus schedules and map it accordingly. The problem here is if there is no direct route between starting and destination and user has to take another bus in route,it is not returning any data.

This new API i am working on is similar to PLAN TRIP REST api that onebusaway retired long back. Please let me know if there is any way i can get connecting bus routes as well.


stops-for-location - search for stops near a location, optionally by stop code
stops-for-route - get the set of stops and paths of travel for a particular route
schedule-for-stop - get the full schedule for a stop on a particular date.
trip-details - get extended details for a specific trip.

MyLogic
1)Get nearby starting stops and routes using starting latitude and longitude. -- stops-for-location
2)Get nearby destination stops and routes using starting latitude and longitude.--- stops-for-location
3)Get common routes between starting and destination locations by intersecting step1 and step 2 values.
4)Get stop id's for common routes from step 3---stops-for-route
5) get common starting and destination stops for each available common routes by intersecting from step 1 and step 2.
5) loop through each common routes from step 3 and for each route get schedule for starting stop ids and with trip id in that route.--schedule-for-stop
6) for each trip id i will get trip details and get schedule arrival time for a bus at particular stop id along with respective destination schedule for destination stop id in that route---trip-details .
7)using this logic i am able to map starting and destination routes.

My Logic fails if there is no direct connection between routes. Please let me know if there is any alternative way we can get details of nearest possible connecting bus routes.



Tim

non lue,
21 avr. 2016, 14:22:1321/04/2016
à OneBusAway API
As Sheldon previously mentioned, you can try OpenTripPlanner.  You can get data for the Puget Sound region here.

Alternatively you could use the Google Maps API for transit directions.  It doesn't look like that API has realtime arrival info, so you can always pair the generated directions with data found in the OBA API.

vishnuthej kandukuru

non lue,
21 avr. 2016, 15:04:1521/04/2016
à OneBusAway API
so there is no way i can use  OneBusAway Rest API to get get connecting bus route information?. I am not aware of Google Maps API for transit directions. and OpenTripPlanner.. can you please be more specific on how i can use these . Are these free to use or any payement is required. My requirement here is to get all available bus routes for a given starting and destination(address or location) with all possible route and route legs information.

Tim

non lue,
21 avr. 2016, 15:12:1021/04/2016
à OneBusAway API
The OBA API is more of a discovery API than anything.  As mentioned several times, it is not designed for trip planning.

OTP would require you to set up a service running the software and you would need to import transit data.  The Google Maps API is a public API with data for many transit agencies.  For more information on pricing, visit the website of each.
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message