TrueWay Matrix

FREEMIUM
Verified
Par TrueWay Team | Mise à jour 4 days ago | Mapping
Popularité

9.7 / 10

Latence

272ms

Niveau de service

100%

Health Check

N/A

LISEZ-MOI

Features and capabilities:

  • Global road network coverage.
  • Calculate distances and durations between a set of origins and destinations.
  • Optionally calculate traffic based distance/duration matrices over a period of time.
  • Can avoid toll roads, highways or ferries.

Calculate distances and durations between a set of origins and destinations (CalculateDrivingDistanceMatrix).

A CalculateDrivingDistanceMatrix request takes a list of origins and destination locations and returns a matrix of distances and durations between them. The matrix element is the length/time of the optimal route between origin and destination points on the real road network.
Required parameters:

  • origins - List of origins described as semicolon-delimited coordinate pairs with latitudes and longitudes. Max: 25 per request.

Optional parameters:

  • destinations - List of destinations described as semicolon-delimited coordinate pairs with latitudes and longitudes. If not specified, an n x n matrix will be generated using the origins. Max: 25 per request.
  • start_time - Time when travel is expected to start. You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC or you can use “now” to specify the current time. The start_time must be set to the current time or some time in the future. It cannot be in the past.
  • avoid_highways - Avoid highways.
  • avoid_tolls - Avoid toll roads.
  • avoid_ferries - Avoid ferries.

Response

The response to the request returns a matrix of distances and durations between origins and destinations locations. Matrix rows correspond to origins and columns correspond to destinations. The response contains two-dimensional array of distances from origins to destinations “distances” and two-dimensional array of driving times(durations) from origins to destinations “durations”.

For example, for the matrix 4x4:

Request:

"origins":"40.629041,-74.025606;40.630099,-73.993521;40.644895,-74.013818;40.627177,-73.980853"
"destinations":"40.629041,-74.025606;40.630099,-73.993521;40.644895,-74.013818;40.627177,-73.980853"

Response:

{
"distances":[
  0:[
    0:0
    1:3939
    2:2077
    3:5418
    ]
  1:[
    0:4004
    1:0
    2:2609
    3:1480
    ]
  2:[
    0:2984
    1:2803
    2:0
    3:3646
    ]
  3:[
    0:5621
    1:2561
    2:5170
    3:0
    ]
]
"durations":[
  0:[
    0:0
    1:820
    2:476
    3:1092
    ]
  1:[
    0:867
    1:0
    2:736
    3:412
    ]
  2:[
    0:595
    1:752
    2:0
    3:1030
    ]
  3:[
    0:1134
    1:580
    2:1184
    3:0
    ]
]
}

From this response, we can see that the length of the route from the 2nd origin point to the 3rd destination point is 3646 m and time(duration) of the route is 1030 s.

Abonnés : 15
Ressources :
Site Web du produit
Créateur d'API :
Rapid account: True Way Team
TrueWay Team
trueway
Connectez-vous pour évaluer l'API
Note : 5 - Votes : 3