Output
The output from Get Travel Cost Matrix contains a number of route sequences, each containing the start and end points for the candidates used in the matrix route as well as the time and distance for each route that has been calculated. The output may contain all routes in the matrix, or only the optimal route between each start/end point, depending on how you configure the Optimize by option.
If Get Travel Cost Matrix cannot find a route between a start and end point in the matrix, an error will be logged in the server log but the routes that could be determined will be returned. For example, if you have start point A and end points 1 and 2, and Get Travel Cost Matrix can find a route from A to 1 but not from A to 2, Get Travel Cost Matrix will return the route from A to 1 and log an error that the route from A to 2 could not be determined.
Get Travel Cost Matrix output is either in list format or object format depending on how you configure the Return route cost matrix option. You cannot interact directly with object output.
Option |
Format |
Description |
---|---|---|
Distance | String |
The distance from the start point to the end point. The value is in the units indicated in the DistanceUnits element. |
DistanceUnits | String |
The unit of measurement used for distance. One of the following:
|
EndPointRef | String |
A reference ID that corresponds to the order in which the end points were specified in the input. The first end point specified has a reference ID of 1, the second has an ID of 2, and so on. You must develop your own process for associating the latitude/longitude coordinates in the input with the reference ID returned by Get Travel Cost Matrix. |
EndPointID | String |
An identification you assigned to the corresponding end point in the ID field of the Input stage. For example, the first end point could have an EndPointID of N, the second end point could have an EndPointID of O, and so on. Note: This field is active only when the Route Cost
Matrix Format field is set to
"Hierarchy."
|
StartPointRef | String |
A reference ID that corresponds to the order in which the start points were specified in the input. The first start point specified has a reference ID of 1, the second has an ID of 2, and so on. You must develop your own process for associating the latitude/longitude coordinates in the input with the reference ID returned by Get Travel Cost Matrix. |
StartPointID | String |
An identification you assigned to the corresponding start point in the ID field of the Input stage. For example, the first start point could have a StartPointID of A, the second start point could have a StartPointID of B, and so on. Note: This field is active only when the Route Cost
Matrix Format field is set to
"Hierarchy."
|
Time | String |
The total time from the start point to the end point. The value is in the units indicated in the TimeUnits element. |
TimeUnits | String |
The unit of measurement used for time. One of the following:
|
Status |
String [1] |
Reports the success or failure of the match.
|
Status.Code |
String [100] |
Reason for failure, if there is one. |
Status.Description |
String |
A description of failure indicated in Status.Code. |
Sample Output
The sample output below shows that the StartPointIDs assigned in the sample input (named A, B, and C upon input) correspond to the first three entries in the list of points (numbered 1, 2, and 3 respectively by Spectrum Technology Platform). It also shows that the first EndPointID (named X upon input) is the most efficient route from all three StartPointIDs, as compared to the other two EndPointIDs (named Y and Z upon input, not shown below because EndPointID X is the more efficient route).