Closed rsarathy closed 2 months ago
omg tests 😠so many tests are so broken LMAO you'll probably want to run just this one
Our router avoids Market Street because the majority of the road is tagged as highway=tertiary
, which receives a highway penalty of 8.0
. Adjacent roads near Market have much smaller penalties, e.g. < 5.0
on 6th and 7th. This causes the router to produce a "sickle-shaped" route which avoids Market Street when possible, only rejoining when nearing a user's destination.
However, Market Street is car-free from 10th to Embarcadero Plaza. This is reflected with the tag motor_vehicle=no
. The router does not acknowledge this tag with a requisite lower penalty.
Furthermore, simply inserting the following code
if (way.hasTag("motor_vehicle", "no"))
penaltyMap.put(HIGHWAY_KEY, BEST.getValue());
will not result in a more favorable penalty in the Market Street example. This is because when the router assesses penalties, it prioritizes any penalties that are cycling infrastructure-related before those that are highway-related. Since Market Street ways from 10th to Embarcadero all bear a cycleway:right=shared_lane
tag, this receives an UNCHANGED
cycling infrastructure penalty (5.0
), which is prioritized over the favorable motor_vehicle=no
(non-)penalty.
To this end, I propose the following change:
motor_vehicle=no
. We can do this in a hacky manner by treating this tag as cycling infrastructure-related so that it's always prioritized.With this change, Bikehopper successfully produces a bike-only route down Market street from 10th to Sutter.
beautiful image. what does this route look like now?
Unfortunately, this start-destination pair doesn't route down Market Street due to the following (this is close to exhaustive I think):
highway=primary
(a HIGHWAY
penalty of 9.5
).cycleway:right=track
), our router isn't rewarding the way with the proper (non-)penalty, which is 1.5
. It reads as UNCHANGED
.WRT (1), I think the router excluding Upper Market in favor of alternative routes is acceptable. I'm working on resolving (2). And (3) is related to the infamous #129.
Market Street is a relatively friendly bike route and should be incorporated into suggested Bikehopper directions.