Skip to content

6.2.0

Latest

Choose a tag to compare

@bobbymaher bobbymaher released this 15 Jan 08:47

New Feature: Control Exclude Behavior for Start/End Points

Summary: Added a new exclude_snapping parameter that allows excluded road classes to still be used for start/end point snapping while remaining excluded from intermediate routing.

Problem

When using exclude=psv to avoid bus lanes, routes would fail entirely with "No route found between points" if the origin or destination was located on a PSV-only road (e.g., a bus station). This was because OSRM applied the exclude filter to both:

Phantom node snapping (start/end point selection)
Intermediate routing
Users had no way to route to a bus station while still avoiding bus lanes during the route.

Solution

The new exclude_snapping parameter (default: true) controls whether the exclude filter applies to start/end point snapping:

exclude_snapping=true (default): Current behavior - excluded roads are filtered from both snapping and routing
exclude_snapping=false: Excluded roads can be used for start/end points, but are still avoided during intermediate routing
Usage

Regular vehicles avoiding bus lanes, but able to reach bus stations:
/route/v1/driving/-6.2603,53.3498;-6.2450,53.3421?exclude=psv&exclude_snapping=false

PSV vehicles (taxis/buses) using bus lanes for shorter routes:
/route/v1/driving/-6.2603,53.3498;-6.2450,53.3421
(No exclude parameter needed)

API Changes
Parameter: exclude_snapping
Type: boolean
Default: true
Description: When false, allows snapping to excluded road classes for start/end points while still excluding them from intermediate
routing
Backward Compatibility

This change is fully backward compatible. The default value exclude_snapping=true preserves existing behavior. Users must explicitly set exclude_snapping=false to enable the new functionality.