@wemap/routers 12.0.0-alpha.1 → 12.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/assets/rr-wemap-multi-multi-level.json +6 -6
  2. package/assets/rr-wemap-multi-remote-indoor-indoor.json +20 -20
  3. package/assets/rr-wemap-multi-remote-indoor-outdoor-indoor.json +28 -45
  4. package/assets/rr-wemap-multi-remote-indoor-outdoor.json +23 -23
  5. package/assets/rr-wemap-multi-remote-outdoor-indoor.json +23 -23
  6. package/assets/rr-wemap-multi-remote-outdoor-outdoor.json +20 -20
  7. package/dist/index.js +531 -708
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +531 -708
  10. package/dist/index.mjs.map +1 -1
  11. package/index.ts +9 -10
  12. package/package.json +4 -4
  13. package/src/ItineraryInfoManager.spec.ts +2 -4
  14. package/src/RoutingError.ts +56 -0
  15. package/src/StatusCode.ts +11 -0
  16. package/src/graph/GraphRouterOptions.ts +5 -5
  17. package/src/graph/GraphRouterOptionsBuilder.ts +26 -26
  18. package/src/model/Itinerary.spec.ts +12 -12
  19. package/src/model/Itinerary.ts +54 -58
  20. package/src/model/Leg.spec.ts +15 -15
  21. package/src/model/Leg.ts +43 -43
  22. package/src/model/RouterRequest.ts +23 -0
  23. package/src/model/StepsBuilder.ts +18 -40
  24. package/src/model/{RoutingMode.ts → TransitMode.ts} +2 -3
  25. package/src/model/TravelMode.ts +3 -0
  26. package/src/remote/RemoteRouter.ts +3 -11
  27. package/src/remote/RemoteRouterManager.ts +16 -44
  28. package/src/remote/RemoteRouterUtils.ts +2 -7
  29. package/src/remote/cityway/CitywayRemoteRouter.spec.ts +37 -42
  30. package/src/remote/cityway/CitywayRemoteRouter.ts +67 -76
  31. package/src/remote/deutsche-bahn/DeutscheBahnRemoteRouter.spec.ts +17 -18
  32. package/src/remote/deutsche-bahn/DeutscheBahnRemoteRouter.ts +16 -20
  33. package/src/remote/idfm/IdfmRemoteRouter.spec.ts +15 -18
  34. package/src/remote/idfm/IdfmRemoteRouter.ts +64 -74
  35. package/src/remote/osrm/OsrmRemoteRouter.spec.ts +40 -409
  36. package/src/remote/osrm/OsrmRemoteRouter.ts +48 -80
  37. package/src/remote/otp/OtpRemoteRouter.spec.ts +27 -32
  38. package/src/remote/otp/OtpRemoteRouter.ts +34 -42
  39. package/src/remote/wemap-multi/WemapMultiRemoteRouter.spec.ts +46 -46
  40. package/src/remote/wemap-multi/WemapMultiRemoteRouter.ts +26 -17
  41. package/src/wemap-multi/CustomNetworkMap.ts +6 -10
  42. package/src/wemap-multi/WemapMultiRouter.spec.ts +44 -32
  43. package/src/wemap-multi/WemapMultiRouter.ts +146 -253
  44. package/src/model/RouterResponse.spec.ts +0 -126
  45. package/src/model/RouterResponse.ts +0 -99
  46. package/src/remote/RemoteRouterOptions.ts +0 -3
  47. package/src/remote/RemoteRouterServerUnreachable.ts +0 -6
  48. package/src/remote/RoutingModeCorrespondanceNotFound.ts +0 -6
  49. package/src/remote/wemap-multi/WemapMultiRemoteRouterOptions.ts +0 -4
  50. package/src/remote/wemap-multi/WemapMultiRemoteRouterPayload.ts +0 -37
  51. package/src/wemap-multi/WemapMultiRouterOptions.ts +0 -14
@@ -3,13 +3,13 @@
3
3
  "wemap-meta",
4
4
  "wemap"
5
5
  ],
6
- "from": [
6
+ "origin": [
7
7
  43.6091851,
8
8
  3.8841386,
9
9
  1.5999999999999996,
10
10
  2
11
11
  ],
12
- "to": [
12
+ "destination": [
13
13
  43.6093145,
14
14
  3.8842585,
15
15
  0,
@@ -17,13 +17,13 @@
17
17
  ],
18
18
  "itineraries": [
19
19
  {
20
- "from": [
20
+ "origin": [
21
21
  43.6091851,
22
22
  3.8841386,
23
23
  1.5999999999999996,
24
24
  2
25
25
  ],
26
- "to": [
26
+ "destination": [
27
27
  43.6093145,
28
28
  3.8842585,
29
29
  0,
@@ -35,7 +35,7 @@
35
35
  "legs": [
36
36
  {
37
37
  "mode": "WALK",
38
- "from": {
38
+ "start": {
39
39
  "coords": [
40
40
  43.6091851,
41
41
  3.8841386,
@@ -43,7 +43,7 @@
43
43
  2
44
44
  ]
45
45
  },
46
- "to": {
46
+ "end": {
47
47
  "coords": [
48
48
  43.6093145,
49
49
  3.8842585,
@@ -3,37 +3,37 @@
3
3
  "wemap-meta",
4
4
  "wemap"
5
5
  ],
6
- "from": [
7
- 48.8725992,
8
- 2.343431
9
- ],
10
- "to": [
11
- 48.8725694,
12
- 2.3433
13
- ],
6
+ "origin": {
7
+ "lat": 48.8725992,
8
+ "lng": 2.343431
9
+ },
10
+ "destination": {
11
+ "lat": 48.8725694,
12
+ "lng": 2.3433
13
+ },
14
14
  "itineraries": [
15
15
  {
16
- "from": [
17
- 48.8725992,
18
- 2.343431
19
- ],
20
- "to": [
21
- 48.8725694,
22
- 2.3433
23
- ],
16
+ "origin": {
17
+ "lat": 48.8725992,
18
+ "lng": 2.343431
19
+ },
20
+ "destination": {
21
+ "lat": 48.8725694,
22
+ "lng": 2.3433
23
+ },
24
24
  "distance": 13.06248469300833,
25
25
  "duration": 9.404988978965996,
26
- "mode": "WALK",
26
+ "transitMode": "WALK",
27
27
  "legs": [
28
28
  {
29
- "mode": "WALK",
30
- "from": {
29
+ "transitMode": "WALK",
30
+ "start": {
31
31
  "coords": [
32
32
  48.8725992,
33
33
  2.343431
34
34
  ]
35
35
  },
36
- "to": {
36
+ "end": {
37
37
  "coords": [
38
38
  48.8725694,
39
39
  2.3433
@@ -4,41 +4,39 @@
4
4
  "osrm",
5
5
  "wemap"
6
6
  ],
7
- "from": [
8
- 48.8725992,
9
- 2.343431
10
- ],
11
- "to": [
12
- 48.8772962,
13
- 2.3584458,
14
- null,
15
- 0
16
- ],
7
+ "origin": {
8
+ "lat": 48.8725992,
9
+ "lng": 2.343431
10
+ },
11
+ "destination": {
12
+ "lat": 48.8772962,
13
+ "lng": 2.3584458,
14
+ "level": 0
15
+ },
17
16
  "itineraries": [
18
17
  {
19
- "from": [
20
- 48.8725992,
21
- 2.343431
22
- ],
23
- "to": [
24
- 48.8772962,
25
- 2.3584458,
26
- null,
27
- 0
28
- ],
18
+ "origin": {
19
+ "lat": 48.8725992,
20
+ "lng": 2.343431
21
+ },
22
+ "destination": {
23
+ "lat": 48.8772962,
24
+ "lng": 2.3584458,
25
+ "level": 0
26
+ },
29
27
  "distance": 1623.567209158486,
30
28
  "duration": 1188.9963905941102,
31
- "mode": "WALK",
29
+ "transitMode": "WALK",
32
30
  "legs": [
33
31
  {
34
- "mode": "WALK",
35
- "from": {
32
+ "transitMode": "WALK",
33
+ "start": {
36
34
  "coords": [
37
35
  48.8725992,
38
36
  2.343431
39
37
  ]
40
38
  },
41
- "to": {
39
+ "end": {
42
40
  "coords": [
43
41
  48.87262168252,
44
42
  2.34327125172
@@ -95,14 +93,14 @@
95
93
  ]
96
94
  },
97
95
  {
98
- "mode": "WALK",
99
- "from": {
96
+ "transitMode": "WALK",
97
+ "start": {
100
98
  "coords": [
101
99
  48.872668,
102
100
  2.343286
103
101
  ]
104
102
  },
105
- "to": {
103
+ "end": {
106
104
  "coords": [
107
105
  48.877416,
108
106
  2.358155
@@ -550,20 +548,18 @@
550
548
  ]
551
549
  },
552
550
  {
553
- "mode": "WALK",
554
- "from": {
551
+ "transitMode": "WALK",
552
+ "start": {
555
553
  "coords": [
556
554
  48.8774156,
557
555
  2.3581551,
558
- null,
559
556
  0
560
557
  ]
561
558
  },
562
- "to": {
559
+ "end": {
563
560
  "coords": [
564
561
  48.8772962,
565
562
  2.3584458,
566
- null,
567
563
  0
568
564
  ]
569
565
  },
@@ -573,61 +569,51 @@
573
569
  [
574
570
  48.8774156,
575
571
  2.3581551,
576
- null,
577
572
  0
578
573
  ],
579
574
  [
580
575
  48.8774031,
581
576
  2.3582059,
582
- null,
583
577
  0
584
578
  ],
585
579
  [
586
580
  48.87739408877,
587
581
  2.3582397815,
588
- null,
589
582
  0
590
583
  ],
591
584
  [
592
585
  48.87738003272,
593
586
  2.35829263106,
594
- null,
595
587
  0
596
588
  ],
597
589
  [
598
590
  48.87737740687,
599
591
  2.35830250403,
600
- null,
601
592
  0
602
593
  ],
603
594
  [
604
595
  48.87736050007,
605
596
  2.35836607217,
606
- null,
607
597
  0
608
598
  ],
609
599
  [
610
600
  48.8773552,
611
601
  2.358386,
612
- null,
613
602
  0
614
603
  ],
615
604
  [
616
605
  48.87734966973,
617
606
  2.35840668389,
618
- null,
619
607
  0
620
608
  ],
621
609
  [
622
610
  48.87732716148,
623
611
  2.35849104813,
624
- null,
625
612
  0
626
613
  ],
627
614
  [
628
615
  48.87729021362492,
629
616
  2.3584691138693743,
630
- null,
631
617
  0
632
618
  ]
633
619
  ],
@@ -637,7 +623,6 @@
637
623
  "coords": [
638
624
  48.8774156,
639
625
  2.3581551,
640
- null,
641
626
  0
642
627
  ],
643
628
  "angle": 1.2127782103969411,
@@ -652,7 +637,6 @@
652
637
  "coords": [
653
638
  48.87732716148,
654
639
  2.35849104813,
655
- null,
656
640
  0
657
641
  ],
658
642
  "angle": 1.5839505274258527,
@@ -667,7 +651,6 @@
667
651
  "coords": [
668
652
  48.87729021362492,
669
653
  2.3584691138693743,
670
- null,
671
654
  0
672
655
  ],
673
656
  "angle": 1.570800373779623,
@@ -4,37 +4,37 @@
4
4
  "osrm",
5
5
  "wemap"
6
6
  ],
7
- "from": [
8
- 48.8725992,
9
- 2.343431
10
- ],
11
- "to": [
12
- 48.8726513,
13
- 2.343449
14
- ],
7
+ "origin": {
8
+ "lat": 48.8725992,
9
+ "lng": 2.343431
10
+ },
11
+ "destination": {
12
+ "lat": 48.8726513,
13
+ "lng": 2.343449
14
+ },
15
15
  "itineraries": [
16
16
  {
17
- "from": [
18
- 48.8725992,
19
- 2.343431
20
- ],
21
- "to": [
22
- 48.8726513,
23
- 2.343449
24
- ],
17
+ "origin": {
18
+ "lat": 48.8725992,
19
+ "lng": 2.343431
20
+ },
21
+ "destination": {
22
+ "lat": 48.8726513,
23
+ "lng": 2.343449
24
+ },
25
25
  "distance": 24.658068219028713,
26
26
  "duration": 17.641809117700674,
27
- "mode": "WALK",
27
+ "transitMode": "WALK",
28
28
  "legs": [
29
29
  {
30
- "mode": "WALK",
31
- "from": {
30
+ "transitMode": "WALK",
31
+ "start": {
32
32
  "coords": [
33
33
  48.8725992,
34
34
  2.343431
35
35
  ]
36
36
  },
37
- "to": {
37
+ "end": {
38
38
  "coords": [
39
39
  48.87262168252,
40
40
  2.34327125172
@@ -91,14 +91,14 @@
91
91
  ]
92
92
  },
93
93
  {
94
- "mode": "WALK",
95
- "from": {
94
+ "transitMode": "WALK",
95
+ "start": {
96
96
  "coords": [
97
97
  48.872668,
98
98
  2.343286
99
99
  ]
100
100
  },
101
- "to": {
101
+ "end": {
102
102
  "coords": [
103
103
  48.872645,
104
104
  2.343447
@@ -4,37 +4,37 @@
4
4
  "osrm",
5
5
  "wemap"
6
6
  ],
7
- "from": [
8
- 48.8726085,
9
- 2.3434289
10
- ],
11
- "to": [
12
- 48.8725694,
13
- 2.3433
14
- ],
7
+ "origin": {
8
+ "lat": 48.8726085,
9
+ "lng": 2.3434289
10
+ },
11
+ "destination": {
12
+ "lat": 48.8725694,
13
+ "lng": 2.3433
14
+ },
15
15
  "itineraries": [
16
16
  {
17
- "from": [
18
- 48.8726085,
19
- 2.3434289
20
- ],
21
- "to": [
22
- 48.8725694,
23
- 2.3433
24
- ],
17
+ "origin": {
18
+ "lat": 48.8726085,
19
+ "lng": 2.3434289
20
+ },
21
+ "destination": {
22
+ "lat": 48.8725694,
23
+ "lng": 2.3433
24
+ },
25
25
  "distance": 18.278520725857963,
26
26
  "duration": 13.108534922617736,
27
- "mode": "WALK",
27
+ "transitMode": "WALK",
28
28
  "legs": [
29
29
  {
30
- "mode": "WALK",
31
- "from": {
30
+ "transitMode": "WALK",
31
+ "start": {
32
32
  "coords": [
33
33
  48.872645,
34
34
  2.343441
35
35
  ]
36
36
  },
37
- "to": {
37
+ "end": {
38
38
  "coords": [
39
39
  48.872668,
40
40
  2.343286
@@ -85,14 +85,14 @@
85
85
  ]
86
86
  },
87
87
  {
88
- "mode": "WALK",
89
- "from": {
88
+ "transitMode": "WALK",
89
+ "start": {
90
90
  "coords": [
91
91
  48.87262168252,
92
92
  2.34327125172
93
93
  ]
94
94
  },
95
- "to": {
95
+ "end": {
96
96
  "coords": [
97
97
  48.8725694,
98
98
  2.3433
@@ -1,36 +1,36 @@
1
1
  {
2
2
  "routerName": "osrm",
3
- "from": [
4
- 48.8726513,
5
- 2.343449
6
- ],
7
- "to": [
8
- 48.8726397,
9
- 2.3431657
10
- ],
3
+ "origin": {
4
+ "lat": 48.8726513,
5
+ "lng": 2.343449
6
+ },
7
+ "destination": {
8
+ "lat": 48.8726397,
9
+ "lng": 2.3431657
10
+ },
11
11
  "itineraries": [
12
12
  {
13
- "from": [
14
- 48.8726513,
15
- 2.343449
16
- ],
17
- "to": [
18
- 48.8726397,
19
- 2.3431657
20
- ],
13
+ "origin": {
14
+ "lat": 48.8726513,
15
+ "lng": 2.343449
16
+ },
17
+ "destination": {
18
+ "lat": 48.8726397,
19
+ "lng": 2.3431657
20
+ },
21
21
  "distance": 29.8,
22
22
  "duration": 23.5,
23
- "mode": "WALK",
23
+ "transitMode": "WALK",
24
24
  "legs": [
25
25
  {
26
- "mode": "WALK",
27
- "from": {
26
+ "transitMode": "WALK",
27
+ "start": {
28
28
  "coords": [
29
29
  48.872645,
30
30
  2.343447
31
31
  ]
32
32
  },
33
- "to": {
33
+ "end": {
34
34
  "coords": [
35
35
  48.872638,
36
36
  2.343135