Skip to content

Matrix endpoint returns incorrect (and asymmetric) distance when avoid_features=["ferries"] is specified, but directions endpoint returns correct route #2282

Description

@vdobrelya

Is there an existing issue for this?

  • I have searched the existing issues

Where did you encounter this issue?

self-hosted instance

Request URL

http://localhost:8080/ors/v2/directions/driving-hgv

POST Request Body

curl -s -X POST http://localhost:8080/ors/v2/matrix/driving-hgv \
  -H "Content-Type: application/json" \
  -d '{
    "locations": [[144.745, -38.339], [144.661, -38.270]],
    "metrics": ["distance", "duration"],
    "options": {"avoid_features": ["ferries"]}
  }'

Response

Response
{"durations":[[0.0,14134.35],[4252.72,0.0]],"distances":[[0.0,204966.66],[13094.24,0.0]],"destinations":[{"location":[144.744483,-38.339248],"snapped_distance":52.81},{"location":[144.661255,-38.270086],"snapped_distance":24.24}],"sources":[{"location":[144.744483,-38.339248],"snapped_distance":52.81},{"location":[144.661255,-38.270086],"snapped_distance":24.24}],"metadata":{"attribution":"openrouteservice.org, OpenStreetMap contributors","service":"matrix","timestamp":1778487603104,"query":{"locations":[[144.745,-38.339],[144.661,-38.27]],"profile":"driving-hgv","profileName":"driving-hgv","responseType":"json","metrics":["distance","duration"],"options":{"avoid_features":["ferries"]}},"engine":{"version":"9.8.0","build_date":"2026-03-30T12:24:04Z","graph_date":"2026-05-11T08:12:50Z","osm_date":"2026-04-14T20:21:30Z"}}}
real    0m1.438s
user    0m0.092s
sys     0m0.107s

Current behavior

The /v2/matrix/{profile} endpoint returns an implausibly short distance for one
direction of a route when avoid_features: ["ferries"] is specified, suggesting
a ferry segment is being used despite the avoidance. The same source/destination
pair, queried in the opposite direction, returns the correct long land route.
The /v2/directions/{profile} endpoint with identical parameters correctly
avoids the ferry in both directions.

  • ORS version: 9.8.0 (Docker image openrouteservice/openrouteservice:v9.8.0)
  • Profile: driving-hgv
  • OSM data: Victoria, Australia (victoria-latest.osm.pbf)
  • Core preparation enabled with lmsets: ferries

Expected behavior

Both directions should be approximately 205 km, ~3.9 h - the land route via
Melbourne. The ferry has been excluded so the only possible truck route is
around the bay.

Openrouteservice Version

9.8.0

Build date

2026-03-30T12:24:04Z

Graph date

2026-05-11T08:12:50Z

Forum Topic Link

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions