Calculate a route including restrictions

In certain areas, it may not possible to calculate a route for your truck that fully avoids to violate restrictions. Truck routing then returns a response with a route that includes as few restrictions as possible and detailed information about the restrictions violated. The following request specifies a destination in a weight-limited zone and a 12t truck of 4m height.

curl -X GET https://router.hereapi.com/v8/routes?apikey=32aib7X3dOCVZm-z2nfxFXd0vZCGIZPuEFwFmzRn8fM&origin=51.019519,17.161546&destination=51.108671,17.038804&return=polyline,summary,actions,instructions&spans=notices&transportMode=truck&truck[grossWeight]=12000&truck[height]=400&departureTime=2021-11-01T10:00:00

The sections of the route with violated restrictions are returned as spans of type notices.

{
    "routes": [
        {
            "id": "7a63b7b6-7b62-4d80-a7cf-3edd1eafa2f9",
            "sections": [
                {
                    "id": "7cb3dcba-6d43-41e0-95eb-3a3f3af77340",
                    "type": "vehicle",
                    "actions": [
                        {
                            "action": "depart",
                            "duration": 282,
                            "length": 3111,
                            "instruction": "Head toward ulica Eugeniusza Kwiatkowskiego on ulica Opolska (94). Go for 3.1 km.",
                            "offset": 0
                        },
                        {
                            "action": "roundaboutExit",
                            "duration": 931,
                            "length": 8299,
                            "instruction": "Take the 2nd exit from roundabout onto ulica Wrocławska (94) toward Wrocław Księże Małe. Go for 8.3 km.",
                            "offset": 110,
                            "direction": "right",
                            "exit": 2
                        },
                        {
                            "action": "keep",
                            "duration": 197,
                            "length": 1178,
                            "instruction": "Keep right onto ulica gen. Romualda Traugutta. Go for 1.2 km.",
                            "offset": 439,
                            "direction": "right"
                        },
                        {
                            "action": "turn",
                            "duration": 62,
                            "length": 103,
                            "instruction": "Turn left onto plac gen. Walerego Wróblewskiego. Go for 103 m.",
                            "offset": 501,
                            "direction": "left",
                            "severity": "quite"
                        },
                        {
                            "action": "turn",
                            "duration": 16,
                            "length": 44,
                            "instruction": "Turn left onto ulica Kujawska (98). Go for 44 m.",
                            "offset": 504,
                            "direction": "left",
                            "severity": "quite"
                        },
                        {
                            "action": "turn",
                            "duration": 78,
                            "length": 432,
                            "instruction": "Turn right onto ulica gen. Romualda Traugutta. Go for 432 m.",
                            "offset": 507,
                            "direction": "right",
                            "severity": "quite"
                        },
                        {
                            "action": "continue",
                            "duration": 9,
                            "length": 55,
                            "instruction": "Continue on ulica Oławska. Go for 55 m.",
                            "offset": 519
                        },
                        {
                            "action": "keep",
                            "duration": 29,
                            "length": 134,
                            "instruction": "Keep right toward plac Dominikański. Go for 134 m.",
                            "offset": 521,
                            "direction": "right"
                        },
                        {
                            "action": "turn",
                            "duration": 20,
                            "length": 95,
                            "instruction": "Turn right onto plac Dominikański. Go for 95 m.",
                            "offset": 527,
                            "direction": "right",
                            "severity": "quite"
                        },
                        {
                            "action": "arrive",
                            "duration": 0,
                            "length": 0,
                            "instruction": "Arrive at plac Dominikański.",
                            "offset": 536
                        }
                    ],
                    "departure": {
                        "time": "2021-11-01T10:00:00+01:00",
                        "place": {
                            "type": "place",
                            "location": {
                                "lat": 51.0193731,
                                "lng": 17.1613281
                            },
                            "originalLocation": {
                                "lat": 51.019519,
                                "lng": 17.1615459
                            }
                        }
                    },
                    "arrival": {
                        "time": "2021-11-01T10:27:04+01:00",
                        "place": {
                            "type": "place",
                            "location": {
                                "lat": 51.1086699,
                                "lng": 17.0387979
                            },
                            "originalLocation": {
                                "lat": 51.1086709,
                                "lng": 17.0388039
                            }
                        }
                    },
                    "summary": {
                        "duration": 1624,
                        "length": 13451,
                        "baseDuration": 1490
                    },
                    "polyline": "BG6m_phDgnu3gBif3zBgKvR0K3S4NjXwHvM0FrJoGzK8G7LsJ_O0KvR8Q3c0FrJ0jBj6BsYnpBwR3c8a_sBsJzPoVzjBgUvgBgFjIsE7GoGzKwHjNgKjS0F_J8G7LsJnQ8Q3coG_JoQ7a4N7VwMzUwMnVkN7Vs7B_jDoQ7akI3NkIrO0KjSwHvMsEvHgFjIwHjNkN7VoG_JsEvHoGzK8GzKoG_J0F3I0F3IsEnGsEnGsEnGsEzFoGjIwMnQsEnGgF7GoGjIkIzKoLrO0FjI0FjI4I3NoG_J8GnLoLvRoG_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IzKwH_J4I7LsJjN4N3S8QvW4I7LwHnL4IjNgKzPgerxBoLjSgK7QwHjNsEjIoGzK8LrT8V7kBsEvHgF3I4I_OgK7QgKnQ8Q7akN7VgPzZgPrY4DnGsEvHgFjIsEvHsEvH4DvHgF7L4InVsE_JgFrJwHjNoG_JwHzK8LnQ8GrJkDjDwCvCwCjDwCjDgK_OsEnG0ZnkB0KzPoQrYoajmBwWzewWnfsE7GkDrEgUrd8V7fwRrdgK7Q0KzPgKrOwHzK4I7LoGjI8GrJ4InLwH_JwHzK8LjS4X_iBkInLoG3I8G_JoQjXgFjI4D7G4DvHsE_JgF7GsEzFsJvMoG3IgPnVoLnQ4DzFsEnGkN3SkNjS0Z7kB4IjNwHnL4DzFsOzUsJjNsEnGgFvH8GrJ4I7L4IvMsEnGoG3IgU3cgF7GkI7LkI7LwHzKgF7GgFnG4DrEsE_EgF_E0F_EoG_E8G_EoLjI4NzKwM_JkIvH4DjD4DvC4D7B0F7BsJ7B8LvCoQjDsJ7B0P3DkI7B8G7BwHvC0FvC0FjD8GrEoG_EoGzFoG7G8GjI8VzZkI3IwHvHgF_E0FzFkIjI8V7V0FzF4D3DwMvMkIjI0FzF8anawbjcsOzPsE_EoL3NoL3NoL_OkInL0U3coG3IwHzKoG3IwR_YkInLkIzK8L_OkNzP4IzKgK7LwHjI4DrEkIT0FAsEAgFAoGUsEU0FoBoG8B4D8BsEwCwHgF4IgFsE8B4InpBoLnkBkDzFrEzFrEzFzK3NokBjzCwHvRgK3XkI_T8G3IoGjN4I3XsE_OkDjSwHjrBkIr2BwCrOsEzjBoBvMgF_O8BvH8B3I4D3X4Dna4DjhBkD3I8B_EwCrE4D3DkDjDsJA8GnB8GvCkInD",
                    "spans": [
                        {
                            "offset": 0
                        },
                        {
                            "offset": 507,
                            "notices": [
                                0
                            ]
                        },
                        {
                            "offset": 527,
                            "notices": [
                                0,
                                1
                            ]
                        }
                    ],
                    "notices": [
                        {
                            "title": "Violated vehicle restriction.",
                            "code": "violatedVehicleRestriction",
                            "severity": "critical",
                            "details": [
                                {
                                    "type": "restriction",
                                    "cause": "Route violates vehicle restriction",
                                    "maxGrossWeight": 9000
                                }
                            ]
                        },
                        {
                            "title": "Violated vehicle restriction.",
                            "code": "violatedVehicleRestriction",
                            "severity": "critical",
                            "details": [
                                {
                                    "type": "restriction",
                                    "cause": "Route violates vehicle restriction",
                                    "maxGrossWeight": 3500,
                                    "timeDependent": true
                                }
                            ]
                        }
                    ],
                    "language": "en-us",
                    "transport": {
                        "mode": "truck"
                    }
                }
            ]
        }
    ]
}

Note

In areas with too many restrictions, route calculation might not be possible. By default, in these cases, the response will contain a route that violates some restrictions and a set of critical notes that inform about the violations included in the route. In rare cases, such as Romania, which has a 11.5t weight per axle restriction on most main roads, it is not even possible to calculate a default route with warnings about violations.

results matching ""

    No results matching ""