Calculate route with a passthrough waypoint

The example below is using the same coordinates for origin, destination and via, but is setting passThrough=true for the via waypoint.

As a result, contrary to previous example, the received route response contains only one leg stretching from origin to destination, avoiding split into sections at the intermediate waypoint.

curl -X GET \
  'https://router.hereapi.com/v8/routes?transportMode=car&return=polyline,summary,passthrough&origin=52.51375,13.42462&destination=52.52332,13.42800&via=52.52426,13.43000!passThrough=true&apiKey={YOUR_API_KEY}'
{
  "routes": [
    {
      "id": "338a34f2-60c2-4ced-b9c4-074c3c2f8039",
      "sections": [
        {
          "id": "c4052a8e-7a53-4203-8606-b50260ad7b5c",
          "type": "vehicle",
          "departure": {
            "time": "2020-06-29T16:59:53+02:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 52.513748,
                "lng": 13.424624
              },
              "originalLocation": {
                "lat": 52.51375,
                "lng": 13.42462
              }
            }
          },
          "arrival": {
            "time": "2020-06-29T17:04:09+02:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 52.5232227,
                "lng": 13.4280044
              },
              "originalLocation": {
                "lat": 52.5233199,
                "lng": 13.428
              }
            }
          },
          "summary": {
            "duration": 256,
            "length": 1970,
            "baseDuration": 256
          },
          "passthrough": [
            {
              "place": {
                "type": "place",
                "location": {
                  "lat": 52.5242323,
                  "lng": 13.4301462
                },
                "originalLocation": {
                  "lat": 52.52426,
                  "lng": 13.43
                },
                "waypoint": 0
              },
              "offset": 49
            }
          ],
          "polyline": "BGo9llkDg_rzZkF0G8LoQ4NoQgP8QoLgKgyB0tB4XoVoLsJ0K4IwWoQsOsJ8LwHoLoGkS0KkN8GsJ0F8GgF4D4DsE0FwHoLUgK8BkIkDkIgFwHgFwCgFUgF7B4DjDsErEsE_EkD7GoLUgFoB0F8B8Q0FsE8BkmBkSgtBwWkS8GwH8B8GoBosCgKkhBsE0FU0FUgZjD8VgKoGkD4F8CgNwGgKgFkI4DgFoBoGUsEnBsEvC3IkSvHkNvWsiBjN0ZjX8kB_OkXjD4DvC8BvCUjIUT7VnBrvCA7L7BnnCnBnV7BjhBTzoBN_Z",
          "transport": {
            "mode": "car"
          }
        }
      ]
    }
  ]
}

Screenshot

With passThrough option set to true, the router did not introduce an u-turn at waypoint (1) avoiding a change in travel direction, hence resulting in a different route shape (the orange line), as shown in the image below.

Route with passthrough via waypoint
Figure 1. Route with passthrough via waypoint

results matching ""

    No results matching ""