@wemap/routers 12.8.9 → 12.8.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.
- package/assets/itinerary-lemans-navitia.json +7768 -0
- package/assets/network-escalators.osm +50 -0
- package/dist/index.js +367 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +367 -31
- package/dist/index.mjs.map +1 -1
- package/index.ts +1 -0
- package/package.json +2 -2
- package/src/RoutingError.ts +4 -0
- package/src/StatusCode.ts +2 -1
- package/src/remote/RemoteRouterManager.ts +2 -0
- package/src/remote/geovelo/GeoveloRemoteRouter.spec.ts +1 -1
- package/src/remote/navitia/NavitiaRemoteRouter.spec.ts +116 -0
- package/src/remote/navitia/NavitiaRemoteRouter.ts +445 -0
- package/src/remote/navitia/types.ts +73 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
|
|
2
|
+
export type NavitiaCoordinates = { lat: number | string, lon: number | string };
|
|
3
|
+
export type NavitiaPath = {
|
|
4
|
+
name: string,
|
|
5
|
+
length: number
|
|
6
|
+
} & ({ instruction_start_coordinate: NavitiaCoordinates } | { via_uri: string });
|
|
7
|
+
|
|
8
|
+
export type NavitiaWaypoint = { name: string }
|
|
9
|
+
& (
|
|
10
|
+
{ stop_point: { coord: NavitiaCoordinates } } |
|
|
11
|
+
{ address: { coord: NavitiaCoordinates } } |
|
|
12
|
+
{ poi: { coord: NavitiaCoordinates } }
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
export type NavitiaSection = {
|
|
16
|
+
id: string;
|
|
17
|
+
type: 'waiting' | 'transfer' | string,
|
|
18
|
+
mode: string,
|
|
19
|
+
departure_date_time: string,
|
|
20
|
+
arrival_date_time: string,
|
|
21
|
+
duration: number,
|
|
22
|
+
geojson: {
|
|
23
|
+
coordinates: [number, number][],
|
|
24
|
+
properties: { length: number }[]
|
|
25
|
+
},
|
|
26
|
+
path: NavitiaPath[],
|
|
27
|
+
display_informations: {
|
|
28
|
+
code: string,
|
|
29
|
+
color: string,
|
|
30
|
+
text_color: string,
|
|
31
|
+
direction: string,
|
|
32
|
+
physical_mode: string
|
|
33
|
+
},
|
|
34
|
+
from: NavitiaWaypoint,
|
|
35
|
+
to: NavitiaWaypoint,
|
|
36
|
+
vias?: {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
access_point: {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
coord: {
|
|
43
|
+
lon: string;
|
|
44
|
+
lat: string;
|
|
45
|
+
},
|
|
46
|
+
embedded_type: string;
|
|
47
|
+
},
|
|
48
|
+
is_entrance: boolean,
|
|
49
|
+
is_exit: boolean,
|
|
50
|
+
length: number,
|
|
51
|
+
traversal_time: number,
|
|
52
|
+
pathway_mode: number
|
|
53
|
+
}[]
|
|
54
|
+
}
|
|
55
|
+
export type NavitiaJson = {
|
|
56
|
+
journeys: {
|
|
57
|
+
duration: number,
|
|
58
|
+
departure_date_time: string,
|
|
59
|
+
arrival_date_time: string,
|
|
60
|
+
sections: NavitiaSection[]
|
|
61
|
+
}[],
|
|
62
|
+
context: {
|
|
63
|
+
timezone: string
|
|
64
|
+
};
|
|
65
|
+
error: {
|
|
66
|
+
message?: string;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type NavitiaIntermediateStep = {
|
|
71
|
+
name: string,
|
|
72
|
+
distance: number
|
|
73
|
+
};
|