Avoidance

The route can be calculated to avoid many types of map features and/or user specified area bounding boxes.

A route that avoids toll roads can be calculated by specifying avoid[features]=tollRoad when requesting a route.

A route that avoids the Berlin area can be specified for example with avoid[areas]=bbox:13.082,52.416,13.628,52.626.

Sometimes no route is possible that avoids the feature, for example specifying avoid[features]=ferry to an otherwise inaccessible island. In this case, a route is returned that makes minimal use of the feature. Furthermore, a notice is included to indicate that the route does not avoid the feature.

Example that Avoids the Avoid Option

curl -X GET \
  'https://router.hereapi.com/v8/routes?destination=47.168076,11.861380&origin=47.257410,11.351458&transportMode=car&avoid[features]=tollRoad'
{
    "routes": [
        {
            "id": "428d7f71-f92b-484f-a4b5-d491b35f6210",
            "sections": [
                {
                    "arrival": {
                        "place": {
                            "location": {
                                "lat": 47.168049830943346,
                                "lng": 11.861283313483
                            },
                            "type": "place"
                        },
                        "time": "2019-12-09T16:06:36+01:00"
                    },
                    "departure": {
                        "place": {
                            "location": {
                                "lat": 47.25743193179369,
                                "lng": 11.35145296342671
                            },
                            "type": "place"
                        },
                        "time": "2019-12-09T14:23:59+01:00"
                    },
                    "id": "ccba0c50-76f7-4d55-a8da-ce5c3ee629a9",
                    "transport": {
                        "mode": "car"
                    },
                    "type": "vehicle"
                }
            ]
        }
    ]
}

Example that Violates the Avoid Option

curl -X GET \
  'https://router.hereapi.com/v8/routes?destination=53.863531,14.284817&origin=53.859552,14.271760&transportMode=car&avoid[features]=ferry'
{
    "routes": [
        {
            "id": "7616d85b-da9a-46bd-9b9f-e8dafe34213a",
            "sections": [
                {
                    "arrival": {
                        "place": {
                            "location": {
                                "lat": 53.86060992255807,
                                "lng": 14.277769988402724
                            },
                            "type": "place"
                        },
                        "time": "2019-12-09T14:31:28+01:00"
                    },
                    "departure": {
                        "place": {
                            "location": {
                                "lat": 53.859547432512045,
                                "lng": 14.271750692278147
                            },
                            "type": "place"
                        },
                        "time": "2019-12-09T14:08:34+01:00"
                    },
                    "id": "217649dd-5584-4162-b235-f625f5b25185",
                    "transport": {
                        "mode": "car"
                    },
                    "type": "vehicle"
                },
                {
                    "arrival": {
                        "place": {
                            "location": {
                                "lat": 53.862169962376356,
                                "lng": 14.28596992045641
                            },
                            "type": "place"
                        },
                        "time": "2019-12-09T14:42:28+01:00"
                    },
                    "departure": {
                        "place": {
                            "location": {
                                "lat": 53.86060992255807,
                                "lng": 14.277769988402724
                            },
                            "type": "place"
                        },
                        "time": "2019-12-09T14:31:28+01:00"
                    },
                    "id": "e955e9cf-7783-4c77-a9ee-8ba1b409b612",
                    "notices": [
                        {
                            "code": "violatedAvoidFerry",
                            "title": "Violated avoid ferry"
                        }
                    ],
                    "transport": {
                        "mode": "ferry"
                    },
                    "type": "vehicle"
                },
                {
                    "arrival": {
                        "place": {
                            "location": {
                                "lat": 53.86353185400367,
                                "lng": 14.284817911684513
                            },
                            "type": "place"
                        },
                        "time": "2019-12-09T14:44:22+01:00"
                    },
                    "departure": {
                        "place": {
                            "location": {
                                "lat": 53.862169962376356,
                                "lng": 14.28596992045641
                            },
                            "type": "place"
                        },
                        "time": "2019-12-09T14:42:28+01:00"
                    },
                    "id": "3a8fe2c0-269a-45f1-a5bb-aab060d78c7c",
                    "transport": {
                        "mode": "car"
                    },
                    "type": "vehicle"
                }
            ]
        }
    ]
}

results matching ""

    No results matching ""