Skip to content

Conversation

@afarber
Copy link
Contributor

@afarber afarber commented Jan 16, 2026

Issue

Fixes #6757

The car profile currently whitelists barrier=gate and barrier=lift_gate, making them unconditionally passable when no access tag is present. This is problematic because many real-world gates lack explicit access tags but are not publicly accessible.

This PR applies a configurable time penalty (default 60 seconds) to gates:

  • Gates without access tags are routable but incur a 60-second penalty
  • Gates with access=yes/permissive/designated bypass the penalty (explicitly open)
  • Gates with access=no remain blocked
  • Penalty is configurable via profile.barrier_penalties table
  • Adds new Gate obstacle type for explicit handling

Tasklist

Requirements / Relations

@TheMarex
Copy link
Member

Hrm, can you say more why you think this is different in OSRM then in all other routing engines you referenced? I actually tried this on openstreetmap.org and the result seems the same between OSRM / Valhalla / Graphhopper.

https://www.openstreetmap.org/directions?engine=fossgis_osrm_car&route=52.551822%2C13.349682%3B52.552262%2C13.349802

The gate in question doesn't have an access tag and default accessibility is assumed for all engines.

This is problematic because many real-world gates lack explicit access tags but are not publicly accessible.

Yeah but the problem is the inverse is also true: There are tons of parking lots that are accessible and protected with barriers. Unfortunately a lot of POIs would need to snap to those parking lots for correct routing (e.g. to the Lidl above). Making these parking lots unaccessible will mean it snaps to the nearest road which can lead to odd results (snap to a backstreet).

A better fix would be to add a penalty in if the access is unclear. Looking at the profile I think we are already doing this? (see obstacles) So I'm not clear in which scenario this was causing wrong results.

@afarber afarber force-pushed the 6757-remove-gate-lift-car branch from e7cb042 to 2b055e0 Compare January 18, 2026 19:01
@afarber
Copy link
Contributor Author

afarber commented Jan 18, 2026

@TheMarex updated to use a 60-second penalty instead of blocking. Is this what you had in mind?

@afarber afarber force-pushed the 6757-remove-gate-lift-car branch 2 times, most recently from 66f818b to 97462be Compare January 24, 2026 08:27
@afarber afarber force-pushed the 6757-remove-gate-lift-car branch 2 times, most recently from e213988 to d60bf75 Compare January 27, 2026 17:46
@afarber afarber changed the title Remove gate and lift_gate from car profile barrier whitelist Apply configurable penalty to gates in car profile Jan 27, 2026
@TheMarex TheMarex force-pushed the 6757-remove-gate-lift-car branch from b71450b to ec15b49 Compare January 27, 2026 21:58
@afarber afarber force-pushed the 6757-remove-gate-lift-car branch from ec15b49 to 9d2edeb Compare January 28, 2026 07:35
@TheMarex TheMarex merged commit f9e90b8 into Project-OSRM:master Jan 28, 2026
19 checks passed
@afarber afarber deleted the 6757-remove-gate-lift-car branch January 28, 2026 09:41
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.

barrier=gate and barrier=lift_gate should not be whitelisted in car profile

2 participants