Visualizing the On Time Performance of Birmingham’s Bus System

A few months ago, Birmingham, Alabama’s bus system (BJCTA Max Transit) retrofitted all of their buses with a GPS system. Along with this upgrade, they released a website allowing riders and the public to track the locations of buses in real time. The website is backed with a public RESTful API, so I decided I would poll the API to retrieve live information on all the buses throughout the day and store them in a local database.

With this information, it is possible to run some analysis on the system. We could look at passenger count, travel time, travel deviation, areas where buses tend to slow down, performance at different times of the day, and a host of other analytics.

The first analysis I have done is looking at the time deviation. This is how far ahead or behind schedule a bus currently is. A negative number means it is ahead of schedule and a positive number means it is behind schedule. The general rule is that ± 5 minutes is “on time”.

The graph below goes through an entire day looking at all the buses on each route. Each route is separated into its own section, so you can clearly see how a single route performs throughout the day. Along a route, multiple buses will simultaneously be making individual trips along that route. Each color represents a different bus making a different trip. Since there is overlap between buses sometimes making it difficult to see where a trip starts and ends, I have placed bars below the graph. Each of these bars mirrors a single bus making a single trip, allowing you to easily see how many active buses there are and when they started and stopped their trip.

 

If we zoom into a specific route, we can get more detail (Click on the image to see the full day). This is line 17 – Eastwood Mall. It is one of the busier routes with several buses making simultaneous trips. As you can see, most trips start and end on time, however, there is a bit of a peak about halfway through the trips, where the bus is behind schedule by up to 15 minutes.

After looking through the data, I have few interesting conclusions:

  • There is quite a bit of deviation along most routes. However, the most important thing to look at is the start and end of each trip, and for most trips, those have a tendency to converge on 0 deviation. This means the overall trip length is as expected, but buses are being held up in the middle of trips due to traffic and other unforeseeable circumstances.
  • I don’t know what happened to the 14 (Idlewild Palisades) around 5pm. I’m thinking the bus broke down and a new bus (purple) had to be sent out to replace it.

  • Some routes are interlined. For example, the 12 and 18. The bus starts off as the 12, does its trip, but once it pulls into central station, that same bus becomes the 18 and does a trip along route 18. When it returns to central station, it once again becomes the 12. It appears as though the 18 is constantly taking longer than the expected time which makes the 12 start late. Even though the 12 makes up time, it can’t seem to ever get on schedule.

  • The 280 runs down a major suburban corridor that has the worst traffic in the region. Even during rush hour at 5.00pm, the route is expected to have the same trip time as 10am. Clearly it doesn’t.
  • The most heavily used routes: 17, 1, 3, 44, 45, 6, 28, 8, 1 Ex all have minor deviation and run on time.

The code is currently available on github:

https://github.com/line72/dv8

I’m still cleaning up the code, but it is currently usable. I’m also thinking about porting this to D3 and doing live visualization on a website rather than generating a static image.

BJCTA Trip Planner now in sync with official data

My trip planner for the BJCTA Max buses (http://www.bjctatripplanner.org) along with my android app, are now in sync with the official data from the BJCTA. I will continue to keep my site in sync with their data, which means up to date and accurate data!

[appbox googleplay net.line72.bjcta.opentripplanner.android]

Weld Article On The BJCTA Bus System

Weld recently did a two part series on the status of the BJCTA Bus System. My trip planner was featured in the second part. You can read it online from the links below:

Part 1
Part 1

Part 2
Part 2

Part 1 is a very interesting look at the decline of the bus system since the 1950s and the turmoil and political games around transit in Birmingham. Part 2 takes a look at what is being done now to improve the system along with stories from riders who rely on the system.

Sightings of My App

Last night I was waiting on a bus in 5 points after some drinks with friends. Among the 12 of us who were waiting on a bus, I noticed two young girls, who we clearly not from Birmingham, looking at their phones to figure out what bus to ride to get back to their hotel near the convention center. As I looked over their shoulder, I saw they were using my App! That right there was enough to make me realize that all the work I’ve been doing for the last 1.5 years has been worth it! So, if you haven’t already, give the buses a try and use my app to help you.

 

BJCTA Bus Trip Planner

[appbox googleplay net.line72.bjcta.opentripplanner.android]

[appbox appstore 303217144]

 

 

Updated Trip Planner

I have updated the trip planner for the BJCTA Max buses to include new routes. The 1 Express, 45 Express, 44 Montevallo, and 6 Pratt-Ensley have all been completed. You can download the data off of the GTFS Data Exchange.

My Trip Planner already includes the latest data. Or you can download my Android App for free from below.

[appbox googleplay net.line72.bjcta.opentripplanner.android ]

If you have an iPhone, you can download a 3rd party app called Hop Stop.

[appbox appstore 303217144]

Updated GTFS data

I have updated the GTFS data for both the tripplanner and on the GTFS Data Exchange. This adds in support for loops. This means we are now starting to support the DART trolley routes! Additionally, this adds in block support which dramatically improves routing in cases where the rider needs to stay on the bus when the bus changes from an outbound to an inbound route.

For example, the US31 route travels down US31 until it the Galleria Mall. At the Galleria Mall, the outbound trip stops and the inbound trip begins. However, on the inbound trip, the bus leaves the Galleria, and instead of going back the way it came, it loops up through Lorna road before eventually meeting up with US31 and continuing back to Central Station. This means if you are somewhere on US31 and want to go to downtown, you actually need to catch the outbound bus, ride it to the Galleria, stay on the bus as it switches to the inbound route, and ride it to downtown. Without the blocks, the routing algorithm was having trouble switching from outbound to inbound, and assumed the rider must exit the bus and make the transfer. Because the transfer time is less than 1 minute, the algorithm would tell the rider to get off the bus, and wait 30 minutes for the next bus! This is now fixed, and the algorithm now knows that the rider can stay on the bus and continue to Central Station. This should help along any of the routes that have loops.