Project Traffico — A Creative Use of Bus Arrival Times
Traffico (Traffic Observer) monitors bus arrival times to infer traffic conditions
In Part 1, I have shown that we can quite accurately compute the estimated journey time between bus stops through the use of backdated arrival times.
A straightforward application is to use them to infer traffic conditions. Indeed, I have always wanted to know how bad traffic congestions along Punggol Road are and now I am able to collect and visualise some real data.
Developers who are keen to determine the speed of traffic along roads should check out LTA’s Traffic Speed Band API. This API allows you to query the current traffic speeds on roads, expressed in speed bands. I am aware of this API but I still proceeded to build Traffico as an exercise. Just a note from the current documentation (API User Guide dated 6 Oct 2017), I have no way to determine the unique ID of roads for this API and I have given my feedback to LTA.
Automating the computation process, I was able to compile the estimated journey times for bus service 83 between bus stop code 65079 and 65069 during the off-peak hours for a few weeks.
As shown, on almost 160 occasions, the bus took 130+ seconds to travel between the 2 stops. We can use data in this chart to set a realistic threshold and if it has been exceeded, we know that the bus is taking longer than usual to travel between the stops, which means the road might be congested.
In order to mitigate the constraint shared in Part 1, I have to use at least 2 services along a single road to strengthen the algorithm. The probability of bus bunching across multiple services is lower.
The images below are taken on 17 November 2017 with an iPad Mini. Through visual inspection (i.e. looking out of my window), I could see the congestion towards Sengkang.
Punggol Road — TPE Junction
Punggol Road — TPE
I have also added two features for registered users.
Well, the system is not perfect but generally it works. It takes a while for the system to react to actual changes on the ground because we are monitoring buses and updates are only possible when buses arrive at stops (usually every 3 to 15 mins).
If you find these articles useful, please share them. Let me know if you have any queries or feedback.