The East Bay Transit Riders Union recently sent out a letter indicated that they wanted to create a visualization like the one shared below. The visualization appears to show existing transit service and then what it would look like if there was a 40% budget increase. They appear to want to do it for AC Transit instead of the example locations that TransitCenter did it for.
Here's what that could look like in Atlanta. Today many routes run sporadically and don't provide good mobility (they don't show up in the "before" map).— TransitCenter (@TransitCenter) January 27, 2021
Increasing service 40% enables many of those routes to run much more frequently, expanding where people can reach on transit. pic.twitter.com/5WubdsEfPP
The methodology for the above was shared here. I have also copy and pasted it below:
We can model this same sort of methdology with just the raw GTFS and (I think) generate a comparable result. I’ve posted the visual results of this effort on Twitter in response as well (shown below). The remainder of this post outlines my version of the stated approach to estimate what the new 15-minute headway map would for a given service provider (in this case, AC Transit) if they were to increase their budget by 40%.
Saw in @TransitRidersEB meeting recap email they wanted to see what weekday @rideact 15-min headway service would look like w/ a 40% budget increase.— Kuan Butts (@buttsmeister) February 23, 2021
I took a stab at estimating this myself. Resulting current and projected images below.
Methodology: https://t.co/mEUlVVl8ku pic.twitter.com/ciL3vvK2tn
My version of the workflow
Generating the existing system is pretty straightforward manipulation of the GTFS. I pulled AC Transit’s latest GTFS and got a representative “busiest day” service schedule from the feed (which was Jan 19, 2021, a Tuesday).
To better calculate headways, I expanded the window of time evaluation from 12 noon exactly to the 2 hour window around it (11 AM to 1 PM). I was then able to calculate headways for all routes in the system that were running on the schedule for that representative day. This satisfies all steps up through and including #4 in the above steps.
I was able to accomplish line 5-7 by modeling the “budget” by costing each route. For each route I would look at the associated trips and get the average cost in terms of minutes to run a bus along that route. I could use this to estimate how many minutes it would cost to add a new line on that route.
I could then estimate what a 40% increase in the budget would look like by doing the following steps:
- Calculate all trips running in time window
- Get routes associated with each trip
- Estimate the average total cost to run a trip per route on average
- Sum that average cost for each route times the number of trips running in the window
- Divide the window by hours to get the average time in minutes being expended during this window
- Increase that amount by 40 percent, this is the new allotted time
- Go through remaining routes not hitting the 40 and add 2 new trips per route until each does (2 because need to be round trip)
Walkthrough of code
Full code and example outputs are hosted on this gist for future reference.
Load in the data
Use partridge to read in the data and get representative date and schedule:
Estimate a headway per route
Iterate through each route in the timeframe and get all trips associated with route. Get headways between trips for each stop and use those figures to estimate an average headway. Added a limit of 15.5 minutes to give estimates some wiggle room.
Determine qualifying routes
At this point we can create a lookup from results of what qualifies as a 15 minute headway route already and thus routes we do not need to expend new budget on in terms of adding new service.
Determine existing budget and new budget in minutes
In order to calculate budget let’s first look at existing service in terms of trips and average cost in time per trip and route.
We can now produce stats about how many more minutes or hours we have to work with, with new budget:
Costing remaining routes for 15-minute headways
For all remaining routes we can come up with what it would cost in terms of minutes to get them to have a 15 minute headway.
From such results we can now select the “new routes” that would get upgraded with the budget increase.
Outputting as shapes
Final step is just to export these as GeoJSONs to share graphically.