Skip to content

Commit bdcde75

Browse files
author
farah-alyasari
committed
.
1 parent d40bf75 commit bdcde75

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

articles/azure-maps/how-to-use-best-practices-for-routing.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services: azure-maps
1010
manager: philmea
1111
---
1212

13-
# Best practices for Azure Maps Route Service
13+
# Best practices for Azure Maps Route service
1414

1515
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:
1616

@@ -32,7 +32,7 @@ For information about authentication in Azure Maps, see [Manage authentication i
3232

3333
This article uses the [Postman app](https://www.postman.com/downloads/) to build REST calls, but you can choose any API development environment.
3434

35-
## Choose between Route directions and Matrix routing
35+
## Choose between Route Directions and Matrix Routing
3636

3737
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.
3838

@@ -51,7 +51,7 @@ Consider calling Matrix Routing API if your scenario is to:
5151

5252
Here is a comparison to show some capabilities of the Route Directions and Matrix APIs:
5353

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 |
5555
| :--------------: | :--------------: | :--------------: | :--------------: | :--------------: | :--------------: |
5656
| Get Route Directions | 1 | | X | X | |
5757
| Post Route Directions | 1 | X | X | X | X |
@@ -76,7 +76,7 @@ If you include the **computeTravelTimeFor=all** parameter in your request, then
7676

7777
The next sections demonstrate how to make calls to the Route APIs using the discussed parameters.
7878

79-
### Sample Query
79+
### Sample query
8080

8181
In the first example below the departure time is set to the future, at the time of writing.
8282

@@ -99,7 +99,7 @@ The response contains a summary element, like the one below. Because the departu
9999
},
100100
```
101101

102-
### Sample Query
102+
### Sample query
103103

104104
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.
105105

@@ -130,47 +130,47 @@ The following image shows the `points` element.
130130

131131
<center>
132132

133-
![point list](media/how-to-use-best-practices-for-routing/points-list-hidden.png)
133+
![point list](media/how-to-use-best-practices-for-routing/points-list-hidden-img.png)
134134

135135
</center>
136136

137137
Expand the `point` element to see the list of coordinates for the path:
138138

139139
<center>
140140

141-
![point list](media/how-to-use-best-practices-for-routing/points-list.png)
141+
![point list](media/how-to-use-best-practices-for-routing/points-list-img.png)
142142

143143
</center>
144144

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://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).
146146

147147
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.
148148

149149
<center>
150150

151-
![Instructions type](media/how-to-use-best-practices-for-routing/instructions-type.png)
151+
![Instructions type](media/how-to-use-best-practices-for-routing/instructions-type-img.png)
152152

153153
</center>
154154

155155
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.
156156

157157
<center>
158158

159-
![Turn by turn instructions](media/how-to-use-best-practices-for-routing/instructions-turn-by-turn.png)
159+
![Turn by turn instructions](media/how-to-use-best-practices-for-routing/instructions-turn-by-turn-img.png)
160160

161161
</center>
162162

163163
<center>
164164

165-
![Summarized Instructions](media/how-to-use-best-practices-for-routing/instructions-summary.png)
165+
![Summarized Instructions](media/how-to-use-best-practices-for-routing/instructions-summary-img.png)
166166

167167
</center>
168168

169169
## Request a route for a commercial vehicle
170170

171171
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.
172172

173-
### Sample Query
173+
### Sample query
174174

175175
The sample request below queries a route for a commercial truck. The truck is carrying class 1 hazardous waste material.
176176

@@ -182,11 +182,11 @@ The Route API returns directions that accommodate the dimensions of the truck an
182182

183183
<center>
184184

185-
![Truck with class 1 hazwaste](media/how-to-use-best-practices-for-routing/truck-with-hazwaste.png)
185+
![Truck with class 1 hazwaste](media/how-to-use-best-practices-for-routing/truck-with-hazwaste-img.png)
186186

187187
</center>
188188

189-
### Sample Query
189+
### Sample query
190190

191191
Changing the US Hazmat Class, from the above query, will result in a different route to accommodate this change.
192192

@@ -198,15 +198,15 @@ The response below is for a truck carrying a class 9 hazardous material, which i
198198

199199
<center>
200200

201-
![Truck with class 9 hazwaste](media/how-to-use-best-practices-for-routing/truck-with-hazwaste9.png)
201+
![Truck with class 9 hazwaste](media/how-to-use-best-practices-for-routing/truck-with-hazwaste9-img.png)
202202

203203
</center>
204204

205205
## Request traffic information along a route
206206

207207
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.
208208

209-
### Sample Query
209+
### Sample query
210210

211211
The following query sets the `sectionType` to `traffic`. It requests the sections that contain traffic information from Seattle to San Diego.
212212

@@ -218,15 +218,15 @@ The response contains the sections that are suitable for traffic along the given
218218

219219
<center>
220220

221-
![traffic sections](media/how-to-use-best-practices-for-routing/traffic-section-type.png)
221+
![traffic sections](media/how-to-use-best-practices-for-routing/traffic-section-type-img.png)
222222

223223
</center>
224224

225225
This option can be used to color the sections when rendering the map, as in the image below:
226226

227227
<center>
228228

229-
![traffic sections](media/how-to-use-best-practices-for-routing/show-traffic-sections.png)
229+
![traffic sections](media/how-to-use-best-practices-for-routing/show-traffic-sections-img.png)
230230

231231
</center>
232232

@@ -242,7 +242,7 @@ For multi-stop routing, up to 150 waypoints may be specified in a single route r
242242

243243
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.
244244

245-
### Sample Query
245+
### Sample query
246246

247247
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.
248248

@@ -254,21 +254,21 @@ The response describes the path length to be 140,851 meters, and that it would t
254254

255255
<center>
256256

257-
![Non-optimized response](media/how-to-use-best-practices-for-routing/non-optimized-response.png)
257+
![Non-optimized response](media/how-to-use-best-practices-for-routing/non-optimized-response-img.png)
258258

259259
</center>
260260

261261
The image below illustrates the path resulting from this query. This path is one possible route. It's not the optimal path based on time or distance.
262262

263263
<center>
264264

265-
![Non-optimized image](media/how-to-use-best-practices-for-routing/non-optimized-image.png)
265+
![Non-optimized image](media/how-to-use-best-practices-for-routing/non-optimized-image-img.png)
266266

267267
</center>
268268

269269
This route waypoint order is: 0, 1, 2, 3, 4, 5, and 6.
270270

271-
### Sample Query
271+
### Sample query
272272

273273
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).
274274

@@ -280,15 +280,15 @@ The response describes the path length to be 91,814 meters, and that it would ta
280280

281281
<center>
282282

283-
![Non-optimized response](media/how-to-use-best-practices-for-routing/optimized-response.png)
283+
![Non-optimized response](media/how-to-use-best-practices-for-routing/optimized-response-img.png)
284284

285285
</center>
286286

287287
The image below illustrates the path resulting from this query.
288288

289289
<center>
290290

291-
![Non-optimized image](media/how-to-use-best-practices-for-routing/optimized-image.png)
291+
![Non-optimized image](media/how-to-use-best-practices-for-routing/optimized-image-img.png)
292292

293293
</center>
294294

@@ -312,7 +312,7 @@ The image below is an example of rendering alternative routes with specified dev
312312

313313
<center>
314314

315-
![Alternative routes](media/how-to-use-best-practices-for-routing/alternative-routes.png)
315+
![Alternative routes](media/how-to-use-best-practices-for-routing/alternative-routes-img.png)
316316

317317
</center>
318318

0 commit comments

Comments
 (0)