bikehopper / graphhopper

Open source routing engine for OpenStreetMap. Use it as Java library or standalone web server.
https://www.graphhopper.com/open-source/
Apache License 2.0
3 stars 0 forks source link

[WIP] Market Street Routing #140

Closed rsarathy closed 2 months ago

rsarathy commented 4 months ago

Market Street is a relatively friendly bike route and should be incorporated into suggested Bikehopper directions.

abhumbla commented 4 months ago

omg tests 😭 so many tests are so broken LMAO you'll probably want to run just this one

rsarathy commented 4 months ago

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:

With this change, Bikehopper successfully produces a bike-only route down Market street from 10th to Sutter.

market_st_straight_route
abhumbla commented 4 months ago

beautiful image. what does this route look like now?

Screenshot_20240507-005602~2

rsarathy commented 4 months ago

Unfortunately, this start-destination pair doesn't route down Market Street due to the following (this is close to exhaustive I think):

  1. On Upper Market, we assign a steep penalty because the cycling infrastructure isn't good and the ways are tagged with highway=primary (a HIGHWAY penalty of 9.5).
  2. Between Laguna and Van Ness where there is protected cycling infrastructure (cycleway:right=track), our router isn't rewarding the way with the proper (non-)penalty, which is 1.5. It reads as UNCHANGED.
  3. Near Stevenson up until Steuart and the Embarcadero Plaza, inconsistent elevation data in Financial district produces inaccurate grades which in turn penalizes flat segments too heavily. For example, this way has an elevation gain of nearly 39m according to our router, but is flat in reality.

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.