The question
Under a M7.0 Hayward Fault earthquake, which San Francisco soft-story buildings face the worst shaking and ground failure, and how many still haven't been retrofitted?
A soft-story building has a weak ground floor, usually garages or storefronts with big openings and few walls, under floors of apartments. In an earthquake that ground floor can rack sideways and collapse. That's what happened to apartment buildings in the Marina in 1989. Since 2013, San Francisco has required wood-frame soft-story buildings with five or more units, built before 1978, to be retrofitted.
The earthquake here is the USGS HayWired scenario, a magnitude 7.05 rupture of the Hayward Fault starting under Oakland (the ★ on the map). It's one plausible earthquake that emergency planners across the Bay Area use. It isn't a forecast.
Key findings
The retrofit program has mostly worked. – of the list has finished, which leaves – buildings with about – residents.
The unfinished ones aren't concentrated where the shaking is worst. – of buildings at MMI 7 or higher are unretrofitted, compared with – everywhere else. They're a little more common on liquefiable ground, at – inside the liquefaction zones and – outside.
Two kinds of neighborhood rise to the top. The Marina, the Mission and South of Market are there because of bad ground: old bay and lagoon fill that can liquefy. The Castro, Hayes Valley and the Haight are there because the scenario's shaking runs strongest through the middle of the city.
Using the map
Each dot is a soft-story building. Zoom in past street level and the dots turn into building outlines. Click either one for its details: address, tier, year built, units, the shaking it would get, whether it's on liquefiable or landslide-prone ground, and its risk score with a breakdown of what drove it.
The search box finds soft-story buildings by address. It only searches the city's soft-story list, so an address that isn't on the list won't come up. Pick a match and the map zooms to it and opens its details.
The side panel has headline numbers, two filters (only buildings that aren't retrofitted, and only the top 20% by score), switches for each hazard layer, and a neighborhood shading menu. The table under it lists the top ten neighborhoods for whatever you're shading by, and clicking a name zooms there. With shading off, the table ranks neighborhoods by units in top-20% buildings.
Clicking empty ground with the shaking layer on shows that ShakeMap cell's values. The page address updates as you move, so you can copy it to share the exact view. On a phone the panel sits at the bottom, and ▾ collapses it.
Reading the colors
Buildings
- Fill color is the risk score, from pale (below 0.3) to dark red (0.6 and up). The top 20% starts at a score of –.
- A black ring means the building hasn't been retrofitted. Those dots are also drawn bigger. Retrofitted buildings have no ring.
Hazard layers
- Purple squares are the ShakeMap cells, shaded by intensity (MMI): lightest below 6, darkest at 7.5 and above. Each square is one cell, and every building inside it gets the same shaking.
- Blue hatching is a California Geological Survey liquefaction zone, where the ground could turn to slurry in strong shaking.
- Brown hatching is a CGS landslide zone.
- Dashed lines are faults that have moved in roughly the last 15,000 years. The Hayward Fault runs along the East Bay hills, and the San Andreas runs just offshore of the city's west side.
With neighborhood shading on, neighborhoods are tinted blue by the measure you chose. Darker means more.
The data
Everything comes from public sources.
| Dataset | Publisher | How it's used |
|---|---|---|
| Soft-Story Properties DataSF beah-shgi, Oct 2026 | SF Dept. of Building Inspection | The list of buildings, with tier and retrofit status. |
| Assessor tax rolls DataSF wv5m-vpq2, 2020 to 2025 | SF Assessor-Recorder | Year built, units, stories and building class. |
| Parcels, active and retired DataSF acdm-wktn | SF Public Works | Links buildings that became condos back to their unit lots. |
| Building Footprints DataSF ynuv-fyni | DataSF | Building outlines, used for sampling and on the map. |
| HayWired ShakeMap USGS ushaywiredm7.05_se, v33 | USGS | Shaking intensity and ground motion for every building. |
| HayWired liquefaction probability USGS data release, Jones 2019 | USGS | Chance the ground liquefies in this scenario. |
| Seismic Hazard Zones liquefaction and landslide | California Geological Survey | Whether a building is on liquefiable or landslide-prone ground. |
| Quaternary Fault and Fold Database | USGS | Fault lines, shown for context. |
| Census tracts, ACS 2024 5-year | US Census Bureau | Average renter household size, to estimate residents. |
| Analysis Neighborhoods DataSF j2bu-swwd | DataSF | Neighborhood totals and shading. |
How I calculated it
I put every dataset into NAD83(2011) San Francisco CS13 (EPSG:7131), a projection built for the city, so distances and areas are as accurate as they get here. Then I matched each soft-story building to its tax lot. About 6% of the buildings are now condos, split into one tax lot per unit, and some of their original lot numbers have been retired. For those, I go through the city's parcel map to find the unit lots and add their units back up. That gets all but one building matched to the current tax roll, and the last one is in the 2022 roll.
Each building gets the ShakeMap values for the cell its footprint sits in. A building counts as in a liquefaction or landslide zone if any part of its footprint touches one. For the HayWired liquefaction probability, it gets the highest class its footprint touches.
Estimated residents are the building's units times the average renter household size in its census tract. Nearly all soft-story buildings are rentals. This assumes every unit is occupied, so it runs a little high.
The risk score
The score combines four things, each scaled from 0 to 1, into a weighted average. It's a way to rank buildings by how many hazard and vulnerability factors stack up. It isn't a damage estimate, and a high score doesn't mean a building will fail.
| Part | Weight | How it's scored |
|---|---|---|
| Shaking | 0.30 | MMI in half-point bins: below 6 scores 0, 7.0 to 7.5 scores 0.75, 7.5 and up scores 1 |
| Ground failure | 0.25 | 1 in a CGS liquefaction or landslide zone. Otherwise the HayWired liquefaction probability, where 25% or more scores 1 |
| Vulnerability | 0.20 | Program tier, age (older scores higher) and number of units, averaged |
| Not retrofitted | 0.25 | 1 if the retrofit isn't finished, 0 if it is |
The building popup shows each part as a bar, so you can see why a building ranks where it does.
I reran the score five other ways to check how much the weights matter. Shifting the weights around barely
changes the order (rank correlation 0.97 or higher). Swapping MMI for 0.3-second spectral acceleration changes it
the most (0.77). The full comparison is in the project's docs/methodology.md.
Why the shaking looks blocky
The ShakeMap is a grid of cells about 1.5 km wide and 1.85 km tall. All of the city's soft-story buildings fall in just – of them, and every building in a cell gets the same shaking. I show the cells as squares instead of smoothing them, because smoothing would suggest detail the data doesn't have.
You might expect the bay fill in the Marina or Mission Bay to shake harder than the bedrock hills. In this ShakeMap it doesn't. Its rock-site and local-soil versions are identical over the city, so it doesn't model local soil effects at all. In this analysis, fill shows up through the liquefaction layers instead. The strongest cells actually run through the middle of the city and along its southwest edge.
Glossary
- Soft-story building
- A building whose ground floor is much weaker than the floors above, usually because it's mostly garage doors or shop windows. San Francisco's program covers wood-frame ones with five or more units, built before 1978.
- Tier
- The city's compliance group, which set each building's deadline. Tier 1 has schools, assembly and care uses. Tier 2 is 15 or more units. Tier 4 has ground-floor commercial space or sits in a liquefaction zone. Tier 3 is everything else. Tier 4 was the last to come due, in September 2021.
- Retrofit status
- "Retrofitted" means the city issued a certificate of final completion (CFC). "Non-compliant" is a program status for a building that hasn't finished. "Newly added" buildings are recent additions to the list. I count both of those as not retrofitted.
- HayWired scenario
- A USGS-led planning scenario for a magnitude 7.05 earthquake on the Hayward Fault, centered under Oakland, with the hazards and consequences worked out in detail.
- ShakeMap
- The USGS product that maps how hard the ground shakes in an earthquake, as a grid of values.
- MMI (Modified Mercalli Intensity)
- Shaking on a I to X scale based on its effects. VI is strong (felt by everyone, some damage to weak buildings). VII is very strong (considerable damage to poorly built structures). VIII is severe.
- PGA (peak ground acceleration)
- The strongest acceleration of the ground, as a percent of gravity (% g).
- PGV (peak ground velocity)
- The fastest the ground moves, in centimeters per second.
- PSA 0.3 s (spectral acceleration)
- How hard a building that sways back and forth every 0.3 seconds gets pushed, in % g. That's roughly the natural period of a short wood-frame building.
- Liquefaction
- When strong shaking makes loose, wet, sandy ground act like a liquid. Buildings on it can sink or tilt. It's most common on artificial fill and old marsh and creek beds.
- CGS Seismic Hazard Zones
- Liquefaction and landslide zones mapped by the California Geological Survey under the Seismic Hazards Mapping Act. They mark where a site investigation is required before building, not where the ground will definitely fail.
- Liquefaction probability
- From the HayWired study: the chance a spot liquefies in this particular earthquake. Most of SF's fill falls in the 20 to 25% class.
- Active fault
- Here, a fault the USGS Quaternary Fault and Fold Database lists as moving historically or in roughly the last 15,000 years.
- Risk score
- This project's 0 to 1 index of shaking, ground failure, vulnerability and retrofit status. See The risk score.
- Top 20%
- The fifth of soft-story buildings with the highest risk scores.
- Condo conversion
- When an apartment building's single tax lot is split into one lot per unit. The building's original lot number is retired, which is why some buildings need extra matching.
- Analysis Neighborhood
- One of 41 neighborhoods DataSF uses for reporting.
Limitations
HayWired is one earthquake. A San Andreas earthquake would hit the city's west side much harder, and the San Andreas is closer to San Francisco than the Hayward.
The ShakeMap is coarse and doesn't model local soil, so shaking differences between buildings mostly come down to which cell they're in.
The soft-story list covers one building type. Other vulnerable buildings, like older concrete and unreinforced masonry, aren't on it.
The score is an index for ranking. The weights are judgment calls, and changing the shaking measure changes the ranking more than changing the weights does.
Retrofit status is a snapshot of the city's list as of October 2026. Assessor year built can reflect remodels, and resident counts are estimates.
And to be clear, this isn't an engineering assessment of any building. For that, talk to a licensed structural engineer.
Reproducing it
The pipeline is Python (GeoPandas, Shapely, rasterio, rasterstats) and runs end to end in about a minute after a one-time download. The code is on GitHub.
make setup download
make pipeline # ingest → join → sample hazards → score → summarize → web data
make test
The data inventory, method, sensitivity check and findings are in the project's docs/ folder.