Data schema
Each daily CSV archive contains two files:
subwaydatanyc_YYYY-MM-DD_trips.csv and
subwaydatanyc_YYYY-MM-DD_stop_times.csv.
All times are Unix timestamps in seconds.
Empty values mean the data is not available.
trips.csv
One row per trip.
trip_uid |
Unique ID for the trip, generated by the subwaydata.nyc project.
The motivation is to have an ID that is unique across the whole dataset, which the trip ID isn't (it repeats every day).
The UID is the trip's start_time followed by its trip_id with the first six characters removed.
For example, trip 024000_7..S starting at 1792123200 has the ID 1792123200_7..S.
|
trip_id | Trip ID in the GTFS realtime feed. |
route_id | Route, e.g. A or 7. |
direction_id | Trips on a route (e.g. the A train) travel in one of two directions. This field determines which direction the trip is going. In general 0 means northbound (uptown A) and 1 means southbound (downtown A). But some subway lines like the L don't move north-south, and even the A goes west-east in Brooklyn. |
start_time |
Scheduled start time of the trip.
The MTA encodes this in the first six digits of trip_id, in hundredths of a minute after midnight
(e.g. 024000 is 4:00am).
This is combined with the trip's start date from the feed.
|
vehicle_id | ID of the train running the trip. This is an internal MTA ID and is probably not very useful. |
last_observed | Last time the trip appeared in the feed. |
marked_past |
Time the trip disappeared from the feed:
the first feed update after last_observed that didn't include the trip.
This is usually a few seconds after last_observed.
|
num_updates | Number of feed updates that included the trip. |
num_schedule_changes | Number of times new stops were added to the trip. This is generally zero because the stop schedule for a trip is fixed for its entire duration. But it can be non-zero if, say, an express train is moved to the local tracks because of an emergency. Trips with such schedule changes are more likely to have data inaccuracies. |
num_schedule_rewrites | Number of times the trip's remaining stops were replaced entirely. This is generally zero because the stop schedule for a trip is fixed for its entire duration. But it can be non-zero if, say, a train is rerouted because of an emergency. Trips with such schedule changes are more likely to have data inaccuracies. |
stop_times.csv
One row per stop of each trip.
trip_uid | The trip, from trips.csv. |
stop_id | GTFS stop ID, e.g. 701S. This stop ID appears in the GTFS static data. |
track | Track the train used at the stop. The concept of "track" is a NYC subway specific extension to the GTFS realtime specification. In stations with many platforms (e.g. express and local platforms) the track tells which platform the train stopped at. |
arrival_time | Arrival time at the stop. Empty at the first stop. |
departure_time | Departure time from the stop. Empty at the last stop. |
last_observed | Last time the stop appeared in the feed for this trip. |
marked_past |
Time the stop disappeared from the feed, i.e. the train passed it:
the first feed update after last_observed that didn't include the stop.
This is usually a few seconds after last_observed.
|