Demo: live bus/congestion visualisation

Video capture of something I’m working on: sydney_buses

Each dot is a bus. Colour is based on traffic conditions, from moving freely (dark blue) to heavily congested (white). This is based on a short slice from yesterday but I’d like to do a full 24 hour period, and include trains. It’s made in Processing (adapting these examples) with about 45 minutes of live position data from yesterday.

Goals:

  • Do a full 24-hour cycle
  • Add basemap tiles
  • Add pan/zoom interaction
  • Add timeline control
  • Add toggle for colour scheme between speed, congestion and passenger occupancy
  • Add colour scheme tweening so the colour doesn’t change abruptly at the end of a trip segment
4 Likes

Nice. How do you determine “congestion”?

Congestion is one of the fields the API returns. The formula is given here on page 49: https://opendata.transport.nsw.gov.au/sites/default/files/TfNSW_GTFS_Realtime_Buses_Technical_Doc.pdf

It appears to compare current average speed against long and short term average speed, though the description is a little vague.