Get a route to the correct side-of-street always

It is important to note that the option demonstrated in Calculate route to the correct side of the street has the default behaviour of navigating to the desired street side only for those cases where crossing lanes is impossible or inconvenient, such as where a physical or legal divider is present between the opposite directions. In contrast, the example in the following request creates a route to the correct side of street even in the absence of such restrictions due to the specification of the option matchSideOfStreet=always:

curl -X GET \
  'https://router.hereapi.com/v8/routes?transportMode=car&origin=52.5411320,13.4108499&destination=52.5391210,13.4081705;sideOfStreetHint=52.5389135,13.4079459;matchSideOfStreet=always&return=polyline,summary'

The returned polyline is a route approaching the destination from the northwest, as we required the route to end on the southwest side of the street. If the sideOfStreetHint and matchSideOfStreet parameters were absent, the resulting (shorter) route would approach from the southeast instead.

{
  "routes": [
    {
      "id": "adef8179-d3f0-4774-b9ec-118a5895de90",
      "sections": [
        {
          "id": "f4789fbb-5ea2-4183-809f-46884201a936",
          "type": "vehicle",
          "departure": {
            "place": {
              "type": "place",
              "location": {
                "lat": 52.5411302,
                "lng": 13.4108494,
                "elv": 0.0
              },
              "originalLocation": {
                "lat": 52.541132,
                "lng": 13.4108499
              }
            }
          },
          "arrival": {
            "place": {
              "type": "place",
              "location": {
                "lat": 52.5391076,
                "lng": 13.4081575,
                "elv": 0.0
              },
              "originalLocation": {
                "lat": 52.539121,
                "lng": 13.4081704
              }
            }
          },
          "summary": {
            "duration": 115,
            "length": 755,
            "baseDuration": 115
          },
          "polyline": "BG0s7mkDiixyZmHnqC2C7mBsB3MUrHW3KArJpB3K1CtT1EjYV1CrB1G1ChO1ElaT1ErBhGrJ9yB_D3ShK_4BhGgCrFqB_FsBU2GAsH1GkU3OylB5Wg7BhSouBnQ8sB",
          "transport": {
            "mode": "car"
          }
        }
      ]
    }
  ]
}

results matching ""

    No results matching ""