Does OpenTripPlanner outputs "timetables"

401 views
Skip to first unread message

TA

unread,
Apr 14, 2014, 9:26:07 PM4/14/14
to opentrippl...@googlegroups.com
Hi.

I´m using OpenTripPlanner to plan trips and PHP+MySQL to build timetables based on a route, can OpenTripPlanner output (XML/JSON) all data (calendar, trips, stop_times, shapes, stops, etc) for a specific route from a specific agency?

Thanks.

Best Regards.

Andrew Byrd

unread,
Apr 15, 2014, 4:38:17 AM4/15/14
to opentrippl...@googlegroups.com
On 04/15/2014 03:26 AM, TA wrote:
> I´m using OpenTripPlanner to plan trips and PHP+MySQL to build
> timetables based on a route, can OpenTripPlanner output (XML/JSON) all
> data (calendar, trips, stop_times, shapes, stops, etc) for a specific
> route from a specific agency?
OTP does index and expose the contents of GTFS feeds via what we call
the "transit index API". In versions 0.10.0 and 0.11.0 this is a
collection of web API resources added by different people at different
times to meet their needs. You may or may not be able to combine the
existing resources or modify the code to do what you need. See:
http://docs.opentripplanner.org/apidoc/0.11.0/resource_TransitIndex.html

In version 1.0 the transit index API will be much more coherent and
structured. You can see the work in progress at:
https://github.com/opentripplanner/OpenTripPlanner/blob/1.0.x/src/main/java/org/opentripplanner/index/IndexAPI.java

-Andrew

TA

unread,
Apr 15, 2014, 10:08:57 AM4/15/14
to opentrippl...@googlegroups.com
Thanks for the answer.

Indeed thats what i´m looking for, but what should i use to get stop_times to build a timetable? I looked for stopTimesForTrip, this should output all stop_times for a specific trip, correct? How should i set the parameters?

This is working:

But tried multiple parameters in stopTimesForTrip but cant managed to get it working:


Also looking forward to 1.0!

Best Regards.

Jorden Verwer

unread,
Apr 16, 2014, 6:22:57 AM4/16/14
to opentrippl...@googlegroups.com
Yeah, the stopTimesForTrip endpoint is kind of problematic. I wrote a replacement for it that you can find in the mmri-rt branch, but cherry picking it won't work. Andrew's total rewrite is probably even better, but that code is unfortunately also unavailable to you. It's tantalizing, I know. Maybe someone else got it to work and then they could chime in.

Regards,

Jorden

Op dinsdag 15 april 2014 16:08:57 UTC+2 schreef TA:

Andrew Byrd

unread,
Apr 16, 2014, 7:08:25 AM4/16/14
to opentrippl...@googlegroups.com
I've never used the original implementation so can't tell you much about its quirks. I can tell you that it's working in the 1.0.x branch (which isn't too useful presently unless you don't mind disabling all the tests when you compile it). The response to http://localhost:8080/otp/routers/default/index/trips/TriMet_4321669/stoptimes is something like this:

[
{
stopId: "13643",
scheduledArrival: 58920,
scheduledDeparture: 58920,
realtimeArrival: 58920,
realtimeDeparture: 58920,
arrivalDelay: 0,
departureDelay: 0
},
...

-Andrew
--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Georgios Mathioudakis

unread,
Jan 11, 2015, 11:49:48 AM1/11/15
to opentrippl...@googlegroups.com
Hi Andrew,

Any idea on the format used for the scheduledArrival value? 
i.e. How you translate the 58920 value to something you can use.

Thanks,
George

Marko Burjek

unread,
Jan 12, 2015, 4:44:55 AM1/12/15
to opentripplanner-users
According to Javascript which reads this API. you need to multiply value with 1000 and then you get Time part of stopTime.

I don't know in what state StopTImes API is currently 23 days ago (https://github.com/opentripplanner/OpenTripPlanner/pull/1650#issuecomment-67745179) only first trips of the day were shown)

But version 0.10 works correctly API is a little different but TransitAPI works.

--

Marko Burjek

unread,
Jan 12, 2015, 4:46:10 AM1/12/15
to opentripplanner-users
When you multiply this value with 1000 you get Unix time in which only time part is usefull. (Date part is empty)

andrew byrd

unread,
Jan 14, 2015, 9:44:03 AM1/14/15
to opentrippl...@googlegroups.com
Thanks Marko for looking into this question. There is however a much
simpler way to say this: it's the time in seconds after midnight.

-Andrew
Reply all
Reply to author
Forward
0 new messages