Update origin of a route

The route handle endpoint also accepts an origin parameter. It can be used to update the origin of the route, essentially removing the initial part of the original route up until the location passed as new origin.

Note that for this behavior the origin needs to be on the route. A location not on the route for origin will result in an error.

If a route goes through the same point multiple times, origin is matched to the first occurrence on the route.

This request obtains an updated route handle:

curl -X GET \
    'https://router.hereapi.com/v8/routes?origin=52.531029,13.384831&destination=52.539451,13.410595&return=summary,routeHandle&transportMode=car&apikey={YOUR_API_KEY}'
{
  "routes": [
    {
      "id": "d5d4eda5-ca9e-4722-ba23-33d8878a0c9a",
      "sections": [
        {
          "id": "41d20dd7-35ee-4da0-a5d8-60f7dea495db",
          "type": "vehicle",
          "departure": {
            "time": "2021-06-29T13:37:29+02:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 52.53105,
                "lng": 13.38481
              },
              "originalLocation": {
                "lat": 52.5310289,
                "lng": 13.3848309
              }
            }
          },
          "arrival": {
            "time": "2021-06-29T13:44:19+02:00",
            "place": {
              "type": "place",
              "location": {
                "lat": 52.5394429,
                "lng": 13.4106148
              },
              "originalLocation": {
                "lat": 52.539451,
                "lng": 13.410595
              }
            }
          },
          "summary": {
            "duration": 410,
            "length": 2624,
            "baseDuration": 289
          },
          "transport": {
            "mode": "car"
          }
        }
      ],
      "routeHandle": "{originalRouteHandle}"
    }
  ]
}

results matching ""

    No results matching ""