Skip to content

Congestion and Delay

Michael Barry edited this page Aug 26, 2014 · 2 revisions

http://mbtaviz.github.io/#interaction

This section from Visualizing MBTA Data has two parts. On the right is a set of horizon charts that show the total number of people entering the entire system paired with heat maps that show the combined speed of all of the trains in the system. This is combined with a map glyph that shows this same information for each station and line segment. congestion-and-delay.js renders the chart and map glyph and sets up interaction with links in surrounding text.

http://mbtaviz.github.io/#interaction

Required data format

This visualization requires 4 data files to render:

  • station-network.json nodes (stations) and links that represent the network topology of the subway system
  • spider.json screen placement for stations in order to render the map glyph
  • delay.json turnstile exit/entry counts and delay between stations in time buckets
  • average-actual-delays.json pre-computed historical average transit times between adjacent stations

station-network.json and spider.json are described in [Common Data Files](Common Data Files).

delay.json

Contains the system-wide and per-station transit times and turnstile entry/exit counts for 15-minute time buckets throughout the week. There are three timestamps in this data file, the day and secOfDay are included for the visualization's convenience and represent the day of the week and the elapsed time since the start of the day respectively. time is a unix timestamp for the start of the bucket.

[
  {
    "outs": {
      "station GTFS ID": exits per minute from this stop at this time
    },
    "ins": {
      "station GTFS ID": entrances per minute from this stop at this time
    },
    "secOfDay": seconds since start of day of this datapoint,
    "day": 0 based day of week of this datapoint, 0 is Monday and 6 is Sunday,
    "lines": [
      {
        "line": "line name",
        "delay_actual": {
          "starting station GTFS ID|ending station GTFS ID": transit time in seconds between these adjacent stops
        }
      }
    ],
    "ins_total": total number of entrances per minute across all stops during this time bucket,
    "delay_actual": relative speed all trains are running at during this time bucket (-0.1 = 10% fast, 0.4 = 40% slow),
    "time": unix timestamp in milleseconds of this datapoint
  }
]

average-actual-delays.json

Contains the average transit time in seconds between adjacent stations

{
  "starting station GTFS ID|ending station GTFS ID": average time in seconds between these stops, ...
}