OC Transpo API: O-Train returning duplicate arrival times for both directions?

67 views
Skip to first unread message

Eric James

unread,
Jul 22, 2015, 2:59:34 PM7/22/15
to Open Data Ottawa
For example stop 3062 Confederation, for both train directions Bayview and Greenboro, the arrival times are the same as both toward Greenboro.  
Are we suppose to ignore the Trip info for Bayview?
(
    [GetRouteSummaryForStopResult] => stdClass Object
        (
            [StopNo] => 3062
            [StopDescription] => CARLETON
            [Error] => 
            [Routes] => stdClass Object
                (
                    [Route] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [RouteNo] => 750
                                    [DirectionID] => 0
                                    [Direction] => 
                                    [RouteHeading] => Bayview
                                    [Trips] => Array
                                        (
                                            [0] => stdClass Object
                                                (
                                                    [TripDestination] => Greenboro
                                                    [TripStartTime] => 15:00
                                                    [AdjustedScheduleTime] => 11
                                                    [AdjustmentAge] => -1
                                                    [LastTripOfSchedule] => 
                                                    [BusType] => 
                                                    [Latitude] => 
                                                    [Longitude] => 
                                                    [GPSSpeed] => 
                                                )

                                            [1] => stdClass Object
                                                (
                                                    [TripDestination] => Greenboro
                                                    [TripStartTime] => 15:12
                                                    [AdjustedScheduleTime] => 23
                                                    [AdjustmentAge] => -1
                                                    [LastTripOfSchedule] => 
                                                    [BusType] => 
                                                    [Latitude] => 
                                                    [Longitude] => 
                                                    [GPSSpeed] => 
                                                )

                                            [2] => stdClass Object
                                                (
                                                    [TripDestination] => Greenboro
                                                    [TripStartTime] => 15:24
                                                    [AdjustedScheduleTime] => 35
                                                    [AdjustmentAge] => -1
                                                    [LastTripOfSchedule] => 
                                                    [BusType] => 
                                                    [Latitude] => 
                                                    [Longitude] => 
                                                    [GPSSpeed] => 
                                                )

                                        )

                                )

                            [1] => stdClass Object
                                (
                                    [RouteNo] => 750
                                    [DirectionID] => 1
                                    [Direction] => 
                                    [RouteHeading] => Greenboro
                                    [Trips] => Array
                                        (
                                            [0] => stdClass Object
                                                (
                                                    [TripDestination] => Greenboro
                                                    [TripStartTime] => 15:00
                                                    [AdjustedScheduleTime] => 11
                                                    [AdjustmentAge] => -1
                                                    [LastTripOfSchedule] => 
                                                    [BusType] => 
                                                    [Latitude] => 
                                                    [Longitude] => 
                                                    [GPSSpeed] => 
                                                )

                                            [1] => stdClass Object
                                                (
                                                    [TripDestination] => Greenboro
                                                    [TripStartTime] => 15:12
                                                    [AdjustedScheduleTime] => 23
                                                    [AdjustmentAge] => -1
                                                    [LastTripOfSchedule] => 
                                                    [BusType] => 
                                                    [Latitude] => 
                                                    [Longitude] => 
                                                    [GPSSpeed] => 
                                                )

                                            [2] => stdClass Object
                                                (
                                                    [TripDestination] => Greenboro
                                                    [TripStartTime] => 15:24
                                                    [AdjustedScheduleTime] => 35
                                                    [AdjustmentAge] => -1
                                                    [LastTripOfSchedule] => 
                                                    [BusType] => 
                                                    [Latitude] => 
                                                    [Longitude] => 
                                                    [GPSSpeed] => 
                                                )

                                        )

                                )

                        )

                )

        )

)

Eric James

unread,
Jul 24, 2015, 5:37:05 PM7/24/15
to Open Data Ottawa, urban...@gmail.com
Oh okay, looks like O-Train is single track.   But the API shouldn't be serving Trips when it is not in the same direction.   Below the Bayview RouteHeading should not be serving Greenboro trip destinations. 

Cyrus Kafai Wu

unread,
Nov 3, 2015, 8:16:00 PM11/3/15
to Open Data Ottawa, urban...@gmail.com
The O-Train is odd, the best option is to look at the Ottawa Transit GTFS document to determine the correct headings. But, direction id can identify that for you.

Note, all times for O-Train are scheduled, and not real-time data adjusted.
Reply all
Reply to author
Forward
0 new messages