-
Notifications
You must be signed in to change notification settings - Fork 6
StopReliability
Eddy Ionescu edited this page Jan 13, 2019
·
1 revision
Point-Reliability is a feature where one puts a pin on the map and the reliability of the selected route during the selected time-interval appears in the bottom pane.
- the coordinates of the pin will be passed in as an optional argument to the existing GraphQL endpoint.
- if provided, a PointReliability object will be returned at the top level.
StopReliability {
lat: Float
lon: Float
sid: String
arrivals: [Arrival]
}
Arrival {
rid: String
did: String
arrival: Date
departure: Date
dwell: Int
lat: Float
lon: Float
}
- No changes
-
Given the pin, get all arrival/departures/pass-throughs for vehicles on each route travelling through that point.
-
In each state, each vehicle's distance to/from
-
Given the pin, go through the locations and for each one within the radius (50 metres), make it into an arrival.
-
For each vehicle ID, if its distance is closer to point, we take the closest and earliest time to the point, which gets us the arrival.
-
For departures, we take the closest and latest time to the point. We make the assumption that a vehicle's location won't change during dwelling
- may not be true at near-side stops, where at peak-hours operators often drop off customers before the stop due to cars ahead waiting to turn right. Cases:
- Vehicles skipping a stop. Arrival/Departure times would be almost the same, so dwell time would be zero.
- Vehicles stopped at near-side stop intersection but doors never open. Since door status isn't part of the Nextbus feed, we can't distinguish in this case.
- Vehicle travelling in the opposite direction during the time interval while staying in the area. We take vehicles by (vehicle ID, direction ID) pairs, so there'd be two arrivals/departures.
- Vehicle passes through area without having any timepoints within. We process all vehicles, so if a vehicle
- Gets the arrivals - select one or more patterns (ie. select individual directions and branches, while also analyzing trunk sections)
- Add ability to choose a time interval and drop a pin.
- Add bottom pane where arrivals are shown.