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: Include highways in scooter route

Table of Contents
HomeHERE Routing API v8 - Developer GuideInclude highways in scooter routeCurrent page
Table of Contents

Include highways in scooter route

Scooters aren't allowed on highways by default. This is equivalent to setting the avoid[features]=controlledAccessHighway parameter for other routing modes.

If highways can't be avoided, the Routing API tries to minimize the usage of highways and includes a notice in the response.

This request has the origin on a highway, and thus the highway can't be avoided:

curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=53.338335,14.505925&'\
'destination=53.277864,14.256036&'\
'transportMode=scooter&'\
'apiKey={YOUR_API_KEY}'

The response contains the notice code violatedAvoidControlledAccessHighway:

"sections": [
  {
    ...,
    "notices": [
      {
        "title": "Violated avoid controlled-access highway.",
        "code": "violatedAvoidControlledAccessHighway",
        "severity": "critical"
      }
    ]
  }
]

You can override this default behavior by setting the scooter[allowHighway]=true parameter, thus allowing the use of highways. This is especially recommended if your vehicle is actually a motorcycle. See the following example:

curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'origin=53.338335,14.505925&'\
'destination=53.277864,14.256036&'\
'transportMode=scooter&'\
'scooter[allowHighway]=true&'\
'apiKey={YOUR_API_KEY}'

The resulting route (in blue) stays on the highway until it's close to the destination. The original route (in purple) leaves the highway as early as possible:

Override default highways avoidance for scooter
Override default highways avoidance for scooter

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