osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

Add sidepath name fallback using is_sidepath:of:name and street:name tags

Open afarber opened this issue 1 month ago • 0 comments

Issue

Fixes #7259

When sidewalks and cycleways are mapped as separate ways in OSM, they often lack a name tag. This results in unhelpful navigation instructions like "Turn right, walk 150 m" instead of "Turn right onto Main Street, walk 150 m".

This PR adds support for fallback name tags that OSM mappers use to associate sidewalks with their adjacent streets:

  • is_sidepath:of:name (~15,500 uses in OSM)
  • street:name (~9,100 uses in OSM)

The fallback only applies when:

  1. The way has no name tag
  2. The highway type is footway, cycleway, or path
  3. The way is marked as a sidepath via footway=sidewalk, cycleway=sidepath, or is_sidepath=yes

Car routing is unaffected because the fallback requires the highway type to be footway, cycleway, or path. Even if someone mistakenly adds footway=sidewalk to a highway=primary, the fallback will not trigger since it checks the highway type first.

Tests added

Foot profile (features/foot/sidepath_names.feature):

  • Use is_sidepath:of:name for unnamed sidewalk
  • Use street:name for unnamed sidewalk
  • is_sidepath:of:name takes priority over street:name
  • Explicit name tag takes priority over fallback
  • Use is_sidepath=yes with street:name
  • No fallback without sidepath marker

Bicycle profile (features/bicycle/sidepath_names.feature):

  • Use is_sidepath:of:name for cycleway sidepath
  • Use street:name for cycleway sidepath
  • Explicit name takes priority
  • Use is_sidepath=yes with is_sidepath:of:name
  • No fallback without sidepath marker

Car profile (features/car/sidepath_names.feature):

  • Does not use sidepath name fallback on roads
  • Does not pick up is_sidepath:of:name on roads
  • Sidepath markers do not affect car roads

Tasklist

Requirements / Relations

None

afarber avatar Nov 30 '25 09:11 afarber