Route - Post Route Directions Batch
Use to send a batch of queries to the Get Route Directions API in a single asynchronous request.
The Post Route Directions Batch
API is an HTTP POST
request that sends batches of queries to the Get Route Directions API using a single asynchronous request. You can call Route Directions Batch
API to run either asynchronously (async) or synchronously (sync). The async API allows caller to batch up to 700 queries and sync API up to 100 queries. To call the Post Route Directions Batch
API in a synchronous request, see Post Route Directions Batch Sync.
Submit Asynchronous Batch Request
The Asynchronous API is appropriate for processing big volumes of relatively complex route requests
- It allows the retrieval of results in a separate call (multiple downloads are possible).
- The asynchronous API is optimized for reliability and is not expected to run into a timeout.
- The number of batch items is limited to 700 for this API.
When you make a request by using async request, by default the service returns a 202 response code along a redirect URL in the Location field of the response header. This URL should be checked periodically until the response data or error information is available. The asynchronous responses are stored for 24 hours. The redirect URL returns a 404 response if used after the expiration period.
Please note that asynchronous batch request is a long-running operation. Here's a typical sequence of operations:
- Client sends a Route Directions Batch
POST
request to Azure Maps.
POST https://atlas.microsoft.com/route/directions/batch/json?api-version=1.0&subscription-key={subscription-key}
The server will respond with one of the following:
HTTP
202 Accepted
- Batch request has been accepted.HTTP
Error
- There was an error processing your Batch request. This could either be a400 Bad Request
or any otherError
status code.If the batch request was accepted successfully, the
Location
header in the response contains the URL to download the results of the batch request. This status URI looks like following:
GET https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key}
- Client issues a
GET
request on the download URL obtained in Step 3 to download the batch results.
POST Body for Batch Request
To send the route directions queries you will use a POST
request where the request body will contain the batchItems
array in json
format and the Content-Type
header will be set to application/json
. Here's a sample request body containing 3 route directions queries:
{
"batchItems": [
{ "query": "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false" },
{ "query": "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest" },
{ "query": "?query=48.923159,-122.557362:32.621279,-116.840362" }
]
}
A route directions query in a batch is just a partial URL without the protocol, base URL, path, api-version and subscription-key. It can accept any of the supported route directions URI parameters. The string values in the route directions query must be properly escaped (e.g. " character should be escaped with \ ) and it should also be properly URL-encoded.
The async API allows caller to batch up to 700 queries and sync API up to 100 queries, and the batch should contain at least 1 query.
Download Asynchronous Batch Results
To download the async batch results you will issue a GET
request to the batch download endpoint. This download URL can be obtained from the Location
header of a successful POST
batch request and looks like the following:
https://atlas.microsoft.com/route/directions/batch/{batch-id}?api-version=1.0&subscription-key={subscription-key}
Here's the typical sequence of operations for downloading the batch results:
Client sends a
GET
request using the download URL.The server will respond with one of the following:
HTTP
202 Accepted
- Batch request was accepted but is still being processed. Please try again in some time.HTTP
200 OK
- Batch request successfully processed. The response body contains all the batch results.
Batch Response Model
The returned data content is similar for async and sync requests. When downloading the results of an async batch request, if the batch has finished processing, the response body contains the batch response. This batch response contains a summary
component that indicates the totalRequests
that were part of the original batch request and successfulRequests
i.e. queries which were executed successfully. The batch response also includes a batchItems
array which contains a response for each and every query in the batch request. The batchItems
will contain the results in the exact same order the original queries were sent in the batch request. Each item in batchItems
contains statusCode
and response
fields. Each response
in batchItems
is of one of the following types:
RouteDirections
- If the query completed successfully.Error
- If the query failed. The response will contain acode
and amessage
in this case.
Here's a sample Batch Response with 1 successful and 1 failed result:
{
"summary": {
"successfulRequests": 1,
"totalRequests": 2
},
"batchItems": [
{
"statusCode": 200,
"response": {
"routes": [
{
"summary": {
"lengthInMeters": 1758,
"travelTimeInSeconds": 387,
"trafficDelayInSeconds": 0,
"departureTime": "2018-07-17T00:49:56+00:00",
"arrivalTime": "2018-07-17T00:56:22+00:00"
},
"legs": [
{
"summary": {
"lengthInMeters": 1758,
"travelTimeInSeconds": 387,
"trafficDelayInSeconds": 0,
"departureTime": "2018-07-17T00:49:56+00:00",
"arrivalTime": "2018-07-17T00:56:22+00:00"
},
"points": [
{
"latitude": 47.62094,
"longitude": -122.34892
},
{
"latitude": 47.62094,
"longitude": -122.3485
},
{
"latitude": 47.62095,
"longitude": -122.3476
}
]
}
],
"sections": [
{
"startPointIndex": 0,
"endPointIndex": 40,
"sectionType": "TRAVEL_MODE",
"travelMode": "bicycle"
}
]
}
]
}
},
{
"statusCode": 400,
"response":
{
"error":
{
"code": "400 BadRequest",
"message": "Bad request: one or more parameters were incorrectly specified or are mutually exclusive."
}
}
}
]
}
POST https://atlas.microsoft.com/route/directions/batch/json?api-version=1.0
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
format
|
path | True |
Desired format of the response. Only |
|
api-version
|
query | True |
string |
Version number of Azure Maps API. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
x-ms-client-id |
string |
Specifies which account is intended for usage in conjunction with the Microsoft Entra ID security model. It represents a unique ID for the Azure Maps account and can be retrieved from the Azure Maps management plane Account API. To use Microsoft Entra ID security in Azure Maps see the following articles for guidance. |
Request Body
Name | Type | Description |
---|---|---|
batchItems |
The list of queries to process. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Batch request successfully processed. The response body contains all the batch results. |
|
202 Accepted |
Supported only for async request. Request Accepted: The request has been accepted for processing. Please use the URL in the Location Header to retry or access the results. Headers Location: string |
|
Other Status Codes |
An unexpected error occurred. |
Security
AADToken
These are the Microsoft Entra OAuth 2.0 Flows. When paired with Azure role-based access control it can be used to control access to Azure Maps REST APIs. Azure role-based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built-in role or a custom role composed of one or more permissions to Azure Maps REST APIs.
To implement scenarios, we recommend viewing authentication concepts. In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.
Notes
- This security definition requires the use of the
x-ms-client-id
header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API.
The Authorization URL
is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Microsoft Entra ID configurations.
*
The Azure role-based access control is configured from the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.
*
Usage of the Azure Maps Web SDK allows for configuration based setup of an application for multiple use cases.
- For more information on Microsoft identity platform, see Microsoft identity platform overview.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
https://atlas.microsoft.com/.default | https://atlas.microsoft.com/.default |
subscription-key
This is a shared key that is provisioned when you Create an Azure Maps account in the Azure portal or using PowerShell, CLI, Azure SDKs, or REST API.
With this key, any application can access all REST API. In other words, this key can be used as a master key in the account that they are issued in.
For publicly exposed applications, our recommendation is to use the confidential client applications approach to access Azure Maps REST APIs so your key can be securely stored.
Type:
apiKey
In:
query
SAS Token
This is a shared access signature token is created from the List SAS operation on the Azure Maps resource through the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.
With this token, any application is authorized to access with Azure role-based access controls and fine-grain control to the expiration, rate, and region(s) of use for the particular token. In other words, the SAS Token can be used to allow applications to control access in a more secured way than the shared key.
For publicly exposed applications, our recommendation is to configure a specific list of allowed origins on the Map account resource to limit rendering abuse and regularly renew the SAS Token.
Type:
apiKey
In:
header
Examples
Successfully submit a route direction batch request
Sample request
POST https://atlas.microsoft.com/route/directions/batch/json?api-version=1.0
{
"batchItems": [
{
"query": "?query=47.639987,-122.128384:47.621252,-122.184408:47.596437,-122.332000&routeType=fastest&travelMode=car&maxAlternatives=99"
},
{
"query": "?query=47.620659,-122.348934:47.610101,-122.342015&travelMode=bicycle&routeType=eco&traffic=false"
},
{
"query": "?query=40.759856,-73.985108:40.771136,-73.973506&travelMode=pedestrian&routeType=shortest"
}
]
}
Sample response
{
"batchItems": [
{
"statusCode": 400,
"response": {
"error": {
"code": "400 BadRequest",
"message": "maxAlternatives parameter value should be between 0 and 5 inclusive"
}
}
},
{
"statusCode": 200,
"response": {
"formatVersion": "0.0.12",
"routes": [
{
"summary": {
"lengthInMeters": 1754,
"travelTimeInSeconds": 386,
"trafficDelayInSeconds": 0,
"departureTime": "2019-06-21T22:56:23+00:00",
"arrivalTime": "2019-06-21T23:02:49+00:00"
},
"legs": [
{
"summary": {
"lengthInMeters": 1754,
"travelTimeInSeconds": 386,
"trafficDelayInSeconds": 0,
"departureTime": "2019-06-21T22:56:23+00:00",
"arrivalTime": "2019-06-21T23:02:49+00:00"
},
"points": [
{
"latitude": 47.62094,
"longitude": -122.34892
},
{
"latitude": 47.62094,
"longitude": -122.3485
},
{
"latitude": 47.62095,
"longitude": -122.3476
},
{
"latitude": 47.60995,
"longitude": -122.34174
},
{
"latitude": 47.61011,
"longitude": -122.342
}
]
}
],
"sections": [
{
"startPointIndex": 0,
"endPointIndex": 44,
"sectionType": "TRAVEL_MODE",
"travelMode": "bicycle"
}
]
}
]
}
},
{
"statusCode": 200,
"response": {
"formatVersion": "0.0.12",
"routes": [
{
"summary": {
"lengthInMeters": 1772,
"travelTimeInSeconds": 1276,
"trafficDelayInSeconds": 0,
"departureTime": "2019-06-21T22:56:23+00:00",
"arrivalTime": "2019-06-21T23:17:38+00:00"
},
"legs": [
{
"summary": {
"lengthInMeters": 1772,
"travelTimeInSeconds": 1276,
"trafficDelayInSeconds": 0,
"departureTime": "2019-06-21T22:56:23+00:00",
"arrivalTime": "2019-06-21T23:17:38+00:00"
},
"points": [
{
"latitude": 40.75982,
"longitude": -73.98493
},
{
"latitude": 40.7601,
"longitude": -73.98483
},
{
"latitude": 40.75984,
"longitude": -73.98417
},
{
"latitude": 40.76047,
"longitude": -73.9837
},
{
"latitude": 40.77095,
"longitude": -73.9736
},
{
"latitude": 40.77114,
"longitude": -73.97356
}
]
}
],
"sections": [
{
"startPointIndex": 0,
"endPointIndex": 47,
"sectionType": "TRAVEL_MODE",
"travelMode": "pedestrian"
}
]
}
]
}
}
],
"summary": {
"successfulRequests": 2,
"totalRequests": 3
}
}
operation-Location: URL to download the results of the long-running batch request.
Definitions
Name | Description |
---|---|
Batch |
This type represents the request body for the Batch service. |
Batch |
Batch request object |
Delay |
The magnitude of delay caused by the incident. These values correspond to the values of the response field ty of the Get Traffic Incident Detail API. |
Driving |
Indicates left-hand vs. right-hand side driving at the point of the maneuver. |
Effective |
Effective parameter or data used when calling this Route API. |
Error |
The resource management error additional info. |
Error |
The error detail. |
Error |
Error response |
Guidance |
Type of the instruction, e.g., turn or change of road form. |
Guidance |
A code identifying the maneuver. |
Json |
Desired format of the response. Only |
Junction |
The type of the junction where the maneuver takes place. For larger roundabouts, two separate instructions are generated for entering and leaving the roundabout. |
Lat |
A location represented as a latitude and longitude. |
Response |
The result of the query. RouteDirections if the query completed successfully, ErrorResponse otherwise. |
Response |
Section types of the reported route response |
Response |
Travel mode for the calculated route. The value will be set to |
Route | |
Route |
An item returned from Route Directions Batch service call. |
Route |
This object is returned from a successful Route Directions Batch service call. |
Route |
Contains guidance related elements. This field is present only when guidance was requested and is available. |
Route |
A set of attributes describing a maneuver, e.g. 'Turn right', 'Keep left', 'Take the ferry', 'Take the motorway', 'Arrive'. |
Route |
Groups a sequence of instruction elements which are related to each other. The sequence range is constrained with firstInstructionIndex and lastInstructionIndex. When human-readable text messages are requested for guidance (instructionType=text or tagged), then the instructionGroup has a summary message returned when available. |
Route |
A description of a part of a route, comprised of a list of points. Each additional waypoint provided in the request will result in an additional leg in the returned route. |
Route |
Summary object for route section. |
Route |
Optimized way point object. |
Route |
Reports the effective settings used in the current call. |
Route |
Route sections contain additional information about parts of a route. Each section contains at least the elements |
Route |
Details of the traffic event, using definitions in the TPEG2-TEC standard. Can contain effectCode and causes elements. |
Route |
The cause of the traffic event. Can contain mainCauseCode and subCauseCode elements. Can be used to define iconography and descriptions. |
Route |
Summary object |
Simple |
Type of the incident. Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or OTHER. See "tec" for detailed information. |
Summary |
Summary of the results for the batch request |
BatchRequest
This type represents the request body for the Batch service.
Name | Type | Description |
---|---|---|
batchItems |
The list of queries to process. |
BatchRequestItem
Batch request object
Name | Type | Description |
---|---|---|
query |
string |
This parameter contains a query string used to perform an unstructured geocoding operation. The query string will be passed verbatim to the search API for processing. |
DelayMagnitude
The magnitude of delay caused by the incident. These values correspond to the values of the response field ty of the Get Traffic Incident Detail API.
Name | Type | Description |
---|---|---|
0 |
string |
Unknown. |
1 |
string |
Minor. |
2 |
string |
Moderate. |
3 |
string |
Major. |
4 |
string |
Undefined, used for road closures and other indefinite delays. |
DrivingSide
Indicates left-hand vs. right-hand side driving at the point of the maneuver.
Name | Type | Description |
---|---|---|
LEFT |
string |
Left side. |
RIGHT |
string |
Right side. |
EffectiveSetting
Effective parameter or data used when calling this Route API.
Name | Type | Description |
---|---|---|
key |
string |
Name of the parameter used. |
value |
string |
Value of the parameter used. |
ErrorAdditionalInfo
The resource management error additional info.
Name | Type | Description |
---|---|---|
info |
object |
The additional info. |
type |
string |
The additional info type. |
ErrorDetail
The error detail.
Name | Type | Description |
---|---|---|
additionalInfo |
The error additional info. |
|
code |
string |
The error code. |
details |
The error details. |
|
message |
string |
The error message. |
target |
string |
The error target. |
ErrorResponse
Error response
Name | Type | Description |
---|---|---|
error |
The error object. |
GuidanceInstructionType
Type of the instruction, e.g., turn or change of road form.
Name | Type | Description |
---|---|---|
DIRECTION_INFO |
string |
Direction information. |
LOCATION_ARRIVAL |
string |
Arrival location. |
LOCATION_DEPARTURE |
string |
Departure location. |
LOCATION_WAYPOINT |
string |
Way point location. |
ROAD_CHANGE |
string |
Road Change. |
TURN |
string |
Turn. |
GuidanceManeuver
A code identifying the maneuver.
Name | Type | Description |
---|---|---|
ARRIVE |
string |
You have arrived. |
ARRIVE_LEFT |
string |
You have arrived. Your destination is on the left. |
ARRIVE_RIGHT |
string |
You have arrived. Your destination is on the right. |
BEAR_LEFT |
string |
Bear left. |
BEAR_RIGHT |
string |
Bear right. |
DEPART |
string |
Leave. |
ENTER_FREEWAY |
string |
Take the freeway. |
ENTER_HIGHWAY |
string |
Take the highway. |
ENTER_MOTORWAY |
string |
Take the motorway. |
ENTRANCE_RAMP |
string |
Take the ramp. |
FOLLOW |
string |
Follow. |
KEEP_LEFT |
string |
Keep left. |
KEEP_RIGHT |
string |
Keep right. |
MAKE_UTURN |
string |
Make a U-turn. |
MOTORWAY_EXIT_LEFT |
string |
Take the left exit. |
MOTORWAY_EXIT_RIGHT |
string |
Take the right exit. |
ROUNDABOUT_BACK |
string |
Go around the roundabout. |
ROUNDABOUT_CROSS |
string |
Cross the roundabout. |
ROUNDABOUT_LEFT |
string |
At the roundabout take the exit on the left. |
ROUNDABOUT_RIGHT |
string |
At the roundabout take the exit on the right. |
SHARP_LEFT |
string |
Turn sharp left. |
SHARP_RIGHT |
string |
Turn sharp right. |
STRAIGHT |
string |
Keep straight on. |
SWITCH_MAIN_ROAD |
string |
Switch to the main road. |
SWITCH_PARALLEL_ROAD |
string |
Switch to the parallel road. |
TAKE_EXIT |
string |
Take the exit. |
TAKE_FERRY |
string |
Take the ferry. |
TRY_MAKE_UTURN |
string |
Try to make a U-turn. |
TURN_LEFT |
string |
Turn left. |
TURN_RIGHT |
string |
Turn right. |
WAYPOINT_LEFT |
string |
You have reached the waypoint. It is on the left. |
WAYPOINT_REACHED |
string |
You have reached the waypoint. |
WAYPOINT_RIGHT |
string |
You have reached the waypoint. It is on the right. |
JsonFormat
Desired format of the response. Only json
format is supported.
Name | Type | Description |
---|---|---|
json |
string |
JunctionType
The type of the junction where the maneuver takes place. For larger roundabouts, two separate instructions are generated for entering and leaving the roundabout.
Name | Type | Description |
---|---|---|
BIFURCATION |
string |
bifurcation |
REGULAR |
string |
regular |
ROUNDABOUT |
string |
roundabout |
LatLongPair
A location represented as a latitude and longitude.
Name | Type | Description |
---|---|---|
latitude |
number |
Latitude property |
longitude |
number |
Longitude property |
Response
The result of the query. RouteDirections if the query completed successfully, ErrorResponse otherwise.
Name | Type | Description |
---|---|---|
error |
The error object. |
|
formatVersion |
string |
Format Version property |
optimizedWaypoints |
Optimized sequence of waypoints. It shows the index from the user provided waypoint sequence for the original and optimized list. For instance, a response:
means that the original sequence is [0, 1, 2] and optimized sequence is [1, 2, 0]. Since the index starts by 0 the original is "first, second, third" while the optimized is "second, third, first". |
|
report |
Reports the effective settings used in the current call. |
|
routes |
Route[] |
Routes array |
ResponseSectionType
Section types of the reported route response
Name | Type | Description |
---|---|---|
CARPOOL |
string |
Sections of the route that require use of carpool (HOV/High Occupancy Vehicle) lanes. |
CAR_TRAIN |
string |
Sections of the route that are cars or trains. |
COUNTRY |
string |
Sections indicating which countries/regions the route is in. |
FERRY |
string |
Sections of the route that are ferries. |
MOTORWAY |
string |
Sections of the route that are motorways. |
PEDESTRIAN |
string |
Sections of the route that are only suited for pedestrians. |
TOLL_ROAD |
string |
Sections of the route that require a toll to be payed. |
TOLL_VIGNETTE |
string |
Sections of the route that require a toll vignette to be present. |
TRAFFIC |
string |
Sections of the route that contain traffic information. |
TRAVEL_MODE |
string |
Sections in relation to the request parameter |
TUNNEL |
string |
Sections of the route that are tunnels. |
URBAN |
string |
Sections of the route that are located within urban areas. |
ResponseTravelMode
Travel mode for the calculated route. The value will be set to other
if the requested mode of transport is not possible in this section
Name | Type | Description |
---|---|---|
bicycle |
string |
The returned routes are optimized for bicycles, including use of bicycle lanes. |
bus |
string |
The returned routes are optimized for buses, including the use of bus only lanes. BETA functionality. |
car |
string |
The returned routes are optimized for cars. |
motorcycle |
string |
The returned routes are optimized for motorcycles. BETA functionality. |
other |
string |
The given mode of transport is not possible in this section |
pedestrian |
string |
The returned routes are optimized for pedestrians, including the use of sidewalks. |
taxi |
string |
The returned routes are optimized for taxis. BETA functionality. |
truck |
string |
The returned routes are optimized for commercial vehicles, like for trucks. |
van |
string |
The returned routes are optimized for vans. BETA functionality. |
Route
Name | Type | Description |
---|---|---|
guidance |
Contains guidance related elements. This field is present only when guidance was requested and is available. |
|
legs |
Route |
Legs array |
sections |
Sections array |
|
summary |
Summary object |
RouteDirectionsBatchItem
An item returned from Route Directions Batch service call.
Name | Type | Description |
---|---|---|
response |
The result of the query. RouteDirections if the query completed successfully, ErrorResponse otherwise. |
|
statusCode |
integer |
HTTP request status code. |
RouteDirectionsBatchResult
This object is returned from a successful Route Directions Batch service call.
Name | Type | Description |
---|---|---|
batchItems |
Array containing the batch results. |
|
summary |
Summary of the results for the batch request |
RouteGuidance
Contains guidance related elements. This field is present only when guidance was requested and is available.
Name | Type | Description |
---|---|---|
instructionGroups |
Groups a sequence of instruction elements which are related to each other. |
|
instructions |
A list of instructions describing maneuvers. |
RouteInstruction
A set of attributes describing a maneuver, e.g. 'Turn right', 'Keep left', 'Take the ferry', 'Take the motorway', 'Arrive'.
Name | Type | Description |
---|---|---|
combinedMessage |
string |
A human-readable message for the maneuver combined with the message from the next instruction. Sometimes it is possible to combine two successive instructions into a single instruction making it easier to follow. When this is the case the possibleCombineWithNext flag will be true. For example:
The possibleCombineWithNext flag on instruction 10 is true. This indicates to the clients of coded guidance that it can be combined with instruction 11. The instructions will be combined automatically for clients requesting human-readable guidance. The combinedMessage field contains the combined message:
|
countryCode |
string |
3-character ISO 3166-1 alpha-3 country code. E.g. USA. |
drivingSide |
Indicates left-hand vs. right-hand side driving at the point of the maneuver. |
|
exitNumber |
string |
The number(s) of a highway exit taken by the current maneuver. If an exit has multiple exit numbers, they will be separated by "," and possibly aggregated by "-", e.g., "10, 13-15". |
instructionType |
Type of the instruction, e.g., turn or change of road form. |
|
junctionType |
The type of the junction where the maneuver takes place. For larger roundabouts, two separate instructions are generated for entering and leaving the roundabout. |
|
maneuver |
A code identifying the maneuver. |
|
message |
string |
A human-readable message for the maneuver. |
point |
A location represented as a latitude and longitude. |
|
pointIndex |
integer |
The index of the point in the list of polyline "points" corresponding to the point of the instruction. |
possibleCombineWithNext |
boolean |
It is possible to optionally combine the instruction with the next one. This can be used to build messages like "Turn left and then turn right". |
roadNumbers |
string[] |
The road number(s) of the next significant road segment(s) after the maneuver, or of the road(s) to be followed. Example: ["E34", "N205"] |
roundaboutExitNumber |
integer |
This indicates which exit to take at a roundabout. |
routeOffsetInMeters |
integer |
Distance from the start of the route to the point of the instruction. |
signpostText |
string |
The text on a signpost which is most relevant to the maneuver, or to the direction that should be followed. |
stateCode |
string |
A subdivision (e.g., state) of the country, represented by the second part of an ISO 3166-2 code. This is only available for some countries/regions like the US, Canada, and Mexico. |
street |
string |
Street name of the next significant road segment after the maneuver, or of the street that should be followed. |
travelTimeInSeconds |
integer |
Estimated travel time up to the point corresponding to routeOffsetInMeters. |
turnAngleInDecimalDegrees |
integer |
Indicates the direction of an instruction. If junctionType indicates a turn instruction:
If junctionType indicates a bifurcation instruction:
|
RouteInstructionGroup
Groups a sequence of instruction elements which are related to each other. The sequence range is constrained with firstInstructionIndex and lastInstructionIndex. When human-readable text messages are requested for guidance (instructionType=text or tagged), then the instructionGroup has a summary message returned when available.
Name | Type | Description |
---|---|---|
firstInstructionIndex |
integer |
Index of the first instruction in the instructions and belonging to this group. |
groupLengthInMeters |
integer |
Length of the group. |
groupMessage |
string |
Summary message when human-readable text messages are requested for guidance (instructionType=text or tagged). |
lastInstructionIndex |
integer |
Index of the last instruction in the instructions and belonging to this group. |
RouteLeg
A description of a part of a route, comprised of a list of points. Each additional waypoint provided in the request will result in an additional leg in the returned route.
Name | Type | Description |
---|---|---|
points |
Points array |
|
summary |
Summary object for route section. |
RouteLegSummary
Summary object for route section.
Name | Type | Description |
---|---|---|
arrivalTime |
string |
The estimated arrival time for the route or leg. Time is in UTC. |
batteryConsumptionInkWh |
number |
Estimated electric energy consumption in kilowatt hours (kWh) using the Electric Consumption Model. Included if vehicleEngineType is set to electric and constantSpeedConsumptionInkWhPerHundredkm is specified. The value of batteryConsumptionInkWh includes the recuperated electric energy and can therefore be negative (which indicates gaining energy). If both maxChargeInkWh and currentChargeInkWh are specified, recuperation will be capped to ensure that the battery charge level never exceeds maxChargeInkWh. If neither maxChargeInkWh nor currentChargeInkWh are specified, unconstrained recuperation is assumed in the consumption calculation. |
departureTime |
string |
The estimated departure time for the route or leg. Time is in UTC. |
fuelConsumptionInLiters |
number |
Estimated fuel consumption in liters using the Combustion Consumption Model. Included if vehicleEngineType is set to combustion and constantSpeedConsumptionInLitersPerHundredkm is specified. The value will be non-negative. |
historicTrafficTravelTimeInSeconds |
integer |
Estimated travel time calculated using time-dependent historic traffic data. Included only if computeTravelTimeFor = all is used in the query. |
lengthInMeters |
integer |
Length In Meters property |
liveTrafficIncidentsTravelTimeInSeconds |
integer |
Estimated travel time calculated using real-time speed data. Included only if computeTravelTimeFor = all is used in the query. |
noTrafficTravelTimeInSeconds |
integer |
Estimated travel time calculated as if there are no delays on the route due to traffic conditions (e.g. congestion). Included only if computeTravelTimeFor = all is used in the query. |
trafficDelayInSeconds |
integer |
Estimated delay in seconds caused by the real-time incident(s) according to traffic information. For routes planned with departure time in the future, delays is always 0. To return additional travel times using different types of traffic information, parameter computeTravelTimeFor=all needs to be added. |
travelTimeInSeconds |
integer |
Estimated travel time in seconds property that includes the delay due to real-time traffic. Note that even when traffic=false travelTimeInSeconds still includes the delay due to traffic. If DepartAt is in the future, travel time is calculated using time-dependent historic traffic data. |
RouteOptimizedWaypoint
Optimized way point object.
Name | Type | Description |
---|---|---|
optimizedIndex |
integer |
Optimized way point index from the system. |
providedIndex |
integer |
Way point index provided by the user. |
RouteReport
Reports the effective settings used in the current call.
Name | Type | Description |
---|---|---|
effectiveSettings |
Effective parameters or data used when calling this Route API. |
RouteSection
Route sections contain additional information about parts of a route. Each section contains at least the elements startPointIndex
, endPointIndex
, and sectionType
.
Name | Type | Description |
---|---|---|
delayInSeconds |
integer |
Delay in seconds caused by the incident. |
effectiveSpeedInKmh |
integer |
Effective speed of the incident in km/h, averaged over its entire length. |
endPointIndex |
integer |
Index of the last point (offset 0) in the route this section applies to. |
magnitudeOfDelay |
The magnitude of delay caused by the incident. These values correspond to the values of the response field ty of the Get Traffic Incident Detail API. |
|
sectionType |
Section types of the reported route response |
|
simpleCategory |
Type of the incident. Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or OTHER. See "tec" for detailed information. |
|
startPointIndex |
integer |
Index of the first point (offset 0) in the route this section applies to. |
tec |
Details of the traffic event, using definitions in the TPEG2-TEC standard. Can contain effectCode and causes elements. |
|
travelMode |
Travel mode for the calculated route. The value will be set to |
RouteSectionTec
Details of the traffic event, using definitions in the TPEG2-TEC standard. Can contain effectCode and causes elements.
Name | Type | Description |
---|---|---|
causes |
Causes array |
|
effectCode |
integer |
The effect on the traffic flow. Contains a value in the tec001:EffectCode table, as defined in the TPEG2-TEC standard. Can be used to color-code traffic events according to severity. |
RouteSectionTecCause
The cause of the traffic event. Can contain mainCauseCode and subCauseCode elements. Can be used to define iconography and descriptions.
Name | Type | Description |
---|---|---|
mainCauseCode |
integer |
The main cause of the traffic event. Contains a value in the tec002:CauseCode table, as defined in the TPEG2-TEC standard. |
subCauseCode |
integer |
The subcause of the traffic event. Contains a value in the sub cause table defined by the mainCauseCode, as defined in the TPEG2-TEC standard. |
RouteSummary
Summary object
Name | Type | Description |
---|---|---|
arrivalTime |
string |
The estimated arrival time for the route or leg. Time is in UTC. |
departureTime |
string |
The estimated departure time for the route or leg. Time is in UTC. |
lengthInMeters |
integer |
Length In Meters property |
trafficDelayInSeconds |
integer |
Estimated delay in seconds caused by the real-time incident(s) according to traffic information. For routes planned with departure time in the future, delays is always 0. To return additional travel times using different types of traffic information, parameter computeTravelTimeFor=all needs to be added. |
travelTimeInSeconds |
integer |
Estimated travel time in seconds property that includes the delay due to real-time traffic. Note that even when traffic=false travelTimeInSeconds still includes the delay due to traffic. If DepartAt is in the future, travel time is calculated using time-dependent historic traffic data. |
SimpleCategory
Type of the incident. Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or OTHER. See "tec" for detailed information.
Name | Type | Description |
---|---|---|
JAM |
string |
Traffic jam. |
OTHER |
string |
Other. |
ROAD_CLOSURE |
string |
Road closure. |
ROAD_WORK |
string |
Road work. |
Summary
Summary of the results for the batch request
Name | Type | Description |
---|---|---|
successfulRequests |
integer |
Number of successful requests in the batch |
totalRequests |
integer |
Total number of requests in the batch |