Bike every street in San Francisco

Every street in San Francisco

1,058 miles of city.
1,629.7 miles of riding.

I wanted to ride every rideable street in San Francisco, so I solved the route rather than guessed it. Forty-four rides, cut from one continuous circuit, with every hill measured. You can download the lot and take any one of them.

Download all 44 rides GPX · loads on any phone or head unit

The numbers

A quarter of it has to be ridden twice

A route that repeats nothing exists only if every intersection has an even number of streets. 5,268 of San Francisco’s 9,384 intersections are odd, so some streets must be covered twice — and choosing which is the whole problem.

1,057.8 MI
every rideable street, counted once

15,410 segments between 9,384 real intersections, pulled from OpenStreetMap and filtered to what you’d actually ride.

262.4 MI
24.8% unavoidable repeats

The minimum second pass, from matching up those odd intersections. A bound, not a proof — exact matching at this size will not finish.

309.5 MI
23% getting there and back

Riding out to where each day’s coverage starts, 44 times, and home again. This is now built into every downloaded file — each one begins and ends at my front door.

179,014 FT CLIMB
6.2× Everest110 ft/mi

Door to door, measured at all 9,384 intersections from USGS 3DEP. The covering route alone is 139,036 ft; getting to and from it adds the rest.

At two rides a week that’s 5.1 months. My own guess before doing the maths was about 1,600 miles, which turned out to be within half a percent — and completely uninformative about the part that matters.

The finding

“A 30-mile ride” is not one thing

All 44 rides cover the same distance. Their climbing ranges from 1,091 to 4,848 feet — a 4.4× spread. Ride 12 and ride 28 are not the same afternoon, and calling them both “a 30-mile ride” hides the only number that decides how the day goes.

Door to door they aren’t even the same distance. The route was cut into contiguous slices, so each one starts where the last finished — a mean of 2.8 miles from my flat, worst 5.3. With the ride out and the ride home included, the files run 30.3 to 43.4 miles.

The map below shows all 44 at once; hover one to pull it out.

I did try cutting the circuit into equal effort instead. It compresses the climb spread from 4.4× to 1.5× — and blows the distances out to 17.5 to 57.1 miles. A 57-mile flat day isn’t the same effort as a 17.5-mile climb once daylight and saddle time are real. The tidier answer was the worse one, so the rides stayed at 30 miles and the climb column does the work.

The coverage

Every street in the city, in 44 afternoons

This is the whole route drawn at once. Hover any line, or any ride below, to pull that day out of the tangle.

Every file starts and ends at my front door, so the distances include getting there and back. Tiles are shaded by climbing per mile. Ride 28 is the gentlest at 1,596 ft over 36.0 miles; ride 12 is the worst at 6,104 ft over 40.5.

What this model gets wrong

Three things worth knowing before you load one

One-way streets are ignored

Every street is treated as rideable in both directions, which is right for “have I been down it” and wrong at a few junctions. Expect to dismount occasionally. This is the caveat most likely to annoy you.

3.9 miles were dropped

Disconnected fragments — Treasure Island approaches and similar — that no continuous route can reach. So “every street” means every street in the connected network.

The repeat figure is an upper bound

Optimal matching over 5,268 odd intersections is O(V³) and won’t finish. This is greedy plus 2-opt, which found no improvement — so it’s near a local optimum, and the true minimum is a little lower than 262.4 miles.

Is the climb real?

Ignoring rises under a metre removes only 3% of it, and under two metres 8% — noise would collapse under that. The highest intersection comes out at 261 m against Twin Peaks’ 281 m summit, and Ocean Beach at zero.

Come along

Take a ride number

Ride 28 is the gentlest: 36.0 miles and 1,596 feet. Ride 12 is the worst: 40.5 miles and 6,104. Everything else is in between, and I have to do all of them eventually.

Prefer to run? There are measured routes for that, or lift instead.