Ann Arbor Bus Speed

The Ann Arbor Area Transportation Authority (AAATA) has an API that developers can use to get data primarily for transit apps. I used it to try to track the bus speed at points along the route. I wanted to see if there were spots that were significantly faster or slower than average.
I wrote a PowerShell script to get this data from the API. I used the Start-Job cmdlet to run a background process. It would get the list of buses on the route, then for each one, get the speed, latitude, and longitude and write it to a CSV file. When it started, there would be some buses that were partway through the route. The script only wrote to the CSV if it wasn’t one of those first ones. That way, there would be a complete record of the route from start to finish. As it turned out, the data only updated every 20 seconds. This is fine for someone who’s wondering when the bus will get to their stop, but for me, it was pretty slow. I put in a 20 second wait on my script, but there were still some repeated values.

1.PNG

This is for Route 66. Yes, that’s the actual route number. Over the whole route, there were 272 data points.

2.png

You can’t tell much from the height of the columns, so we’ll try the heat map.

3

The data is pretty splotchy so there’s not much we can determine. Maybe Huron Parkway in the middle is a faster spot than others? To attempt to fix the problem, I collected data on 21 trips which gave me 14,931 data points.

4.png

5

It does seem like the fastest part is in the middle, on the North- South stretch. There aren’t any stoplights along there. On the other hand, the North-South stretch at the end has a lot of stop and go due to all the stoplights.

Here’s a more detailed view of North Campus.

6.png

I also did this for Route 4, which is AAATA’s busiest route. I collected 7,815 data points on 19 trips.

8.png

You can tell that it’s slower around downtown Ann Arbor and the fastest part is on the left, more diagonal portion of Washtenaw Avenue.

A view of the Ypsilanti side:

9

If you want to gather data yourself, you’ll have to request an API key from developers@theride.org.

Leave a Reply

Your email address will not be published. Required fields are marked *