Demo: live bus/congestion visualisation


Video capture of something I’m working on:

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.


  • 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

How do you request Opal data?

Nice. How do you determine “congestion”?


Congestion is one of the fields the API returns. The formula is given here on page 49:

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