You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-maps/how-to-use-best-practices-for-routing.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ services: azure-maps
10
10
manager: philmea
11
11
---
12
12
13
-
# Best practices for Azure Maps Route Service
13
+
# Best practices for Azure Maps Route service
14
14
15
15
The Route Directions and Route Matrix APIs in Azure Maps [Route Service](https://docs.microsoft.com/rest/api/maps/route) can be used to calculate the estimated arrival times (ETAs) for each requested route. Route APIs consider factors such as real-time traffic information and historic traffic data, like the typical road speeds on the requested day of the week and time of day. The APIs return the shortest or fastest routes available to multiple destinations at a time in sequence or in optimized order, based on time or distance. Users can also request specialized routes and details for walkers, bicyclists, and commercial vehicles like trucks. In this article, we'll share the best practices to call Azure Maps [Route Service](https://docs.microsoft.com/rest/api/maps/route), and you'll learn how-to:
16
16
@@ -32,7 +32,7 @@ For information about authentication in Azure Maps, see [Manage authentication i
32
32
33
33
This article uses the [Postman app](https://www.postman.com/downloads/) to build REST calls, but you can choose any API development environment.
34
34
35
-
## Choose between Route directions and Matrix routing
35
+
## Choose between Route Directions and Matrix Routing
36
36
37
37
The Route Directions APIs return instructions including the travel time and the coordinates for a route path. The Route Matrix API lets you calculate the travel time and distances for a set of routes that are defined by origin and destination locations. For every given origin, the Matrix API calculates the cost (travel time and distance) of routing from that origin to every given destination. All of these APIs allow you to specify parameters such as the desired departure time, arrival times, and the vehicle type, like car or truck. They all use real-time or predictive traffic data accordingly to return the most optimal routes.
38
38
@@ -51,7 +51,7 @@ Consider calling Matrix Routing API if your scenario is to:
51
51
52
52
Here is a comparison to show some capabilities of the Route Directions and Matrix APIs:
53
53
54
-
| Azure Maps API | Max number of queries in the request | Avoid Areas| Truck and Electric Vehicle Routing| waypoints and Traveling Salesman | Supporting Points|
54
+
| Azure Maps API | Max number of queries in the request | Avoid areas| Truck and electric vehicle routing| waypoints and Traveling Salesman optimization | Supporting points|
@@ -76,7 +76,7 @@ If you include the **computeTravelTimeFor=all** parameter in your request, then
76
76
77
77
The next sections demonstrate how to make calls to the Route APIs using the discussed parameters.
78
78
79
-
### Sample Query
79
+
### Sample query
80
80
81
81
In the first example below the departure time is set to the future, at the time of writing.
82
82
@@ -99,7 +99,7 @@ The response contains a summary element, like the one below. Because the departu
99
99
},
100
100
```
101
101
102
-
### Sample Query
102
+
### Sample query
103
103
104
104
In the second example below, we have a real-time routing request, where departure time is now. It's not explicitly specified in the URL because it's the default value.
105
105
@@ -130,47 +130,47 @@ The following image shows the `points` element.
The Route Directions APIs support different formats of instructions that can be used by specifying the **instructionsType** parameter. To format instructions for easy computer processing, use **instructionsType=coded**. Use **instructionsType=tagged** to display instructions as text for the user. Also, instructions can be formatted as text where some elements of the instructions are marked, and the instruction is presented with special formatting. For more information, see the [list of supported instruction types](https://nam06.safelinks.protection.outlook.com/GetUrlReputation).
145
+
The Route Directions APIs support different formats of instructions that can be used by specifying the **instructionsType** parameter. To format instructions for easy computer processing, use **instructionsType=coded**. Use **instructionsType=tagged** to display instructions as text for the user. Also, instructions can be formatted as text where some elements of the instructions are marked, and the instruction is presented with special formatting. For more information, see the [list of supported instruction types](https://docs.microsoft.com/rest/api/maps/route/postroutedirections#routeinstructionstype).
146
146
147
147
When instructions are requested, the response returns a new element named `guidance`. The `guidance` element holds two pieces of information: turn-by-turn directions and summarized instructions.
The `instructions` element holds turn-by-turn directions for the trip, and the `instructionGroups` has summarized instructions. Each instruction summary covers a segment of the trip that could cover multiple roads. The APIs can return details for sections of a route. such as, the coordinate range of a traffic jam or the current speed of traffic.
156
156
157
157
<center>
158
158
159
-

159
+

Azure Maps Routing APIs support commercial vehicle routing, covering commercial trucks routing. The APIs consider specified limits. Such as, the height and weight of the vehicle, and if the vehicle is carrying hazardous cargo. For example, if a vehicle is carrying flammable, the routing engine avoid certain tunnels that are near residential areas.
172
172
173
-
### Sample Query
173
+
### Sample query
174
174
175
175
The sample request below queries a route for a commercial truck. The truck is carrying class 1 hazardous waste material.
176
176
@@ -182,11 +182,11 @@ The Route API returns directions that accommodate the dimensions of the truck an
182
182
183
183
<center>
184
184
185
-

185
+

186
186
187
187
</center>
188
188
189
-
### Sample Query
189
+
### Sample query
190
190
191
191
Changing the US Hazmat Class, from the above query, will result in a different route to accommodate this change.
192
192
@@ -198,15 +198,15 @@ The response below is for a truck carrying a class 9 hazardous material, which i
198
198
199
199
<center>
200
200
201
-

201
+

202
202
203
203
</center>
204
204
205
205
## Request traffic information along a route
206
206
207
207
With the Azure Maps Route Direction APIs, developers can request details for each section type by including the `sectionType` parameter in the request. For example, you can request the speed information for each traffic jam segment. Refer to the [list of values for the sectionType key](https://docs.microsoft.com/rest/api/maps/route/getroutedirections#sectiontype) to learn about the various details that you can request.
208
208
209
-
### Sample Query
209
+
### Sample query
210
210
211
211
The following query sets the `sectionType` to `traffic`. It requests the sections that contain traffic information from Seattle to San Diego.
212
212
@@ -218,15 +218,15 @@ The response contains the sections that are suitable for traffic along the given
@@ -242,7 +242,7 @@ For multi-stop routing, up to 150 waypoints may be specified in a single route r
242
242
243
243
If you want to optimize the best order to visit the given waypoints, then you need to specify **computeBestOrder=true**. This scenario is also known as the traveling salesman optimization problem.
244
244
245
-
### Sample Query
245
+
### Sample query
246
246
247
247
The following query requests the path for six waypoints, with the `computeBestOrder` parameter set to `false`. It's also the default value for the `computeBestOrder` parameter.
248
248
@@ -254,21 +254,21 @@ The response describes the path length to be 140,851 meters, and that it would t
This route waypoint order is: 0, 1, 2, 3, 4, 5, and 6.
270
270
271
-
### Sample Query
271
+
### Sample query
272
272
273
273
The following query requests the path for the same six waypoints, as in the above sample. This time, the `computeBestOrder` parameter set to `true` (the traveling salesman optimization).
274
274
@@ -280,15 +280,15 @@ The response describes the path length to be 91,814 meters, and that it would ta
0 commit comments