-
Notifications
You must be signed in to change notification settings - Fork 6
Orion Trip Generator
Eddy Ionescu edited this page Jun 7, 2018
·
21 revisions
- takes in JSON S3 files (API output) to generate trips
What is a trip?
- uniqueness is defined by (vehicle_id, route_id, direction_id) staying consistent with every transit state.
- If this tuple is different in the next state, then we end the trip. If we see a tuple that we didn't see last state, we start a new trip.
- when a trip ends, we write it to a JSON file in S3 (
agency_id-vehicle-id_route-id_direction_id-start_time-end_time.json
, where times are in a timestamp in milliseconds). We can worry about compressing it or loading it into some databases later.
What is a state?
- it's a snapshot of where all Muni vehicles are with a timestamp
Why?
-
our goal is to get the speed & reliability of routes.
-
An easy way of approaching this problem is to look at individual trips and then get data about them along route segments.
-
Storing trip metrics also makes it easier to eventually quickly handle more complex analysis due to aggregated metrics.
-
our goal is to make Muni's GPS data open and accessible to use.
-
making trip data accessible via S3 keeps individual file sizes small and is straightforward & logical for open-data users to retrieve.
What the output will look like:
agency:
startTime:
endTime:
route:
direction:
vid:
states: [{
vtime:
lat:
lon
}]
(json)
How it'll work:
- how it'll persist state:
- each time it goes to the next state, it dumps its state