Skip to content

foot: respect foot=use_sidepath and sidewalk:*=separate tags#7426

Merged
DennisOSRM merged 5 commits intomasterfrom
fix/foot-use-sidepath
Mar 26, 2026
Merged

foot: respect foot=use_sidepath and sidewalk:*=separate tags#7426
DennisOSRM merged 5 commits intomasterfrom
fix/foot-use-sidepath

Conversation

@DennisOSRM
Copy link
Copy Markdown
Collaborator

Problem

Fixes #6229.

The foot profile ignored foot=use_sidepath and sidewalk:left/right/both=separate tags, routing pedestrians along carriageways instead of separately-mapped parallel footways.

Solution

1. foot=use_sidepath → blacklisted

Added use_sidepath to access_tag_blacklist in the foot profile, matching the existing behaviour of the bicycle profile. Ways tagged foot=use_sidepath have a compulsory parallel footway that pedestrians must use instead.

2. sidewalk:*=separate → inference block

Added a handle_sidewalk_separate handler that blocks carriageway access when any of sidewalk, sidewalk:both, sidewalk:left, or sidewalk:right is set to separate. This covers the common real-world case where roads are tagged with directional sidewalk tags instead of foot=use_sidepath (e.g. way 672340162).

Explicit foot access tags override the inference: foot=yes, foot=permissive, foot=designated, or foot=destination on the same way suppress the block for the respective direction.

Tests

  • features/foot/access.feature: added use_sidepath row to the access tags scenario; added rows to the access combinations scenario; added a new scenario verifying that explicit foot=destination/foot=yes still routes when sidewalk:right=separate is present.
  • features/foot/use_sidepath.feature (new): two route-preference scenarios verifying that routing goes via the parallel footway rather than the blocked carriageway, for both foot=use_sidepath and sidewalk:right=separate.

All 51 @foot scenarios pass.

Follow-up

A potential Option 2 (treating use_sidepath as restricted rather than fully blocked, allowing last-resort routing via the carriageway) is left for a future PR.

DennisOSRM and others added 5 commits March 23, 2026 16:19
Roads tagged foot=use_sidepath have a separately mapped compulsory
parallel footway that pedestrians are required to use (by law in some
countries such as the Netherlands and Germany). OSRM was ignoring this
tag and routing pedestrians on the carriageway instead.

Add 'use_sidepath' to the foot profile's access_tag_blacklist, matching
the identical treatment already applied to bicycle=use_sidepath in the
bicycle profile.

Test coverage added in:
- features/foot/access.feature: access-table rows asserting
  foot=use_sidepath (alone and combined with access=yes/permissive)
  produces no route.
- features/foot/use_sidepath.feature: route-preference scenario
  verifying that when a parallel footway exists the router takes the
  footway rather than the foot=use_sidepath carriageway.

Fixes #6229

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ways tagged with sidewalk=separate, sidewalk:both=separate, or
sidewalk:left/right=separate indicate that the pedestrian path is
already captured by a distinct OSM way. Routing pedestrians along
the carriageway in those cases duplicates the separately-mapped
footway.

Add a local handle_sidewalk_separate handler that blocks forward
and backward access when any of these tags is present, unless foot
access is explicitly whitelisted (e.g. foot=yes/permissive/designated).

Also adds a failing test scenario that verifies routes prefer the
separately-mapped footway over the carriageway.

Fixes part of #6229.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous handle_sidewalk_separate only checked access_tag_whitelist
(yes/foot/permissive/designated) as the override guard. This meant
foot=destination would still be blocked even though the mapper
explicitly allowed pedestrian access.

Fix: check per-direction whether the access tag is explicitly set and
not blacklisted. Any explicit non-blacklisted value (including
destination) suppresses the sidewalk inference for that direction.
Also restructure the handler to exit early when no sidewalk:*=separate
tag is present, and return false when both directions end up blocked.

Add test: explicit foot=destination or foot=yes with sidewalk:right=separate
still routes; no foot tag with sidewalk:right=separate does not.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@TheMarex TheMarex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. 👍

@DennisOSRM DennisOSRM merged commit d7a5e55 into master Mar 26, 2026
23 checks passed
@DennisOSRM DennisOSRM deleted the fix/foot-use-sidepath branch March 26, 2026 03:30
DennisOSRM added a commit that referenced this pull request Mar 26, 2026
Roads tagged with cycleway=separate, cycleway:both=separate, or
cycleway:left/right=separate have a separately mapped parallel cycleway.
Cyclists should be routed via that cycleway instead of the carriageway.

Add a handle_cycleway_separate handler to the bicycle profile that blocks
carriageway access when any cycleway:* tag is set to 'separate'. Explicit
bicycle access tags (bicycle=yes/permissive/designated/destination) override
the inference, matching the pattern established in the foot profile for
sidewalk:*=separate (PR #7426).

Fixes #1171.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sidewalk:left and sidewalk:right seem to be ignored

2 participants