THE REGEX KING

jeff sisson's blog (email me)

Big Boy Bike Directions

26 May 2023

I’m convinced that there is a perfect bike route between any two points in New York City. When you ride the same way over and over, these perfect routes kind of just reveal themselves naturally. You randomly encounter and memorize which streets have the best timed signals, the fewest double parkers, the roomiest shoulders.

It’s harder to find a perfect route when you’re going somewhere you’ve never biked before. Most corporate transit apps happily give you bike directions, but the routes they recommend are sometimes bad. I’ve always wanted bike directions app that felt like a friend’s inner monologue of their preferred route, and I built Big Boy Bike Directions to scratch this itch.

Costing

Big Boy Bike Directions modifies the excellent open source routing software Valhalla, tweaking its bike directions algorithm to suit my needs. Valhalla’s core metaphor is the idea of “costing”: every street segment or intersection is assigned a number called a cost. A cost will always include the time it takes to bike a given distance, but may also reflect other factors like the available bike infrastructure or the speed limit. Compute the sequence of streets with the lowest cost and you’ve found your bike route.

Big Boy Bike Directions exposes all of the street-level factors that determine a street segment’s cost as knobs that you can tune to your biking preferences. Here are some of the specific costing factors that are made prominent in Big Boy Bike Directions to help suggest routes that match how you like to bike:

One-way streets

one way street knob

I always prefer taking a single lane one-way street, where one is available in my direction of travel. Cars behave a tiny bit more predictably on a one way street because there’s only one way everyone can go. The “One Way Streets” knob exposes this as a preference.

Separated bike paths

bike path knob

I can’t stand riding in traffic with cars, and will go out of my way to avoid it if there are grade-separated bike paths available. But corporate bike directions apps don’t always seem to make this distinction, or if they do it sometimes seems to be superseded by a preference for shorter distances. The “Separated bike paths” knob will treat bike lanes that are physically separated from car traffic in a class above other types of bike infrastructure. Dialing up this knob to the max will produce bike routes that are sometimes less efficient, but always more relaxing.

Avoiding cars

avoid cars knob

Valhalla’s routing already included in a use_roads factor that I’m calling “cars: hate em / love em”. It accentuates the costing difference between low-intensity and high-intensity streets when you dial up the knob. I’m actually not sure why anyone wouldn’t want to avoid cars always, but I’ve left this as a knob because there are some high speed bike freaks out there and Big Boy Bike Directions respects the reality that we all take some flavor of calculated risk every day.

Bus lanes

Sometime in the 2010’s, Giovanni passed along some street wisdom I’ve never forgotten: the painted Dean Street bike lane always seems like it’s the optimal east-west bike route in the Atlantic Ave. corridor, but it’s actually stressful to bike on because it overlaps with the B65 bus route and bus drivers have to weave in and out of traffic as they make their stops. The nearby St. Marks Ave, which has no bike lane but is quite wide, is much more relaxing to bike on by comparison.

Big Boy Bike directions uses bus route data to impose an additional penalty to bus routes, comparable to designated truck routes.

Avoided roads

Sometimes you just don’t want to bike on a particular street, for rational or irrational reasons. I’d be content if I never biked on the Greenpoint Avenue bridge over Newtown Creek again — I can’t stand riding alongside the trucks!

Big Boy Bike Directions has an “Avoided Roads” feature that allows you to eliminate specific road segments like these from consideration in bike routing by drawing them on the map. Its directions will always avoid those street segments afterwards.

avoided streets

I'm content to take hugely roundabout routes like this one to avoid streets like the Greenpoint Avenue bridge I don't like to bike on.

It’s not worldwide and it runs on one of my computers

I’ve built Big Boy Bike Directions for the long haul. In particular, I’m running Valhalla for routing, and hosting Protomaps tiles for vector tile rendering. I had to stop myself from building a DIY geocoder for the time being, and asked the kind folks at Geocode Earth for help with an API key.

Because of these and other constraints, Big Boy Bike Directions intentionally only works in a handful of cities where I know people who bike: New York City, Minneapolis, Santa Cruz, and Providence for now. But I’m very interested in hearing from anyone who uses this to bike, and open to adding other cities. Email me if you use it, find any bugs, or discover relaxing bike routes!

  • Jeff Sisson on : I made my own commenting system and am testing it out here for the first time...pardon the appearance...

Write a comment...