Skip to content

fix: prevent conditional tags from overriding implicit pedestrian roa…#3324

Open
pgrigolli wants to merge 1 commit intographhopper:masterfrom
pgrigolli:fix/pedestrian-road-conditional-access]
Open

fix: prevent conditional tags from overriding implicit pedestrian roa…#3324
pgrigolli wants to merge 1 commit intographhopper:masterfrom
pgrigolli:fix/pedestrian-road-conditional-access]

Conversation

@pgrigolli
Copy link
Copy Markdown

Fixes #3308
highway=pedestrian roads were being routed for cars when a motor_vehicle:conditional tag was present, even without any explicit access tag. For example, a road tagged with:

highway = pedestrian
motor_vehicle:conditional = delivery @ (Mo-Fr 06:00-11:00, 19:00-21:00; Sa 06:00-09:30; PH off)
bicycle = yes

was being treated as accessible for cars, causing the router to send vehicles through pedestrian areas instead of calculating a detour.

Root cause

The if block responsible for blocking cars on pedestrian roads calls hasPermissiveTemporalRestriction as its third condition. This method was returning true whenever a conditional tag contained a value present in allowedValues (such as delivery) and a time range — regardless of whether the restriction on the road was explicit (access=no) or implicit (derived from highway=pedestrian). This caused the CAN_SKIP return to be skipped, leaving the road accessible for cars.

Fix

Added a private method hasPermissiveTemporalRestrictionForPedestrian in CarAccessParser that adds a guard before calling hasPermissiveTemporalRestriction — only considering conditional tags if an explicit restriction (access=no or motor_vehicle=no) is present on the way. The original hasPermissiveTemporalRestriction method was left untouched to avoid breaking other parsers that depend on it (bike, temporal access).

@pgrigolli
Copy link
Copy Markdown
Author

@karussell could you please check if this is ok?

@michaz
Copy link
Copy Markdown
Member

michaz commented Apr 9, 2026

Hi! Thanks, but I think this isn't it. Technically speaking, your second test already succeeds before your patch (we are not in fact opening anything for "delivery" exemptions here, despite what it looks like in the ticket), and your second test only tests one side (that we aren't opening "part-time" pedestrian zones anymore), but it doesn't show what we do open.

Less technically: What's the difference between a pedestrian zone with "motor_vehicle=no" and one without? Shouldn't they be treated the same when a conditional like this hits them?

The question is more like should a pedestrian zone that is only open for cars for parts of the day be open or closed if we can only pick one.

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.

GraphHopper routes cars through pedestrian roads

2 participants