Road names and language preferences

In certain regions, road names and road numbers are available in more than one language.

Road names and numbers can be found in:

  • turn-by-turn actions: the attributes name and number of currentRoad and nextRoad
  • spans: names and routeNumbers

In both cases, road name and number attributes are arrays, and can contain more than one element. The first element of the array will contain the name (or number) with the highest priority, which is in the preferred language specified by the lang parameter, if a name in that language is available, or in one of the local languages. For information about supported languages, see languages.

Turn-by-turn actions example

For example, in Brussels, Dutch street names have priority over French street names, and roads do not have English names (en-US is the default value for lang), so Dutch will be preferred:

curl -X GET \
'https://router.hereapi.com/v8/routes?transportMode=car&origin=50.842556,4.375045&destination=50.842939,4.376699&return=polyline,actions,instructions,summary,turnbyturnactions&apikey={YOUR_API_KEY}'
{
  "nextRoad": {
    "name": [
      {
        "value": "Toulousestraat",
        "language": "nl"
      },
      {
        "value": "Rue de Toulouse",
        "language": "fr"
      }
    ]
  }
}

However, if we specifically request French as preferred language, using lang=fr, then the French name of streets will take priority and will be first in the array of names:

curl -X GET \
'https://router.hereapi.com/v8/routes?transportMode=car&origin=50.842556,4.375045&destination=50.842939,4.376699&return=polyline,actions,instructions,summary,turnbyturnactions&lang=fr&apikey={YOUR_API_KEY}'
{
  "nextRoad": {
    "name": [
      {
        "value": "Rue de Toulouse",
        "language": "fr"
      },
      {
        "value": "Toulousestraat",
        "language": "nl"
      }
    ]
  }
}

For more information about turn-by-turn actions, see turn-by-turn guidance.

Spans example

The same is valid for spans. In the following examples, we request a route in Saudi Arabia. Since the roads also have English names, if no language preference is set (which means that the default value en-US is used), English names will have priority:

curl -X GET \
'https://router.hereapi.com/v8/routes?transportMode=car&origin=25.525408,48.257112&destination=25.523303,48.274016&return=polyline,summary,actions,instructions,turnByTurnActions&spans=names,routeNumbers&apikey={YOUR_API_KEY}'
{
  "spans": [
    {
      "offset": 0,
      "names": [
        {
          "value": "Dammam Road",
          "language": "en"
        },
        {
          "value": "طريق الدمام",
          "language": "ar"
        },
        {
          "value": "Dammam Road",
          "language": "en-AE"
        }
      ],
      "routeNumbers": [
        {
          "value": "M80",
          "language": "en"
        },
        {
          "value": "40",
          "language": "ar"
        },
        {
          "value": "م80",
          "language": "ar"
        },
        {
          "value": "40",
          "language": "en-AE"
        },
        {
          "value": "M80",
          "language": "en-AE"
        }
      ]
    }
  ]
}

If we change the preferred language to Arabic, the ordering of the names and routeNumbers in the response will change accordingly:

curl -X GET \
'https://router.hereapi.com/v8/routes?transportMode=car&origin=25.525408,48.257112&destination=25.523303,48.274016&return=polyline,summary,actions,instructions,turnByTurnActions&spans=names,routeNumbers&lang=ar&apikey={YOUR_API_KEY}'
{
  "spans": [
    {
      "offset": 0,
      "names": [
        {
          "value": "طريق الدمام",
          "language": "ar"
        },
        {
          "value": "Dammam Road",
          "language": "en-AE"
        },
        {
          "value": "Dammam Road",
          "language": "en"
        }
      ],
      "routeNumbers": [
        {
          "value": "40",
          "language": "ar"
        },
        {
          "value": "م80",
          "language": "ar"
        },
        {
          "value": "40",
          "language": "en-AE"
        },
        {
          "value": "M80",
          "language": "en-AE"
        },
        {
          "value": "M80",
          "language": "en"
        }
      ]
    }
  ]
}

For more information about spans, see spans.

results matching ""

    No results matching ""