SFMuni-Delays

Measuring SF Muni Frequencies as Ridership increases post COVID19 Restrictions

View the Project on GitHub Leyla-Wah/SFMuni-Delays

Measuring San Francisco’s Muni Bus Line Frequencies as Ridership Expands

San Francisco’s Muni bus lines have been in flux for the past two or more years due to the repercussions and restrictions of COVID-19. As ridership has been steadily increasing, riding the bus during peak commuting hours has proved that popular bus lines experience delays, crowding, and congestion- similar to what it was like riding the bus pre-pandemic. This project aims to look at what has been observed for those recently riding the bus and look at the muni system as a whole to see which bus lines are experiencing the most delays as bus frequency and schedules have changed. In this exercise, I analyze and visualize SFMTA ridership data, SFMTA Muni route data, static GTFS data from the year 2019 to 2022. In looking at this time period, we will be able to see conditions of riding the bus pre-pandemic, when ridership and bus frequency was at a high while setting a baseline, to what it was like riding the bus during the height of the pandemic, and to now. In doing so, we hope to understand how the Muni bus network could alleviate some of its delays and congestion on popular lines.

Background

My motivation for this project was to further understand what I have been experiencing on my commute by utilizing the python skills I have learned in the past year. As I have been commuting from San Francisco to Berkeley during peak hours on the weekdays, my normal route is taking the 38 or 38 Rapid from my home to Powell street, where I then get off and walk over to the Powell BART station and transfer to rail. I observed a stark difference from my commute in 2021 to 2022, starting around February to March of this year, and was shocked by the crowding I was seeing, which I documented through photos of what I was experiencing.

IMG_1456 IMG_0830 IMG_1459 IMG_1768

Photos taken February 1st, 2022 and March 16th, 2022.

It can be seen that there is little to no standing room on the bus during peak hours, where a rider may have to wait another 10 minutes for the next bus to arrive since there is no room on the bus that had just passed. Having this kind of crowding adds to delays- the bus idles for up to 3 minutes as the chaotic dance of people getting on and off the bus at each stop culminates to a point of stress. Social distancing is not a thing on peak commuter buses, where people are squeezing onto the bus and preventing the doors from closing, all while triggering the sensors to repeat the phrase “stand clear of the door.”

Through reading news articles from local papers, it was clear that major employers in the central business district (CBD) were having their employees return back to the offices to some capacity in 2022- making bus lines like the 38 crowded with bringing people from residential parts of San Francisco to the CBD. (https://www.sfchronicle.com/sf/article/Mayor-Breed-wants-office-workers-to-return-to-San-16948733.php)

It is important to have a grasp on how the SFMTA Muni bus system adapted during the height of COVID-19 and now how they are trying to gain more of a sense of normalcy. In April 2020, during the height of the covid 19 pandemic- SFMTA had cut 51 of 68 bus lines in the city, leaving 17 in operation due to the stark decrease in ridership. Since then they have restored service and are now operating 51 bus routes, which include new service lines and adjusted frequencies of existing routes. Muni is expected to be running at 85% capacity of pre-pandemic levels this year, but reported ridership does not seemingly match. To understand ridership, I took SFMTA ridership data and constructed the figure below. (https://www.sfchronicle.com/sf/article/S-F-Muni-changes-are-coming-in-August-Here-s-16330618.php)

Ridership_line Data Source: https://www.sfmta.com/reports/muni-ridership-average-weekday-ridership

Pre-pandemic in 2019, Muni was seeing an average weekday ridership of 764,954, and currently, in 2022, they are seeing an average weekday ridership of 349,150 on their routes.

In public comment, the SFMTA addressed recent delays in Muni due to not having enough drivers, as some drivers have called out sick and so forth. When it came to adjusted frequency and routes of lines, SFMTA has experienced a loss of revenue due to the massive decrease in ridership during the peaks of COVID-19. Operating at full capacity pre-COVID19 is not an option for the agency at this point. (https://www.sfchronicle.com/sf/article/Delays-expected-on-more-than-20-S-F-Muni-lines-16822301.php)

Research Questions

Methodology

To understand which bus lines are experiencing the most delays, I utilize two different Python packages that digest GTFS data to showcase how routes have changed over time, along with visualizing the frequency of buses in the Muni system. The packages are Partridge and GTFS_Functions.

First, I used Partridge to visualize the expanse of the Muni system from 2019 to 2022. In the attached figures below it can be visually seen that more bus lines running east to west in the downtown area in 2019 compared to now. From this, it can be inferred that riders are now crowding the bus lines that are in service within the area and having fewer bus options than they once did.

2019_GTFS 2020_GTFS 2021_GTFS 2022_GTFS Data Source: https://transitfeeds.com/p/sfmta/60?p=1

The red dots in the above images pinpoint a popular bus stop along the 38 and 38R bus routes. The Geary Street and Powell Street bus stop is in close proximity to the BART and is utilized as a transfer stop between the two modes. Riders will also take this stop from downtown San Francisco to more residential areas. To further explore the data, I wanted to see how frequent buses arrive at this stop during prime commuting hours over a 2 hour period in the afternoon. The below screenshots are output from a code that precisely does that to the static GTFS data using Partridge.

2019_Freq 2020_Freq 2021_Freq 2022_Freq Data Source: https://transitfeeds.com/p/sfmta/60?p=1

I zoomed out of looking at the frequency of one bus route and explored the frequency of bus routes in the whole Muni system using GTFS_Functions built-in mapping capabilities that interactively show you which bus routes have a frequency of 5 minutes or less (represented in yellow), and which are between 5 to 10 minutes (represented in cyan), and which take longer that 10 minutes (represented in blue). In looking between 2019 and 2022, we can see more frequent buses in 2019 than in 2022. In using GTFS_Functions one can hover their mouse along the output maps below and see the name of the colored line that corresponds with it’s set bin of frequency.

Route_freq_2019 Data Source: https://transitfeeds.com/p/sfmta/60?p=1

Route_freq_2022 Data Source: https://www.sfmta.com/reports/gtfs-transit-data

Key Findings

Through these key findings, it is clear that COVID-19 pummelled transit ridership in San Francisco. As bus routes and frequencies have changed to accomodate the decrease in ridership during the pandemic, the current city’s bus network needs to be reaccessed to accomodate the crowding documented on popular lines. By increasing rapid bus service and isolating which bus lines are gaining ridership by the closing of others, the muni network can be optimized. Next steps in this project is to measure real time delays of these bus routes to see if the static GTFS frequency is accurate.