Avoidance

Routes can be calculated to avoid specific map features and/or areas.

Map features can be specified by providing a feature category. For example, a route that avoids toll roads can be calculated by specifying avoid[features]=tollRoad when requesting a route. A route that avoids environmental zones can be calculated by specifying avoid[zoneCategories]=environmental.

Specific features of the map can also be avoided by providing an identifier of the feature to be avoided. For example, a route that avoids a specific segment, a part of Invalidenstrasse in Berlin, can be calculated by specifying avoid[segments]=here:cm:segment:207551710. A route that avoids one specific environmental zone ("Berlin Umweltzone") can be calculated by specifying avoid[zoneIdentifiers]=here:cm:envzone:2.

To avoid a whole area, a user specified bounding box can be provided. For example, a route that avoids the Berlin area can be calculated by providing 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 can be returned that makes minimal use of the feature. However, there is no guarantee that a route is returned, if it is only possible by violating avoid.

If a route is returned that violates the avoid request a notice is included to indicate that the route does not avoid the feature.

Routing zones

A routing zone is a group of roads that share the same regulations. Currently, three zone categories are supported, namely vignette, congestionPricing and environmental (see API Reference for more details). vignette roads are found in some European countries. The system works based on payment for a fixed time period (for example, one year). A traveler may want to avoid those roads to save the annual cost for occasional crossings. congestionPricing zones are another category of routing zones that consists of roads usually in the city centers, airports, bridges, or other busy areas. It is used to mitigate traffic congestion by charging a higher price in rush hours. environmental zones, on the other hand, are designed to improve air quality in urban areas by excluding vehicles under certain pollution standards from entering them.

For each category, there are multiple instances. For example, most cities in Germany have their own environmental zones. Each zone instance has its unique ID to identify it respectively.

Information about the various routing zones originates from the respective catalogs of platform.here.com. For example https://platform.here.com/data/hrn:here:data::olp-here:rib-2/environmental-zones/overview for Environmental Zones. If you do not have access to the platform catalogs then you can use the routing response to get this information.

A route can be planned avoiding certain categories of zones or certain instances of zones. Specifically, there are three ways to use the API:

  1. avoid zones by category
  2. avoid zones by ID
  3. avoid zones by category except for certain IDs

Avoid areas

The avoid[areas] parameter enables calculating routes that avoid the specified areas.

For performance considerations, different algorithms are used for avoiding areas based on the size of these areas. If the area specified is large and the only possible route passes the avoided area, the part of the route inside the avoided area may not be optimal.

Scenarios in which the route may go through an avoided area:

  • No alternate route could be calculated from source to destination.
  • Origin, destination or intermediate waypoint is within the avoided area.

Get detailed section notices

This request specifies waypoints and parameters for a route that does not exist. The result of the calculation is a response that specifies notices for certain sections of the route.

curl -X GET \
  'https://router.hereapi.com/v8/routes?origin=50.892387,20.655124&destination=50.894911,20.64899&transportMode=truck&vehicle[grossWeight]=4000&departureTime=2020-10-28T00:01:00+01:00&apikey={YOUR_API_KEY}'
{
  "routes": [
    {
      "id": "4ff6518f-ebf4-4c69-aa6f-ed1a67c0daec",
      "sections": [
        {
          "id": "f9fd7dca-e7ca-4c95-9033-fb5b395a5452",
          "type": "vehicle",
          "departure": {
            "time": "2020-10-28T00:01:00+01:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 50.8924,
                "lng": 20.655124
              },
              "originalLocation": {
                "lat": 50.892387,
                "lng": 20.6551239
              }
            }
          },
          "arrival": {
            "time": "2020-10-28T00:04:32+01:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 50.8948931,
                "lng": 20.6489882
              },
              "originalLocation": {
                "lat": 50.8949109,
                "lng": 20.64899
              }
            }
          },
          "notices": [
            {
              "title": "Violated vehicle restriction.",
              "code": "violatedVehicleRestriction",
              "severity": "critical",
              "details": [
                {
                  "type": "restriction",
                  "cause": "Route violates vehicle restriction",
                  "maxGrossWeight": 3500,
                  "timeDependent": true
                }
              ]
            }
          ],
          "transport": {
            "mode": "truck"
          }
        }
      ]
    }
  ]
}

results matching ""

    No results matching ""