-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathindex.html
1574 lines (1569 loc) · 72 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
redirect_from: "/docs/api/"
---
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv='X-UA-Compatible' content='IE=11' />
<title>OSRM API Documentation</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href='css/base.css' rel='stylesheet' />
<link href='css/style.css' rel='stylesheet' />
<link href='css/railscasts.css' rel='stylesheet' />
</head>
<body>
<!--START--><div id='app'><div class="container unlimiter" data-reactroot="" data-reactid="1" data-react-checksum="1353866318"><div class="fixed-top fixed-right space-left16" data-reactid="2"><div class="fill-light col6 pin-right" data-reactid="3"></div></div><div class="space-top5 scroll-styled overflow-auto pad1 width16 sidebar fixed-left fill-dark dark" data-reactid="4"><div class="pad0x small" data-reactid="5"><div class="small pad0x quiet space-top1" data-reactid="6">HTTP API</div><a href="#general-options" class="line-height15 pad0x pad00y quiet block " data-reactid="7">General options</a><a href="#services" class="line-height15 pad0x pad00y quiet block " data-reactid="8">Services</a><a href="#result-objects" class="line-height15 pad0x pad00y quiet block " data-reactid="9">Result objects</a><div class="small pad0x quiet space-top1" data-reactid="10">libosrm C++ API</div><a href="#introduction" class="line-height15 pad0x pad00y quiet block " data-reactid="11">Introduction</a><a href="#important-interface-objects" class="line-height15 pad0x pad00y quiet block " data-reactid="12">Important interface objects</a><a href="#example-7" class="line-height15 pad0x pad00y quiet block " data-reactid="13">Example</a><a href="#workflow" class="line-height15 pad0x pad00y quiet block " data-reactid="14">Workflow</a></div></div><div class="space-left16" data-reactid="15"><div class="" data-reactid="16"><div class="clearfix" data-reactid="17"><div data-title="General options" class="keyline-top section contain clearfix " data-reactid="18"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="19"><h2 id="general-options">General options</h2>
<p>All OSRM HTTP requests use a common structure.</p>
<p>The following syntax applies to all services, except as noted.</p>
</div></div><div data-title="Requests" class="keyline-top section contain clearfix " data-reactid="20"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="21"><h3 id="requests">Requests</h3>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>service</code></td>
<td>One of the following values:
<a href="#route-service"><code>route</code></a>
,
<a href="#nearest-service"><code>nearest</code></a>
,
<a href="#table-service"><code>table</code></a>
,
<a href="#match-service"><code>match</code></a>
,
<a href="#trip-service"><code>trip</code></a>
,
<a href="#tile-service"><code>tile</code></a></td>
</tr>
<tr>
<td><code>version</code></td>
<td>Version of the protocol implemented by the service.
<code>v1</code>
for all OSRM 5.x installations</td>
</tr>
<tr>
<td><code>profile</code></td>
<td>Mode of transportation, is determined statically by the Lua profile that is used to prepare the data using
<code>osrm-extract</code>
. Typically
<code>car</code>
,
<code>bike</code>
or
<code>foot</code>
if using one of the supplied profiles.</td>
</tr>
<tr>
<td><code>coordinates</code></td>
<td>String of format
<code>{longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]</code>
or
<code>polyline({polyline}) or polyline6({polyline6})</code>
.</td>
</tr>
<tr>
<td><code>format</code></td>
<td>Only
<code>json</code>
is supported at the moment. This parameter is optional and defaults to
<code>json</code>
.</td>
</tr>
</tbody>
</table>
<p>Passing any <code>option=value</code> is optional. <code>polyline</code> follows Google's polyline format with precision 5 by default and can be generated using <a href="https://www.npmjs.com/package/polyline">this package</a>.</p>
<p>To pass parameters to each location some options support an array like encoding:</p>
<p><strong>Request options</strong></p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>bearings</td>
<td><code>{bearing};{bearing}[;{bearing} ...]</code></td>
<td>Limits the search to segments with given bearing in degrees towards true north in clockwise direction.</td>
</tr>
<tr>
<td>radiuses</td>
<td><code>{radius};{radius}[;{radius} ...]</code></td>
<td>Limits the search to given radius in meters.</td>
</tr>
<tr>
<td>generate
_
hints</td>
<td><code>true</code>
(default),
<code>false</code></td>
<td>Adds a Hint to the response which can be used in subsequent requests, see
<code>hints</code>
parameter.</td>
</tr>
<tr>
<td>hints</td>
<td><code>{hint};{hint}[;{hint} ...]</code></td>
<td>Hint from previous request to derive position in street network.</td>
</tr>
<tr>
<td>approaches</td>
<td><code>{approach};{approach}[;{approach} ...]</code></td>
<td>Keep waypoints on curb side.</td>
</tr>
</tbody>
</table>
<p>Where the elements follow the following format:</p>
<table>
<thead>
<tr>
<th>Element</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td>bearing</td>
<td><code>{value},{range}</code>
<code>integer 0 .. 360,integer 0 .. 180</code></td>
</tr>
<tr>
<td>radius</td>
<td><code>double >= 0</code>
or
<code>unlimited</code>
(default)</td>
</tr>
<tr>
<td>hint</td>
<td>Base64
<code>string</code></td>
</tr>
<tr>
<td>approach</td>
<td><code>curb</code>
or
<code>unrestricted</code>
(default)</td>
</tr>
</tbody>
</table>
<pre><code>{option}={element};{element}[;{element} ... ]
</code></pre>
<p>The number of elements must match exactly the number of locations. If you don't want to pass a value but instead use the default you can pass an empty <code>element</code>.</p>
<p>Example: 2nd location use the default value for <code>option</code>:</p>
<pre><code>{option}={element};;{element}
</code></pre>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="22"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/<span class="strong">{service}</span>/<span class="strong">{version}</span>/<span class="strong">{profile}</span>/<span class="strong">{coordinates}</span>[.<span class="strong">{format}</span>]?option=value&option=value</div>
</div>
<h4 id="example-requests">Example Requests</h4>
<pre class='hljs'><span class="hljs-comment"># Query on Berlin with three coordinates:</span>
curl <span class="hljs-string">'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'</span>
<span class="hljs-comment"># Using polyline:</span>
curl <span class="hljs-string">'http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g`E)?overview=false'</span></pre>
</div></div><div data-title="Responses" class="keyline-top section contain clearfix " data-reactid="23"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="24"><h3 id="responses">Responses</h3>
<p>Every response object has a <code>code</code> property containing one of the strings below or a service dependent code:</p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Ok</code></td>
<td>Request could be processed as expected.</td>
</tr>
<tr>
<td><code>InvalidUrl</code></td>
<td>URL string is invalid.</td>
</tr>
<tr>
<td><code>InvalidService</code></td>
<td>Service name is invalid.</td>
</tr>
<tr>
<td><code>InvalidVersion</code></td>
<td>Version is not found.</td>
</tr>
<tr>
<td><code>InvalidOptions</code></td>
<td>Options are invalid.</td>
</tr>
<tr>
<td><code>InvalidQuery</code></td>
<td>The query string is synctactically malformed.</td>
</tr>
<tr>
<td><code>InvalidValue</code></td>
<td>The successfully parsed query parameters are invalid.</td>
</tr>
<tr>
<td><code>NoSegment</code></td>
<td>One of the supplied input coordinates could not snap to street segment.</td>
</tr>
<tr>
<td><code>TooBig</code></td>
<td>The request size violates one of the service specific request size restrictions.</td>
</tr>
</tbody>
</table>
<ul>
<li><code>message</code> is a <strong>optional</strong> human-readable error message. All other status types are service dependent.</li>
<li>In case of an error the HTTP status code will be <code>400</code>. Otherwise the HTTP status code will be <code>200</code> and <code>code</code> will be <code>Ok</code>.</li>
</ul>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="25"><h4 id="example-response">Example response</h4>
<pre class='hljs'>{
<span class="hljs-attr">"code"</span>: <span class="hljs-string">"Ok"</span>,
<span class="hljs-attr">"message"</span>: <span class="hljs-string">"Everything worked"</span>
}</pre>
</div></div><div data-title="Services" class="keyline-top section contain clearfix " data-reactid="26"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="27"><h2 id="services">Services</h2>
</div></div><div data-title="Nearest service" class="keyline-top section contain clearfix " data-reactid="28"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="29"><h3 id="nearest-service">Nearest service</h3>
<p>Snaps a coordinate to the street network and returns the nearest <code>n</code> matches.</p>
<p>Where <code>coordinates</code> only supports a single <code>{longitude},{latitude}</code> entry.</p>
<p>In addition to the <a href="#general-options">general options</a> the following options are supported for this service:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>number</td>
<td><code>integer >= 1</code>
(default
<code>1</code>
)</td>
<td>Number of nearest segments that should be returned.</td>
</tr>
</tbody>
</table>
<p><strong>Response</strong></p>
<ul>
<li><code>code</code> if the request was successful <code>Ok</code> otherwise see the service dependent and general status codes.</li>
<li>
<p><code>waypoints</code> array of <code>Waypoint</code> objects sorted by distance to the input coordinate. Each object has at least the following additional properties:</p>
<ul>
<li><code>distance</code>: Distance in meters to the supplied input coordinate.</li>
</ul>
</li>
</ul>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="30"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>http://<span class="strong">{server}</span>/nearest/v1/<span class="strong">{profile}</span>/<span class="strong">{coordinates}</span>.json?number=<span class="strong">{number}</span></div>
</div>
<h4 id="example-requests-1">Example Requests</h4>
<pre class='hljs'><span class="hljs-comment"># Querying nearest three snapped locations of `13.388860,52.517037` with a bearing between `20° - 340°`.</span>
curl <span class="hljs-string">'http://router.project-osrm.org/nearest/v1/driving/13.388860,52.517037?number=3&bearings=0,20'</span></pre>
<h4 id="example-response-1">Example Response</h4>
<pre class='hljs'>{
<span class="hljs-attr">"waypoints"</span> : [
{
<span class="hljs-attr">"hint"</span> : <span class="hljs-string">"KSoKADRYroqUBAEAEAAAABkAAAAGAAAAAAAAABhnCQCLtwAA_0vMAKlYIQM8TMwArVghAwEAAQH1a66g"</span>,
<span class="hljs-attr">"distance"</span> : <span class="hljs-number">4.152629</span>,
<span class="hljs-attr">"name"</span> : <span class="hljs-string">"Friedrichstraße"</span>,
<span class="hljs-attr">"location"</span> : [
<span class="hljs-number">13.388799</span>,
<span class="hljs-number">52.517033</span>
]
},
{
<span class="hljs-attr">"hint"</span> : <span class="hljs-string">"KSoKADRYroqUBAEABgAAAAAAAAAAAAAAKQAAABhnCQCLtwAA7kvMAAxZIQM8TMwArVghAwAAAQH1a66g"</span>,
<span class="hljs-attr">"distance"</span> : <span class="hljs-number">11.811961</span>,
<span class="hljs-attr">"name"</span> : <span class="hljs-string">"Friedrichstraße"</span>,
<span class="hljs-attr">"location"</span> : [
<span class="hljs-number">13.388782</span>,
<span class="hljs-number">52.517132</span>
]
},
{
<span class="hljs-attr">"hint"</span> : <span class="hljs-string">"KioKgDbbDgCUBAEAAAAAABoAAAAAAAAAPAAAABlnCQCLtwAA50vMADJZIQM8TMwArVghAwAAAQH1a66g"</span>,
<span class="hljs-attr">"distance"</span> : <span class="hljs-number">15.872438</span>,
<span class="hljs-attr">"name"</span> : <span class="hljs-string">"Friedrichstraße"</span>,
<span class="hljs-attr">"location"</span> : [
<span class="hljs-number">13.388775</span>,
<span class="hljs-number">52.51717</span>
],
}
],
<span class="hljs-attr">"code"</span> : <span class="hljs-string">"Ok"</span>
}</pre>
</div></div><div data-title="Route service" class="keyline-top section contain clearfix " data-reactid="31"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="32"><h3 id="route-service">Route service</h3>
<p>Finds the fastest route between coordinates in the supplied order.</p>
<p>In addition to the <a href="#general-options">general options</a> the following options are supported for this service:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>alternatives</td>
<td><code>true</code>
,
<code>false</code>
(default), or Number</td>
<td>Search for alternative routes. Passing a number
<code>alternatives=n</code>
searches for up to
<code>n</code>
alternative routes.
*</td>
</tr>
<tr>
<td>steps</td>
<td><code>true</code>
,
<code>false</code>
(default)</td>
<td>Returned route steps for each route leg</td>
</tr>
<tr>
<td>annotations</td>
<td><code>true</code>
,
<code>false</code>
(default),
<code>nodes</code>
,
<code>distance</code>
,
<code>duration</code>
,
<code>datasources</code>
,
<code>weight</code>
,
<code>speed</code></td>
<td>Returns additional metadata for each coordinate along the route geometry.</td>
</tr>
<tr>
<td>geometries</td>
<td><code>polyline</code>
(default),
<code>polyline6</code>
,
<code>geojson</code></td>
<td>Returned route geometry format (influences overview and per step)</td>
</tr>
<tr>
<td>overview</td>
<td><code>simplified</code>
(default),
<code>full</code>
,
<code>false</code></td>
<td>Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.</td>
</tr>
<tr>
<td>continue
_
straight</td>
<td><code>default</code>
(default),
<code>true</code>
,
<code>false</code></td>
<td>Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile.</td>
</tr>
</tbody>
</table>
<p>* Please note that even if alternative routes are requested, a result cannot be guaranteed.</p>
<p><strong>Response</strong></p>
<ul>
<li><code>code</code> if the request was successful <code>Ok</code> otherwise see the service dependent and general status codes.</li>
<li><code>waypoints</code>: Array of <code>Waypoint</code> objects representing all waypoints in order:</li>
<li><code>routes</code>: An array of <code>Route</code> objects, ordered by descending recommendation rank.</li>
</ul>
<p>In case of error the following <code>code</code>s are supported in addition to the general ones:</p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>NoRoute</code></td>
<td>No route found.</td>
</tr>
</tbody>
</table>
<p>All other properties might be undefined.</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="33"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/route/v1/<span class="strong">{profile}</span>/<span class="strong">{coordinates}</span>?alternatives={true|false|number}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={full|simplified|false}&annotations={true|false}</div>
</div>
<h4 id="example-request">Example Request</h4>
<pre class='hljs'><span class="hljs-comment"># Query on Berlin with three coordinates and no overview geometry returned:</span>
curl <span class="hljs-string">'http://router.project-osrm.org/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false'</span></pre>
</div></div><div data-title="Table service" class="keyline-top section contain clearfix " data-reactid="34"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="35"><h3 id="table-service">Table service</h3>
<p>Computes the duration of the fastest route between all pairs of supplied coordinates.</p>
<p><strong>Coordinates</strong></p>
<p>In addition to the <a href="#general-options">general options</a> the following options are supported for this service:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>sources</td>
<td><code>{index};{index}[;{index} ...]</code>
or
<code>all</code>
(default)</td>
<td>Use location with given index as source.</td>
</tr>
<tr>
<td>destinations</td>
<td><code>{index};{index}[;{index} ...]</code>
or
<code>all</code>
(default)</td>
<td>Use location with given index as destination.</td>
</tr>
</tbody>
</table>
<p>Unlike other array encoded options, the length of <code>sources</code> and <code>destinations</code> can be <strong>smaller or equal</strong>
to number of input locations;</p>
<p><strong>Example:</strong></p>
<pre><code>sources=0;5;7&destinations=5;1;4;2;3;6
</code></pre>
<table>
<thead>
<tr>
<th>Element</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td><code>0 <= integer < #locations</code></td>
</tr>
</tbody>
</table>
<p><strong>Response</strong></p>
<ul>
<li><code>code</code> if the request was successful <code>Ok</code> otherwise see the service dependent and general status codes.</li>
<li><code>durations</code> array of arrays that stores the matrix in row-major order. <code>durations[i][j]</code> gives the travel time from
the i-th waypoint to the j-th waypoint. Values are given in seconds. Can be <code>null</code> if no route between <code>i</code> and <code>j</code> can be found.</li>
<li><code>sources</code> array of <code>Waypoint</code> objects describing all sources in order</li>
<li><code>destinations</code> array of <code>Waypoint</code> objects describing all destinations in order</li>
</ul>
<p>In case of error the following <code>code</code>s are supported in addition to the general ones:</p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>NoTable</code></td>
<td>No route found.</td>
</tr>
</tbody>
</table>
<p>All other properties might be undefined.</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="36"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/table/v1/<span class="strong">{profile}</span>/<span class="strong">{coordinates}</span>?<span class="strong">{sources}</span>=[<span class="strong">{elem}</span>...];&destinations=[<span class="strong">{elem}</span>...]</div>
</div>
<h4 id="example-request-1">Example Request</h4>
<pre class='hljs'><span class="hljs-comment"># Returns a 3x3 matrix:</span>
curl <span class="hljs-string">'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'</span>
<span class="hljs-comment"># Returns a 1x3 matrix</span>
curl <span class="hljs-string">'http://router.project-osrm.org/table/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?sources=0'</span>
<span class="hljs-comment"># Returns a asymmetric 3x2 matrix with from the polyline encoded locations `qikdcB}~dpXkkHz`:</span>
curl <span class="hljs-string">'http://router.project-osrm.org/table/v1/driving/polyline(egs_Iq_aqAppHzbHulFzeMe`EuvKpnCglA)?sources=0;1;3&destinations=2;4'</span></pre>
</div></div><div data-title="Match service" class="keyline-top section contain clearfix " data-reactid="37"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="38"><h3 id="match-service">Match service</h3>
<p>Map matching matches/snaps given GPS points to the road network in the most plausible way.
Please note the request might result multiple sub-traces. Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found.
The algorithm might not be able to match all points. Outliers are removed if they can not be matched successfully.</p>
<p>In addition to the <a href="#general-options">general options</a> the following options are supported for this service:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>steps</td>
<td><code>true</code>
,
<code>false</code>
(default)</td>
<td>Returned route steps for each route</td>
</tr>
<tr>
<td>geometries</td>
<td><code>polyline</code>
(default),
<code>polyline6</code>
,
<code>geojson</code></td>
<td>Returned route geometry format (influences overview and per step)</td>
</tr>
<tr>
<td>annotations</td>
<td><code>true</code>
,
<code>false</code>
(default),
<code>nodes</code>
,
<code>distance</code>
,
<code>duration</code>
,
<code>datasources</code>
,
<code>weight</code>
,
<code>speed</code></td>
<td>Returns additional metadata for each coordinate along the route geometry.</td>
</tr>
<tr>
<td>overview</td>
<td><code>simplified</code>
(default),
<code>full</code>
,
<code>false</code></td>
<td>Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.</td>
</tr>
<tr>
<td>timestamps</td>
<td><code>{timestamp};{timestamp}[;{timestamp} ...]</code></td>
<td>Timestamps for the input locations in seconds since UNIX epoch. Timestamps need to be monotonically increasing.</td>
</tr>
<tr>
<td>radiuses</td>
<td><code>{radius};{radius}[;{radius} ...]</code></td>
<td>Standard deviation of GPS precision used for map matching. If applicable use GPS accuracy.</td>
</tr>
<tr>
<td>gaps</td>
<td><code>split</code>
(default),
<code>ignore</code></td>
<td>Allows the input track splitting based on huge timestamp gaps between points.</td>
</tr>
<tr>
<td>tidy</td>
<td><code>true</code>
,
<code>false</code>
(default)</td>
<td>Allows the input track modification to obtain better matching quality for noisy tracks.</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td>timestamp</td>
<td><code>integer</code>
seconds since UNIX epoch</td>
</tr>
<tr>
<td>radius</td>
<td><code>double >= 0</code>
(default 5m)</td>
</tr>
</tbody>
</table>
<p>The radius for each point should be the standard error of the location measured in meters from the true location.
Use <code>Location.getAccuracy()</code> on Android or <code>CLLocation.horizontalAccuracy</code> on iOS.
This value is used to determine which points should be considered as candidates (larger radius means more candidates) and how likely each candidate is (larger radius means far-away candidates are penalized less).
The area to search is chosen such that the correct candidate should be considered 99.9% of the time (for more details see <a href="https://github.com/Project-OSRM/osrm-backend/pull/3184">this ticket</a>).</p>
<p><strong>Response</strong></p>
<ul>
<li><code>code</code> if the request was successful <code>Ok</code> otherwise see the service dependent and general status codes.</li>
<li>
<p><code>tracepoints</code>: Array of <code>Waypoint</code> objects representing all points of the trace in order.
If the trace point was ommited by map matching because it is an outlier, the entry will be <code>null</code>.
Each <code>Waypoint</code> object has the following additional properties:</p>
<ul>
<li><code>matchings_index</code>: Index to the <code>Route</code> object in <code>matchings</code> the sub-trace was matched to.</li>
<li><code>waypoint_index</code>: Index of the waypoint inside the matched route.</li>
<li><code>alternatives_count</code>: Number of probable alternative matchings for this trace point. A value of zero indicate that this point was matched unambiguously. Split the trace at these points for incremental map matching.</li>
</ul>
</li>
<li>
<p><code>matchings</code>: An array of <code>Route</code> objects that assemble the trace. Each <code>Route</code> object has the following additional properties:</p>
<ul>
<li><code>confidence</code>: Confidence of the matching. <code>float</code> value between 0 and 1. 1 is very confident that the matching is correct.</li>
</ul>
</li>
</ul>
<p>In case of error the following <code>code</code>s are supported in addition to the general ones:</p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>NoMatch</code></td>
<td>No matchings found.</td>
</tr>
</tbody>
</table>
<p>All other properties might be undefined.</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="39"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/match/v1/<span class="strong">{profile}</span>/<span class="strong">{coordinates}</span>?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}</div>
</div>
</div></div><div data-title="Trip service" class="keyline-top section contain clearfix " data-reactid="40"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="41"><h3 id="trip-service">Trip service</h3>
<p>The trip plugin solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm) for 10 or more waypoints and uses brute force for less than 10 waypoints.
The returned path does not have to be the fastest path. As TSP is NP-hard it only returns an approximation.
Note that all input coordinates have to be connected for the trip service to work.</p>
<p>In addition to the <a href="#general-options">general options</a> the following options are supported for this service:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>roundtrip</td>
<td><code>true</code>
(default),
<code>false</code></td>
<td>Returned route is a roundtrip (route returns to first location)</td>
</tr>
<tr>
<td>source</td>
<td><code>any</code>
(default),
<code>first</code></td>
<td>Returned route starts at
<code>any</code>
or
<code>first</code>
coordinate</td>
</tr>
<tr>
<td>destination</td>
<td><code>any</code>
(default),
<code>last</code></td>
<td>Returned route ends at
<code>any</code>
or
<code>last</code>
coordinate</td>
</tr>
<tr>
<td>steps</td>
<td><code>true</code>
,
<code>false</code>
(default)</td>
<td>Returned route instructions for each trip</td>
</tr>
<tr>
<td>annotations</td>
<td><code>true</code>
,
<code>false</code>
(default),
<code>nodes</code>
,
<code>distance</code>
,
<code>duration</code>
,
<code>datasources</code>
,
<code>weight</code>
,
<code>speed</code></td>
<td>Returns additional metadata for each coordinate along the route geometry.</td>
</tr>
<tr>
<td>geometries</td>
<td><code>polyline</code>
(default),
<code>polyline6</code>
,
<code>geojson</code></td>
<td>Returned route geometry format (influences overview and per step)</td>
</tr>
<tr>
<td>overview</td>
<td><code>simplified</code>
(default),
<code>full</code>
,
<code>false</code></td>
<td>Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all.</td>
</tr>
</tbody>
</table>
<p><strong>Fixing Start and End Points</strong></p>
<p>It is possible to explicitely set the start or end coordinate of the trip.
When source is set to <code>first</code>, the first coordinate is used as start coordinate of the trip in the output. When destination is set to <code>last</code>, the last coordinate will be used as destination of the trip in the returned output. If you specify <code>any</code>, any of the coordinates can be used as the first or last coordinate in the output.</p>
<p>However, if <code>source=any&destination=any</code> the returned round-trip will still start at the first input coordinate by default.</p>
<p>Currently, not all combinations of <code>roundtrip</code>, <code>source</code> and <code>destination</code> are supported.
Right now, the following combinations are possible:</p>
<table>
<thead>
<tr>
<th align="left">roundtrip</th>
<th align="left">source</th>
<th align="left">destination</th>
<th align="left">supported</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">true</td>
<td align="left">first</td>
<td align="left">last</td>
<td align="left"><strong>yes</strong></td>
</tr>
<tr>
<td align="left">true</td>
<td align="left">first</td>
<td align="left">any</td>
<td align="left"><strong>yes</strong></td>
</tr>
<tr>
<td align="left">true</td>
<td align="left">any</td>
<td align="left">last</td>
<td align="left"><strong>yes</strong></td>
</tr>
<tr>
<td align="left">true</td>
<td align="left">any</td>
<td align="left">any</td>
<td align="left"><strong>yes</strong></td>
</tr>
<tr>
<td align="left">false</td>
<td align="left">first</td>
<td align="left">last</td>
<td align="left"><strong>yes</strong></td>
</tr>
<tr>
<td align="left">false</td>
<td align="left">first</td>
<td align="left">any</td>
<td align="left">no</td>
</tr>
<tr>
<td align="left">false</td>
<td align="left">any</td>
<td align="left">last</td>
<td align="left">no</td>
</tr>
<tr>
<td align="left">false</td>
<td align="left">any</td>
<td align="left">any</td>
<td align="left">no</td>
</tr>
</tbody>
</table>
<ul>
<li><code>code</code>: if the request was successful <code>Ok</code> otherwise see the service dependent and general status codes.</li>
<li>
<p><code>waypoints</code>: Array of <code>Waypoint</code> objects representing all waypoints in input order. Each <code>Waypoint</code> object has the following additional properties:</p>
<ul>
<li><code>trips_index</code>: Index to <code>trips</code> of the sub-trip the point was matched to.</li>
<li><code>waypoint_index</code>: Index of the point in the trip.</li>
</ul>
</li>
<li><code>trips</code>: An array of <code>Route</code> objects that assemble the trace.</li>
</ul>
<p>In case of error the following <code>code</code>s are supported in addition to the general ones:</p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>NoTrips</code></td>
<td>No trips found because input coordinates are not connected.</td>
</tr>
<tr>
<td><code>NotImplemented</code></td>
<td>This request is not supported</td>
</tr>
</tbody>
</table>
<p>All other properties might be undefined.</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="42"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/trip/v1/<span class="strong">{profile}</span>/<span class="strong">{coordinates}</span>?roundtrip={true|false}&source{any|first}&destination{any|last}&steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}'</div>
</div>
<h4 id="example-requests-2">Example Requests</h4>
<pre class='hljs'><span class="hljs-comment"># Round trip in Berlin with three stops:</span>
curl <span class="hljs-string">'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219'</span></pre>
<pre class='hljs'><span class="hljs-comment"># Round trip in Berlin with four stops, starting at the first stop, ending at the last:</span>
curl <span class="hljs-string">'http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219;13.418555,52.523215?source=first&destination=last'</span></pre>
<h4 id="response">Response</h4>
</div></div><div data-title="Tile service" class="keyline-top section contain clearfix " data-reactid="43"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="44"><h3 id="tile-service">Tile service</h3>
<p>This service generates <a href="https://www.mapbox.com/developers/vector-tiles/">Mapbox Vector Tiles</a> that can be viewed with a vector-tile capable slippy-map viewer. The tiles contain road geometries and metadata that can be used to examine the routing graph. The tiles are generated directly from the data in-memory, so are in sync with actual routing results, and let you examine which roads are actually routable, and what weights they have applied.</p>
<p>The <code>x</code>, <code>y</code>, and <code>zoom</code> values are the same as described at <a href="https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames">https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames</a>, and are supported by vector tile viewers like <a href="https://www.mapbox.com/mapbox-gl-js/api/">Mapbox GL JS</a>.</p>
<p>The response object is either a binary encoded blob with a <code>Content-Type</code> of <code>application/x-protobuf</code>, or a <code>404</code> error. Note that OSRM is hard-coded to only return tiles from zoom level 12 and higher (to avoid accidentally returning extremely large vector tiles).</p>
<p>Vector tiles contain two layers:</p>
<p><code>speeds</code> layer:</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>speed</code></td>
<td><code>integer</code></td>
<td>the speed on that road segment, in km/h</td>
</tr>
<tr>
<td><code>is_small</code></td>
<td><code>boolean</code></td>
<td>whether this segment belongs to a small (< 1000 node)
<a href="https://en.wikipedia.org/wiki/Strongly_connected_component">strongly connected component</a></td>
</tr>
<tr>
<td><code>datasource</code></td>
<td><code>string</code></td>
<td>the source for the speed value (normally
<code>lua profile</code>
unless you're using the
<a href="https://github.com/Project-OSRM/osrm-backend/wiki/Traffic">traffic update feature</a>
, in which case it contains the stem of the filename that supplied the speed value for this segment</td>
</tr>
<tr>
<td><code>duration</code></td>
<td><code>float</code></td>
<td>how long this segment takes to traverse, in seconds. This value is to calculate the total route ETA.</td>
</tr>
<tr>
<td><code>weight</code></td>
<td><code>integer</code></td>
<td>how long this segment takes to traverse, in units (may differ from
<code>duration</code>
when artificial biasing is applied in the Lua profiles). ACTUAL ROUTING USES THIS VALUE.</td>
</tr>
<tr>
<td><code>name</code></td>
<td><code>string</code></td>
<td>the name of the road this segment belongs to</td>
</tr>
<tr>
<td><code>rate</code></td>
<td><code>float</code></td>
<td>the value of
<code>length/weight</code>
- analagous to
<code>speed</code>
, but using the
<code>weight</code>
value rather than
<code>duration</code>
, rounded to the nearest integer</td>
</tr>
</tbody>
</table>
<p><code>turns</code> layer:</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bearing_in</code></td>
<td><code>integer</code></td>
<td>the absolute bearing that approaches the intersection. -180 to +180, 0 = North, 90 = East</td>
</tr>
<tr>
<td><code>turn_angle</code></td>
<td><code>integer</code></td>
<td>the angle of the turn, relative to the
<code>bearing_in</code>
. -180 to +180, 0 = straight ahead, 90 = 90-degrees to the right</td>
</tr>
<tr>
<td><code>cost</code></td>
<td><code>float</code></td>
<td>the time we think it takes to make that turn, in seconds. May be negative, depending on how the data model is constructed (some turns get a "bonus").</td>
</tr>
<tr>
<td><code>weight</code></td>
<td><code>float</code></td>
<td>the weight we think it takes to make that turn. May be negative, depending on how the data model is constructed (some turns get a "bonus"). ACTUAL ROUTING USES THIS VALUE</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid="45"><div class='endpoint dark fill-dark round '>
<div class='round-left pad0y pad1x fill-lighten0 code small endpoint-method'>GET</div>
<div class='pad0 code small endpoint-url'>/tile/v1/<span class="strong">{profile}</span>/tile(<span class="strong">{x}</span>,<span class="strong">{y}</span>,<span class="strong">{zoom}</span>).mvt</div>
</div>
<h4 id="example-request-2">Example request</h4>
<pre class='hljs'><span class="hljs-comment"># This fetches a Z=13 tile for downtown San Francisco:</span>
curl <span class="hljs-string">'http://router.project-osrm.org/tile/v1/car/tile(1310,3166,13).mvt'</span></pre>
<h4 id="example-response-2">Example response</h4>
<blockquote>
<p><img src="images/example-tile-response.png" alt="example rendered tile">
<a href="http://map.project-osrm.org/debug/#14.33/52.5212/13.3919">http://map.project-osrm.org/debug/#14.33/52.5212/13.3919</a></p>
</blockquote>
</div></div><div data-title="Result objects" class="keyline-top section contain clearfix " data-reactid="46"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="47"><h2 id="result-objects">Result objects</h2>
</div></div><div data-title="Route object" class="keyline-top section contain clearfix " data-reactid="48"><div class="space-bottom8 col6 pad2x prose clip" data-reactid="49"><h3 id="route-object">Route object</h3>
<p>Represents a route through (potentially multiple) waypoints.</p>
<p><strong>Properties</strong></p>
<ul>
<li><code>distance</code>: The distance traveled by the route, in <code>float</code> meters.</li>
<li><code>duration</code>: The estimated travel time, in <code>float</code> number of seconds.</li>
<li><code>geometry</code>: The whole geometry of the route value depending on <code>overview</code> parameter, format depending on the <code>geometries</code> parameter. See <code>RouteStep</code>'s <code>geometry</code> property for a parameter documentation.</li>
<li><code>weight</code>: The calculated weight of the route.</li>
<li><code>weight_name</code>: The name of the weight profile used during extraction phase.</li>
</ul>
<table>
<thead>
<tr>
<th>overview</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>simplified</td>
<td>Geometry is simplified according to the highest zoom level it can still be displayed on full.</td>
</tr>
<tr>
<td>full</td>
<td>Geometry is not simplified.</td>
</tr>
<tr>
<td>false</td>
<td>Geometry is not added.</td>
</tr>
</tbody>
</table>
<ul>