The response of a Matrix Routing request is composed of arrays and other information.
Response arrays
Depending on the results parameter, the response contains one or several one-dimensional arrays.
For each combination, origins (i) and destinations (j) the expected result can be find using the formula:
result = i * N + j
with N, the number of destinations.
{
"distances": [
0,
569819,
571137,
0
],
"travelTimes": [
0,
27720,
27599,
0
],
"directDistanceFlags": [
false,
false,
false,
false
]
}
Direct distance
If a relation cannot be calculated using the road network, the relation is estimated using the direct distance ; i.e. the distance as the crow flies.
The direct distance and estimated travel time is calculated from the geographical distance using the following fields:
- detourFactor: the factor that describes the average detour an actual route on the road requires, compared to the geographical distance.
- averageSpeed: the average speed of the vehicle. It is used to estimate the travel time.
If all relations can be calculated, the percentageOfDirectDistanceRelations is equal to zero.
{
"percentageOfDirectDistanceRelations": 0
}