
New and improved bike routing, with low stress options - mxfh
https://mapzen.com/blog/low-stress-bike-routing/
======
boxcardavin
Riding an ebike has dramatically changed the routes I take when commuting
because I now prioritize safety and enjoyment over pure efficiency or avoiding
inclines. My commute is 25 minutes on an ebike vs 70 on a regular bike, or 30
in a car in traffic.

~~~
OstrichGlue
Can I ask what ebike you use?

~~~
awjr
Buying an eBike is a lot about choosing the motor you want then hunting down a
bike that uses the motor. I would strongly suggest that you buy from your
local bike shop and buy the brand that the bike shop normally stocks.

My pick was the Brose mid-drive motor available in Tour 50nm/City 75nm/MTB
90nm models. I then bought an ex-demo one off model from a localish bike shop.
[https://www.ebike-manufaktur.com/en/e-bikes/11lf-shimano-
deo...](https://www.ebike-manufaktur.com/en/e-bikes/11lf-shimano-deore-
xt-10-gang)

Problem with battery meant it took 11 weeks to get it back on the road as the
shop did not have a relationship with the bike manufacturer.

The bike however is phenomenal. I weigh 130kg and it takes me up ANY hill in
Bath. There's a couple of 1 in 3s that I can cycle up one handed.

~~~
switch007
What makes it worth 3100 EUR?? That's seems a lot of money even for an
electric bike. (I'm guessing your ex-demo was a bit cheaper)

~~~
awjr
Cost me £1700 (about €2000). High-end Mid-drive motors pushing 75nm+ are
expensive. Bosch Pro CX line and Shimano Steps are the other two types
available. If you start looking around, you see the cheaper mid-drive, i.e.
Bosch Active Line starting around £2000 and are suitable for lighter people.
The high end motors are usually combined with high end parts and bigger
batteries. Thus you end up with bikes costing between 3-4k.

It's saved me an absolute fortune. In fact after owning it for a month, my
wife wrote off my car. We just took the insurance money and didn't buy another
car going down to a one car family.

~~~
hycaria
Interesting. How do you keep it from getting stolen ?

~~~
awjr
Electric bikes are not as easy to take apart and sell on. (I'm sure I'll be
proved wrong.)

I have a gold standard D-Lock that is side mounted on the frame (weight not an
issue) that I use when parking up. There is also a dutch style rear wheel lock
mounted to the frame I also use. The battery has a key that keeps it locked to
the frame. The head unit for the eBike display is removable and I take that
with me whenever I leave it locked up making the motor unusable.

Basically you're trying to steal a 25kg (55lb) bike with multiple security
features and relatively unique electric parts that people would be wary of
buying due to lack of guarantees.

Sometimes if I'm popping into a shop/café, I use the bike stand, lock using
the dutch lock, and just take the head unit off. I'm guessing somebody could
pull up in a van and just lift the bike but the opportunistic 'snatch' is so
not going to get very far.

------
dfrey
It's an interesting problem because there are so many factors and even the
goal isn't constant from day to day.

Goals

\- get from A to B as quickly as possible

\- get from A to B as safely as possible

\- get from A to B as enjoyably as possible

Factors

\- fitness of rider

\- type of bike (Riding a fixed gear bike up a steep hill is bad for
enjoyment, but riding a mountain bike up a steep hill is not)

\- weather (headwinds, tailwinds affect time, affects safety of certain routes
as well - don't tell me to ride down a steep windy hill when there is a
possibility of ice)

\- time of day (affects safety due to light levels)

\- traffic volume

\- number of lights/stop signs (this affects fast riders more than slow ones
because of the effort wasted accelerating and braking is greater)

\- number of turns (turns make the rider slow down and wait for traffic and
also increase the complexity of following a route)

\- scenery/environmental factors (eg. ride through an industrial area or
through a waterfront park)

~~~
konschubert
And it's also not said that all these factors have a linear impact on the
Figure of Merit. I guess that this might be a nice application for a machine
learning classifier, to rate a route's ride quality depending on all of these
inputs (and more.)

------
rconti
NB: "Hybrid" bike in this context (probably) means a city/commuter bike, not
an electric/human hybrid. "Hybrid" bikes used to describe upright bicycles
with flat handlebars like a mountain bike, but less aggressive and narrower
tires more suited to commuting than to trails. These days the industry is
calling them "fitness bikes"; one presumes to avoid confusing people who think
of "hybrid" as meaning battery-powered, eg in the automotive context.

~~~
icebraining
Decathlon (one of largest sports retailers in Europe) still calls them Hybrid
bikes.

~~~
rconti
Sorry, I did not clarify, this has been my experience in bike shops in the US
in the past few months (I had not previously looked at bicycles in some time).

------
arikr
Wonderful. I'd really like these same features in Waze and Google Maps - if it
means I can avoid having to cross a busy intersection that's not a 4-way stop,
and reduce stress and increase safety, I'd gladly accept a route that's a few
minutes slower.

Anyone from Waze or Google Maps team here?

~~~
jschwartzi
Yeah, this is a serious problem with Google Maps directions. They want to send
cyclists down the fastest routes, which are usually the least safe routes.
There's a route in Kent, WA that Google was recommending that was downhill on
a 45 MPH two-lane street with no shoulder or dividers. Meanwhile, about a mile
further south there was this safe, car-free route that wound through
residential subdivisions.

~~~
rwmj
Not just for cyclists. Around here Google Maps will find "shortcuts" through
single track back country roads which are especially dangerous in winter by
car or bike.

~~~
maxerickson
They will respond to feedback about such roads not being suitable for general
traffic.

If you are in the US the data problem is likely an artifact of TIGER which has
hundreds or thousands of miles of roads that are given a single generic class
which ends up being pretty unreliable outside of developed areas.

~~~
seanp2k2
Even in the Bay Area, it's not hard to get GMaps to try to e.g. route you
through a park, a fire road, a private road (the type with HOAs and nasty
signs about how they'll prosecute you if you try to drive down their precious
street).

------
abalone
I happen to know those intersections. They could have improved that wiggle
route simply by rating the intersections. I'm not sure but it looks like they
were not doing that.

The old route crossed two stop signs and did a left turn at a traffic signal.
Left turns at traffic signals really suck.

The new, proper wiggle route is two left turns and a right turn, all at stop
signs. Left turns at stop signs are not that much worse than going straight
across -- and vastly better than a traffic light. Right turns are practically
free.

So by simply rating the difficulty of intersections using a global metric, it
seems like they could have made the same wiggle improvement without getting
into rating each section of street. My point here is not that assessing things
like accomodation_factor and road_stress are useless. Rather it appears that
they've overlooked the much simpler, global improvement of rating
intersections.

~~~
zten
Only tangentially related to your post, but, two new traffic lights are being
installed on the Wiggle. Haight is getting nine new lights, two of which are
at Scott and Pierce. Maybe people will wiggle slightly differently to avoid
the left turns at the lights.

~~~
abalone
Yeah, the SFBC (SF Bike Coalition) is not super happy about those lights.
Better for the bus, which is good, but "will also cause delay for pedestrians
and bicycle riders."[1]

There's no good way to avoid them westbound, but we can be certain eastbound
wiggle traffic will start taking Page to avoid the left turn at the Haight &
Scott traffic light. And that's going to stress the notorious Scott & Page
intersection even more. They're currently adding pedestrian safety
improvements.[2] We'll see if it's enough.

Unless.. I wonder if timed bicycle signals would help make the traffic signal
routes preferable. Not sure if it would work, but that would be a dream.. just
flow through the wiggle unimpeded. I can't tell if they're considering it.

[1] [https://www.sfmta.com/projects-planning/projects/wiggle-
neig...](https://www.sfmta.com/projects-planning/projects/wiggle-neighborhood-
green-corridor)

[2]
[https://www.sfmta.com/sites/default/files/projects/2017/Wigg...](https://www.sfmta.com/sites/default/files/projects/2017/Wiggle_Fact%20SheetV3.pdf)

------
sathomasga
Is there any way to see a demo of this algorithm for a route of the user's
choosing? I'm not familiar enough with San Francisco to evaluate the
improvement mentioned in the blog. If I could try some routes in Atlanta,
however, I'd get a better sense.

~~~
maxerickson
The routing engine in general is available as an option at openstreetmap.org:

[http://www.openstreetmap.org/directions?engine=mapzen_bicycl...](http://www.openstreetmap.org/directions?engine=mapzen_bicycle&route=33.7803%2C-84.4934%3B33.7201%2C-84.4540#map=13/33.7498/-84.4749)

I checked the request, the JS powering the OSM feature isn't sending the
parameters so they are probably the 0.25 defaults there.

~~~
burritojustice
Hi! I'm with Mapzen. Yes, the default for `bicycle` are now 0.25.

If you're familiar with Leaflet, it's also pretty easy to draw routes in
mapzen.js and pass different parameters to the router -- check the bottom of
that post.

~~~
maxerickson
I would probably try to make a bookmarklet that registered a couple more
engines:

[https://github.com/openstreetmap/openstreetmap-
website/blob/...](https://github.com/openstreetmap/openstreetmap-
website/blob/3d6a3a6de33aa0c1bc436bce9ea9da33e00460ff/app/assets/javascripts/index/directions/mapzen.js)

------
schemathings
So I decided to see how to get to that nice Pho place across town .. 600
Washington Ave Philadelphia, PA 19147 or the one next door at 610 Washington
Ave Philadelphia, PA 19147 .. in both cases it truncates off the street number
and drops me at a wrong location. Does that mean OpenStreetMap needs some
assistance in that area? Even stranger if I put one of those addresses in both
source and destination it does a strange 5 block loop to get back to the same
wrong start point.

~~~
maxerickson
Yeah, address coverage and POI coverage are pretty spotty. The address would
show on osm.org if it were in the data:

[http://www.openstreetmap.org/#map=19/39.93668/-75.16656](http://www.openstreetmap.org/#map=19/39.93668/-75.16656)

~~~
aidenn0
Google seems to only have gotten the address coverage it has by sending vans
around with cameras and then making people type in the addresses for CAPTCHAs

~~~
maxerickson
There is also a lot of data that has been collected by governments:

[http://results.openaddresses.io/](http://results.openaddresses.io/)

There's a variety of reasons that such data hasn't made it to OSM (resources,
licensing issues, disagreement about how it should be integrated, disagreement
about whether it should be integrated, etc.)

------
dve
A friend has been working on a similar project for a while that allowed the
rider to tailor, in great detail, the kind of route required. The algorithms
involved are pretty interesting!

[http://zikes.website](http://zikes.website)

~~~
phumbe
That's really cool.

Any chance it might eventually allow users to specify a single start/end point
and a desired distance? That'd be much more useful for people who ride for
sport, and even though there seem to be a few websites that generate such
looped routes, they don't appear to do it particularly well.

------
fcc3
I ride in London, and love
[https://www.cyclestreets.net/](https://www.cyclestreets.net/). There are
versions for the web, android and now iPhone. It has a 'quietest route' option
which I love. Android version gives you voice navigation. I put the phone in
my shirt pocket and have it talk me through quiet streets avoiding the hassle
of traffic. Open source. Runs on Openstreetmap data. Needs funding and
promotion.

------
lasryaric
I love the concept. I would love to have anentry point to cost function with
the following parameters:

\- traffic \- elevation gain \- type of street \- a way to represent the
distance overhead compare the other segments.

Any framework / dev env where I could easily get that entry point and see the
top results on a map?

~~~
burritojustice
Yes -- at the bottom of the post we show how you can use our mapzen.js library
to draw routes on a map. If you know Leaflet it's relatively straightforward.

------
lasryaric
Is there a bike routing product that uses this new api that I can use? I spend
hours finding the "less stressfull" bike routes. I like hills but I really
value safety.

~~~
slashdotdash
Strava[1] provides a cycle route builder that uses the popularity of routes
based on their dataset of uploaded rides. As it's using recorded rides,
typically by local riders, I've found it produces good routing; quiet roads
similar to those you'd choose if you knew the area well.

[1] [https://www.strava.com](https://www.strava.com)

~~~
rconti
Wow. I was just playing with Strava last night and didn't realize I could
build point A to point B routes because the interface is so impenetrable.
(tip: search for address, then zoom the map WAY in manually, because it
doesn't bother finding the address for you, click on the map to produce a dot,
search for 2nd address, zoom WAY in and click to place your second dot, god
help you if you don't actually know how to find the places on the map with
your own two eyes).

Then it automatically built a route on some of the most heavily-traveled and
bike-unfriendly roads in the area. (SF Peninsula locals: Marsh Road,
Middlefield bike slaughter through Palo Alto). At least it only had a few
turns. Google Maps did far, far better.

------
thisiscool
What a great idea! I'm thinking how great this type of bike-optimized map on a
dedicated bike gps unit would be.

~~~
maxerickson
It's a rabbit hole, but there is pretty good support for loading OpenStreetMap
data onto Garmin devices (other device makers did a better job obscuring their
formats):

[http://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin](http://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin)

I guess the routing enabled bike maps will take advantage of whatever data is
present.

BBBike supports custom areas:

[http://extract.bbbike.org/extract.html](http://extract.bbbike.org/extract.html)

------
brightball
LeafletJS looks interesting there for the maps. Any experiences with it here?
Does it work well with PostGIS?

~~~
aw3c2
Leaflet is for requesting and displaying raster tiles on the client. PostGIS
is for storing and managing geo data. Leaflet and PostGIS do not talk to each
other. Inbetween you need a tile renderer (like Mapnik).

Leaflet is a great library if you don't need much (use OpenLayers then).

------
novia
If use_roads is set to zero, will this optimize for roads that include
sidewalks?

~~~
Facemelters
I'm guessing it will optimize for dedicated bike paths since you shouldn't be
riding your bike on the sidewalk.

~~~
Spivak
If we added bike lanes to sidewalks rather than roads I think it would solve a
lot of the complaints motorists have.

~~~
MBlume
We should take land away from motorists, not from pedestrians.

~~~
icebraining
Yeah, but that's a separate matter, you can simply widen the sidewalk into the
road to add the cycling lane.

~~~
MBlume
Yeah, sure, that's cool

------
vermooten
Why's it better than ridewithgps, which is superb?

------
drumttocs8
"When he is not writing sick c++ programs he is most likely writing sick
music."

This kid is pretty cool.

