SnapPrevention ferry issue

The following request snaps its destination to a ferry route, and this in spite of the snap_prevention: ["ferry’] being specified, as below:

  "points": [
      -0.6599991971010856, 53.865326793102
  "snap_preventions": [
  "details": [
    "road_class", "road_environment",
  "profile": "car",
  "locale": "en",
  "instructions": true,
  "calc_points": true,
  "points_encoded": false

What’s the best way to prevent this from happening, so that the request is snapped to the nearest road? Is a custom model as below the way to go?

    custom_model: {
     "priority": [{
       "if": "road_environment == FERRY",
       "multiply_by": "0.0"

I checked the OSM map and there exists no connections between the destination and a ferry port, i.e no local roads (at/near the destination point) connect to a ferry route.

“snap prevention” means that it tries to avoid to snap to a ferry in the first try. If it cannot find a close nearby “snap possibility” it will still snap to a ferry as otherwise the request would fail. In this case there is no “nearby” (~1km) possibility to snap (for a car).

Thank you @karussell

The 1km (haversine calculated, I suppose) limit explains it. The problem is that the less than 1km away OSM way is tagged as a service road but has limited access to cars (GMaps allows car access to the destination).
Somehow, I had to find a way to invalidate the route. EdgeIterator is the method I chose to use, by comparing the length of the ferry route returned to that of the length of the total edge… works, until there comes a time, of an amphibious car profile, and an OSM tag in which the ferry operator allows customers to just jump off a travelling ferry, and so on… :slight_smile:

Joke aside, again thank you. The 1km snap distance limit, that I wasn’t aware of.

The snapping area it searches is actually a “rectangle” in degrees (dependent on the latitude), which is roughly 1km² at the equator.