Go Raleigh + BusTime: Elevating Your Transit Experience 🚌🚀

Hey there transit enthusiasts, it’s been quite the ride this summer in Raleigh, NC, as the Go Raleigh transit agency decided to change things up in the real-time bus tracking game. They swapped out their trusty old TransLoc system for Clever Device’s BusTime. As a result, the Go Raleigh riders had to endure a brief hiatus in their real-time bus tracking experience.

But, guess what? I’m back in the driver’s seat, and after some serious detective work, I’m thrilled to announce that BusTime is now officially in the family of supported backends for the Go Transit App’s impressive Montclair system! 🎉

BusTime isn’t just any newcomer; it’s a proven player in the transit world, trusted by major agencies like the Chicago Transit Authority (CTA). In fact, my testing took me on a virtual tour of the Windy City, where CTA’s buses roll with the power of BusTime.

What’s even more exciting? This integration with BusTime paves the way for future expansion, potentially bringing our stellar transit tracking to even more cities down the road!

Now, let’s get technical. While Clever Device’s website may hide some of BusTime’s API details, fear not! CTA comes to the rescue with an excellent Developer Page offering access to API Keys and comprehensive API Documentation.

But wait, there’s more! Every feature you’ve come to rely on with Go Transit is fully supported through the BusTime API. This is especially good news for the residents of Raleigh, as it happens to be the city with the highest ridership.

As of the latest update, the Open Source software that powers Go Transit (Montclair) now boasts support for a diverse range of backends, ensuring a smooth ride:

  • Availtec
  • BusTime
  • GTFS-RT (Beta)
  • RouteShout
  • RouteShout v2
  • Transloc
  • Transloc v3

This comprehensive coverage guarantees that you’ll never miss your next bus, no matter which backend you prefer. So, whether you’re a loyal Go Raleigh rider or a transit aficionado eager to explore the wonders of BusTime, we’re here to meet your transit needs.

Stay tuned for more updates as we continue to enhance your transit experience. Thank you for your patience and loyalty – we look forward to serving you better than ever before! 🌟🚌🌟

See Stops and Arrival Estimates in Go Transit Apps

I have been making several improvements to the montclair code base, which is the software that powers all the Go Transit apps.

Go Transit now shows the stops of the selected route
See the stops for the Highland #12

First, for the selected routes, you can now see where all the stops are. This helps people who are unfamiliar with the system know where to pick up a bus that is near by.

See the arrival times of buses for the selected stop
Stop Arrival Times

Selecting a stop on the map will show you the estimated arrival time of buses for that stop! This is a live view that is continuously updated as the arrival estimates change.

If multiple buses use this stop, view all their arrival times
Arrival Times of a Stop with Multiple Buses

If multiple buses go through the same stop, then the app will show the arrival estimates for all the buses. This is especially useful in cases where routes overlap and you have multiple options.

All of these changes have already been pushed out, and any apps you have should automatically update!

Announcing the Go Transit Apps

During a recent visit to Steamboat Springs, Colorado, I quickly became frustrated with the app for the free bus system. I thought to myself that it would be really nice to have my Montclair app available for other cities. With that, the Go Transit series of apps were born.

I started off building out github actions for the montclair, montclair-pwa-android, and montclair-pwa-ios projects. The github actions will automatically generate a compiled build when the repository is tagged.

The next step was to build a transmogrifier. The transmogrifier takes a configuration, then pulls down a specific version of montclair, montclair-pwa-android, and montclair-pwa-ios, and replaces all the necessary names, strings, icons, and other information. The new versions are then pushed to their own repositories and tagged, which automatically kicks off the white labeled builds.

All that is left it to create a custom configuration (see Steamboat for an example). The assets projects all have github actions too, and each time a commit is pushed, it will then run the transmogrifier.

When all the builds are done, they can be uploaded to my website hosting provider, the Google Play Store, and the Apple App Store.

So far I have created white label builds for:

Go Birmingham, AL

‎Go Birmingham
‎Go Birmingham
Developer: Marcus Dillavou
Price: Free
Unknown app
Unknown app
Developer: line72
Price: Free

Go Mobile, AL

‎Go Mobile, AL
‎Go Mobile, AL
Developer: Marcus Dillavou
Price: Free
Unknown app
Unknown app
Developer: line72
Price: Free

Go Steamboat Springs, CO

‎Go Steamboat
‎Go Steamboat
Developer: Marcus Dillavou
Price: Free
Unknown app
Unknown app
Developer: line72
Price: Free

Go Indianapolis, IN

‎Go Indianapolis
‎Go Indianapolis
Developer: Marcus Dillavou
Price: Free
Unknown app
Unknown app
Developer: line72
Price: Free

Go Raleigh, NC

‎Go Raleigh
‎Go Raleigh
Developer: Marcus Dillavou
Price: Free
Unknown app
Unknown app
Developer: line72
Price: Free

For more information, see the Go Transit App website.

Validating Availtec’s Bus Arrival Estimates

In my last post, I created a dashboard that shows the estimated arrival time of buses at specific stops. After using it, I was curious to see how accurate those estimates are.

So I have created a new project:

availtec-estimate-validation

As always, everything is opensource and available on my github page.

This project consists of two parts:

  1. A capture script that queries Availtec’s API every 30 seconds for the estimated arrival time and stores them in a local database
  2. A graph script that generates pretty visualizations from the captured data.

Here is an example of the Route 44 Inbound at St. Vincents Hospital for Birmingham, AL’s transit system.

Route 44 Estimates

Each “block” is a bus trip throughout the day. The dark black line represents the actual time the bus arrived at this stop. The dark blue line shows when Availtec estimated the bus would arrive at that specific time.

Ideally, the dark blue line would be as close as possible to the dark black line.

From the image above, we can see that the 4th trip, from 10:44:17 to 10:46:17 had the best estimate. From 10:00am to 10:50am, Availtec estimated the bus would arrive ±30 seconds from when it actually did.

We can also see that the trip after it, had the worst estimate. From the time the trip started, just before 10:50, until around 11:20, Availtec was estimating the bus would arrive at 11:32, when it actually came at 11:38. It wasn’t until about 11:25, that the system suddenly corrected and started estimating a more realistic time.

This project works with any bus system that utilizes Availtec for real time tracking. You can leave the capturer program running in the background for days, then generate graphs based on that historical data. The graphing script allows you to specify which stops, routes, and days to plot.

Announcing Realtime Bus Tracking for Smashing Dashboard

I recently set up a raspberry pi to use as a smart dashboard on my TV. The goal is to turn on my TV and have weather, my calendar, todo list, and other useful widgets readily available. Instead of building my own, I decided to use the Smashing Dashboard, a fork of the original Dashing developed by Shopify. It is a nice looking, simple dashboard and can easily be extended with lots of widgets.

One widget that I really needed is the ability to see when the next bus arrives at the stop down the street from me. Birmingham, Alabama’s bus system uses Availtec, which has an API for getting the real time location of the bus along with the estimated arrival times at a stop. Using this, I wrote a new widget for smashing called smashing-availtec. It should work with any transit system powered by Availtec. Here is what it looks like:

Real time bus tracking with Smashing Dash Board

Since there are multiple stops I want to monitor, my widget allows creating multiple widgets, and having each widget filter for a specific stop and route (in case multiple routes go through the same stop). It will give an estimated time of arrival for the next two buses and will also how a live map of where the next bus is.

Instructions for getting the source code and configuring it are available on my github project page. Enjoy!

Announcing Montclair for iOS and Android

I have taken my Montclair bus tracking web site and created an App for both Android and iOS that you can download for free in their app stores.

Montclair
Montclair
Developer: Marcus Dillavou
Price: Free

Montclair
Montclair
Developer: line72
Price: Free

This came about because I have been unhappy about how iOS handles progressive web apps. Every time the app is brought to the foreground, iOS does a full reload, which can be slow and annoying. The native app handles this much nicer, and doesn’t ever have to reload the state.

To build the native apps, I used this handy tool: Progress Web App Builder. It takes your website, wraps it using Cordova, and generates both an iOS and an Android project. With only a few tweaks, I was able to get them submitted to the app store.

Real time tracking of Birmingham’s Bus Systems

Birmingham, Alabama’s transit agency, the BJCTA (Birmingham-Jefferson County Transit Authority) has a website for tracking the buses in real time. This website along with their mobile app are ok, but have some things that constantly annoy me. My biggest annoyance is that every time the App is brought to the foreground, it refreshes and resets you back to the main page, losing the bus you were trying to track. The other problem is that you can only view one route at a time (at least on the mobile app). I have 3 routes that I can choose between every day. When I open the app, I want those three routes selected by default so I can quickly see which route to pick.

With that, I present to you Montclair.

Montclair is a simple javascript application written in React. The version running at https://montclair.line72.net supports both the official Birmingham Transit System and the University of Alabama at Birmingham’s transit system. However, the code is not tied to any specific transit system and will actually support any real time system powered by Availtec or TransLoc. As always, everything is open source:

API For Historical Bus Data

My previous blog post (Visualizing the On Time Performance of Birmingham’s Bus System) looked at creating visualizations based on the real time data provided for Birmingham, Alabama’s public transit system. I have now created a simple, public API that can be used to query the historical data captured from the real time system.

Using my dv8 scripts, I am capturing a snapshot of the real time data every 30 seconds. I am then storing this data in a sql database, so that we will have a historical database. This allows for generating reports and visualizations over time. As of writing this, I have about 2.5 months of data captured.

I am making all of this data public, along with a simple API for making queries. The API is located at:

https://api.dv8.line72.net/

 

However, if you visit that site, you will notice that you get a ‘Page Not Found’ error. That is because it is only a backend API, and you will need to construct URLS to make queries. Let’s look at a few sample queries (All data is returned in JSON format. I have found that making these queries in Firefox is preferred over Chrome, since Firefox will nicely format the results):

Query for all the routes:

https://api.dv8.line72.net/routes

This returned a list of all the known routes and their properties. Each route also has a set of “Trips”. A trip is a unique instance of a bus running along a route. For example, if everyday at 4.00pm a bus leaves Central Station along the route 44 and arrives at its final destination at 5.00pm, this would be a Trip. We can get a list of all the trips for a specific route.

Query for all the trips on the Route 44

Based on the previous query, I have found that the “44 Montclair” has an id of 21.

https://api.dv8.line72.net/route/21/trips

This returned all 61 trips associated with the route 44. Unfortunately, this doesn’t give us that much information about the individual trip. For instance, we have no idea based on the returned results what time of day a trip runs. For every trip, we can get a series of “Waypoints”. Waypoints are all the known information about a bus on a trip at a given time. They are essentially a snapshot, showing the location, passenger count, time deviation, and various other details. We can pick a specific trip and query it.

Query all Waypoints for a single trip on the Route 44

I am going to select a trip at random from the previous query. I will use 699, and will query its waypoints:

https://api.dv8.line72.net/route/21/trip/699/waypoints

This returned A LOT of data. This trip runs every weekday, and we have samples at every 30 seconds. The API returns a maximum of 1000 waypoints, so only the first part of the data was returned. Typically, we want to filter this data, and only get a specific range. For example, let’s only get the waypoints on a specific date. We can use the start_date and end_date parameters to put limits:

Filter the waypoints for a specific date:

https://api.dv8.line72.net/route/21/trip/699/waypoints?start_date=2017-09-05&end_date=2017-09-06

On this date, this trip was an Outbound (0) trip. It left Central Station at 11:45:00 AM and arrived at Eastwood Mall on time at 12:21:00 PM.

We have samples every 30 seconds of this trip. Using that, we could calculated the average on time performance or visualize the number of passengers on the bus. You can take this json data and convert it to CSV using a simple converter tool. You can then import your CSV into a spreadsheet program, like Excel or LibreOffice Calc and create visualizations.

For full documentation on the API including all the routes, parameters, and data types, a Swagger file is available. You can also view the documentation online.

Source Code

Th API was written in PHP using the SLIM framework. The source code is available on my dv8-api-server github project.

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 Transit Maps

Code For Birmingham has been working towards making transit it Birmingham, AL more accessible. Part of this has been a push on how we can make transit easier for first time riders. A lot of our focus is centered around using technology, from real time tracking to buying bus passes directly on your phone. But we need to not forget the most basic thing every rider looks at: timetables and maps!

 

Several graphic designers along with GIS experts from Code For Birmingham, have been coming of with some mock-ups of both new maps and new timetable fliers.

This is the existing timetable for the #1 route to Bessemer. I have found this to be cluttered and difficult to read.

1-SO-Bessemer-1

Below is our version of the #1 timetable. The data is the same (this is a mock-up so times weren’t filled in), but we’ve tried to make it easier to read. The locations are clearer and show up directly on the map, as you’ll see below. Instead of using words like Inbound and Outgoing, we are more focused on the starting points and destinations.

route1-timetable

And this is the existing map for the #1 route to Bessemer. Even as someone who is very familiar with this area, I find this map very difficult to read. It is missing all points of reference, distances aren’t accurate, and it isn’t clear that North is not pointing up.

1-SO-Bessemer-2

This is our version of the map. We’ve overlayed the route directly on top of a street map, so areas of the city are much more clear. We also have insets to highlight the important detailed areas, like downtown Birmingham and downtown Bessemer. Location points are clearly labeled and correspond with the time points in the time table. We also have the large “subway style” stop map on the right, with times when the bus runs, frequency, and key stops, so that a user can quickly glance at it and have a basic understanding of the bus route.

route1-map

These time tables and maps above are meant to be fliers given out about the route. But Birmingham is finally in the process of removing a city ordinance that banned any information from being displayed at bus stops (I know crazy, right?). With this ordinance being removed, the BJCTA will finally be able to post route maps and information at stops and shelters. With this in mind, Code for Birmingham starting looking at what information would be useful.

 

While in Paris earlier this year, I noticed the maps they had at their bus stops. An example of the 69 line is shown below.

photo

I found these maps very useful. I tend to be someone who walks in random directions in a city, so I often find myself slightly lost. So when I came to a bus stop that had this map, I was immediately able to tell where I was in the city, what my orientation was, what was nearby, and most importantly, what transit options I had at this location. I was without data on my phone, so it was interesting to get around by bus without having a smart phone to immediately look routes up or get real time trip planning. If I didn’t plan out a route before I left, I would have been pretty lost. But I found I was able to look at any one of these maps and immediately understand the route and availability.

 

So based on this, I have recreated a short route in Birmingham, the #12. I am not a graphic designer, so I know this could use a lot of work, but I want to just focus on the concept for a minute.

Route12_StopsMap

I am hoping we will be able to create versions of this for every route, at every stop. Not only will this be useful for existing riders, but I think pedestrians will use them for wayfinding. It will help advertise and market the system, and hopefully, a potential bus rider will see how easy the system is, and use public transit.