GuidesAPI Reference
Guides

Profiles in matrix calculations

One way to have the Matrix Routing service support the calculation of routing matrices with routes of arbitrary length is by choosing a profile. A profile is a set of predefined options.

Using profiles comes with two limitations:

  1. The set of options is not customizable.
  2. Only non-time aware routing is supported. In particular, dynamic traffic information is not taken into account and only free-flow speeds based on historical traffic are applied.

The service supports a set of predefined profiles, which is available under the endpoint /v8/profiles. This endpoint returns the list of profiles with their corresponding profileId and predefined options.

For a list of available profiles, see the /v8/profiles endpoint.

For a different way to support the calculation of routing matrices with routes of arbitrary length, see Modes in HERE Matrix Routing API v8.

Request

To calculate a matrix using a profile, specify a profile id from the above list as profile parameter and set the required region definition parameter to the special variant world.

When you select a profile, all request options and their values are provided by the profile definition.

The only four options you can define manually when using a profile are:

  • origins
  • destinations
  • regionDefinition
  • matrixAttributes

Example:

{
    "origins": [
        { "lat": 52.54, "lng": 13.40 },  // Berlin
        { "lat": 50.43, "lng": 30.52 },  // Kyiv
        { "lat": 51.50, "lng": -0.08 },  // London
        { "lat": 40.40, "lng": -3.68 },  // Madrid
        { "lat": 55.75, "lng": 37.60 },  // Moscow
        { "lat": 48.87, "lng":  2.33 },  // Paris
        { "lat": 41.90, "lng": 12.48 }   // Rome
    ],
    "profile": "carFast",   // one of the profile IDs from the list /v8/profiles
    "regionDefinition": {
        "type": "world"     // required
    },
    "matrixAttributes": ["travelTimes", "distances"]
}

Traffic

When a profile is used, the calculation of the matrix only considers free-flow speed based on the historical traffic. Therefore the departureTime parameter is always set to the special value any for all profiles. For a list of available profiles, see the /v8/profiles endpoint.