-
Notifications
You must be signed in to change notification settings - Fork 6
[Archived] Stop Service Design Proposal
Eddy Ionescu edited this page Jul 8, 2018
·
1 revision
Requirements
Individual Stops
- Calculate time since a bus was last at a stop (previous bus).
- Calculate max/min/mean/med wait times for each route at a stop during any time interval
Pair of Stops on same route
- Calculate average speed & max/min/mean/med duration between those two stops on that route during any time interval
- Show speed visualization within that pair
Cassandra Data Model
This is the stopState table, which contains the arrival and departure of a vehicle.
Primary key: (vdate, vhour)
Cluster keys: (vtime, rid, vid)
Keys:
vdate date,
vhour smallint,
sid ascii, # stop ID
rid ascii, # route ID
vid ascii, # vehicle ID
tid ascii, # trip ID (based on schedule)
arrival timestamp,
departure timestamp,
Data Population - done by Orion
- For each vehicle, we use its heading and the list of stops on its route to determine its next stop.
- If that vehicle is within a certain distance of its next stop (say, 8 metres), it's considered to have arrived. Once it's outside of that radius, it's considered to have departed.
- If a vehicle's next stop changes but was never marked as arrived, we consider that stop to have been skipped (as either the driver skipped the stop or its location wasn't updated frequently enough (we've sometimes seen Nextbus take over a minute to update a vehicle's location, but once we work with transit agencies they should let us access their data streams)).
Calculations - done by Tryn-API (directly or by calling some other service)
(add your name with relevant comments and whether it should move forward)
- Chris - I think I'm mostly seeing what you're trying to do here and that we should move forward