Powered by Zoomin Software. For more details please contactZoomin

HERE Routing API v8 - Developer Guide

Product category
Technology
Doc type
Version
Product lifecycle
This publication

HERE Routing API v8 - Developer Guide: Calculate a route with no-through restrictions

Table of Contents
HomeHERE Routing API v8 - Developer Guide...No-through restrictionsCalculate a route with no-through restrictionsCurrent page
Table of Contents

Calculate a route with no-through restrictions

The term "no-through restricted area" refers to an area of the road network where through-traffic is not allowed. Information about no-through areas that occur on the route can be requested using the request parameter return=noThroughRestrictions. Spans can additionally be requested to show where exactly those areas occur on the route, using the request parameter spans=noThroughRestrictions. Note that the returned spans only indicate the presence of a restriction. They don't indicate that the restriction has been violated.

In this sample request, the vehicle in the request is an 8 t truck. The most direct route between origin and destination would go through an area with a no-through restriction for vehicles over 7.5 t. The router therefore avoids that area, instead taking a longer detour.

curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=52.7490018,10.9137729&'\
'destination=52.717981,10.916049&'\
'return=polyline,summary,actions,instructions,noThroughRestrictions&'\
'spans=noThroughRestrictions&'\
'transportMode=truck&'\
'vehicle[grossWeight]=8000&'\
'apiKey={YOUR_API_KEY}'
{
  "routes": [
    {
      "id": "e93deab8-4c03-4478-938e-4cea1bd533c5",
      "sections": [
        {
          ...,
          "summary": {
            "duration": 485,
            "length": 6450,
            "baseDuration": 463
          },
          "polyline": "BGwgyzkD-mk6U7BqM_E8QvHgUnL4X3XkrBnVsnBjhB46Bv-BsyD34CkoF31BwrD_2GgzNvtCo8EztBo7C7uB44CzvFkmLze46Bj1B4iD_0C07EjmB8sCzUgtBrsBknDnao9BnQwlBrO0jBrO4rBjuC_kFjX3wB_EzK7VvvBjNvb3I7QjInL3I3I3IzFvHvC3I7BjcnBjDArETjDvCvC3DvC7GvCnL7B7L7GrxBvCjS7BvRvC3S7B_JjDvM3DrJvHjN_YnpB_EjInLvWvCnGjDzK3D3S3DnVzKjwBvH3hBvCzK3D3IrEvH_E7B_EnB3InBzFnBrJzFzF7G_J3N7ankB7a7kBjX7fjI7LjI3N_EjN_E_TvCjX3Dn4BnB3NjI_yD7VjqJjDvlBvC_TzFvlB3IvvBnLv0BrOrgC_drmEjSvyCvHriBzoBr4FjIvlBjIriBrErTzFrO7LzU_O3XpDzF",
          "spans": [
            {
              "offset": 0
            }
          ],
          "language": "en-us",
          "transport": {
            "mode": "truck"
          }
        }
      ]
    }
  ]
}

no-through restricted area is avoided
no-through restricted area is avoided

In this next example, the previous request has been modified so that the destination is now inside the no-through restricted area. The router no longer needs to avoid the restricted area, because the request asks to make a stop in the area, not to go through it. The response contains a noThroughRestriction containing the restriction details.

curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=52.7490018,10.9137729&'\
'destination=52.745227,10.918257&'\
'return=polyline,summary,actions,instructions,noThroughRestrictions&'\
'spans=noThroughRestrictions&'\
'transportMode=truck&'\
'vehicle[grossWeight]=8000&'\
'apiKey={YOUR_API_KEY}'
{
  "routes": [
    {
      "id": "6a116225-0a74-4627-9b19-0da1683c1910",
      "sections": [
        {
          ...,
          "polyline": "BGwgyzkD-mk6U7BqM_E8QvHgUnL4X3XkrBnVsnBjhB46Bl4Eo5B",
          "spans": [
            {
              "offset": 0
            },
            {
              "offset": 7,
              "noThroughRestrictions": [
                0
              ]
            }
          ],
          "language": "en-us",
          "transport": {
            "mode": "truck"
          },
          "noThroughRestrictions": [
            {
              "type": "restriction",
              "maxGrossWeight": 7500,
              "maxWeight": {
                "value": 7500,
                "type": "gross"
              }
            }
          ]
        }
      ]
    }
  ]
}

route ends in no-through restricted area
route ends in no-through restricted area

For restrictions on route sample requests, see these tutorials:

Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert