@wemap/routers 11.0.0-alpha.21 → 11.0.0-alpha.23
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-paris-idfm-2.json +342 -0
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/remote/cityway/CitywayRemoteRouter.spec.ts +1 -1
- package/src/remote/cityway/CitywayRemoteRouter.ts +1 -3
- package/src/wemap-osm/OsmGraph.ts +15 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tickets": [],
|
|
3
|
+
"terminus": [],
|
|
4
|
+
"links": [
|
|
5
|
+
{
|
|
6
|
+
"href": "http:\/\/api.navitia.io\/v1\/coverage\/fr-idf\/journeys?first_section_mode%5B%5D=walking&to=2.2592783370768643;48.84139729657062&datetime=20230228T000000&last_section_mode%5B%5D=walking&datetime_represents=departure&forbidden_uris%5B%5D=physical_mode%3AAir&forbidden_uris%5B%5D=physical_mode%3ABoat&forbidden_uris%5B%5D=physical_mode%3ABus&forbidden_uris%5B%5D=physical_mode%3ABusRapidTransit&forbidden_uris%5B%5D=physical_mode%3ACoach&forbidden_uris%5B%5D=physical_mode%3AFerry&forbidden_uris%5B%5D=physical_mode%3AFunicular&forbidden_uris%5B%5D=physical_mode%3ALocalTrain&forbidden_uris%5B%5D=physical_mode%3ALongDistanceTrain&forbidden_uris%5B%5D=physical_mode%3AMetro&forbidden_uris%5B%5D=physical_mode%3ARailShuttle&forbidden_uris%5B%5D=physical_mode%3ARapidTransit&forbidden_uris%5B%5D=physical_mode%3AShuttle&forbidden_uris%5B%5D=physical_mode%3ASuspendedCableCar&forbidden_uris%5B%5D=physical_mode%3ATaxi&forbidden_uris%5B%5D=physical_mode%3ATrain&forbidden_uris%5B%5D=physical_mode%3ATramway&from=2.258275897214247;48.841115913391775",
|
|
7
|
+
"type": "first",
|
|
8
|
+
"rel": "first",
|
|
9
|
+
"templated": false
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"href": "http:\/\/api.navitia.io\/v1\/coverage\/fr-idf\/journeys?first_section_mode%5B%5D=walking&to=2.2592783370768643;48.84139729657062&datetime=20230228T235959&last_section_mode%5B%5D=walking&datetime_represents=arrival&forbidden_uris%5B%5D=physical_mode%3AAir&forbidden_uris%5B%5D=physical_mode%3ABoat&forbidden_uris%5B%5D=physical_mode%3ABus&forbidden_uris%5B%5D=physical_mode%3ABusRapidTransit&forbidden_uris%5B%5D=physical_mode%3ACoach&forbidden_uris%5B%5D=physical_mode%3AFerry&forbidden_uris%5B%5D=physical_mode%3AFunicular&forbidden_uris%5B%5D=physical_mode%3ALocalTrain&forbidden_uris%5B%5D=physical_mode%3ALongDistanceTrain&forbidden_uris%5B%5D=physical_mode%3AMetro&forbidden_uris%5B%5D=physical_mode%3ARailShuttle&forbidden_uris%5B%5D=physical_mode%3ARapidTransit&forbidden_uris%5B%5D=physical_mode%3AShuttle&forbidden_uris%5B%5D=physical_mode%3ASuspendedCableCar&forbidden_uris%5B%5D=physical_mode%3ATaxi&forbidden_uris%5B%5D=physical_mode%3ATrain&forbidden_uris%5B%5D=physical_mode%3ATramway&from=2.258275897214247;48.841115913391775",
|
|
13
|
+
"type": "last",
|
|
14
|
+
"rel": "last",
|
|
15
|
+
"templated": false
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"href": "http:\/\/api.navitia.io\/v1\/coverage\/fr-idf\/addresses\/{address.id}",
|
|
19
|
+
"type": "address",
|
|
20
|
+
"rel": "addresses",
|
|
21
|
+
"templated": true
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"journeys": [
|
|
25
|
+
{
|
|
26
|
+
"status": "",
|
|
27
|
+
"distances": {
|
|
28
|
+
"taxi": 0,
|
|
29
|
+
"car": 0,
|
|
30
|
+
"walking": 116,
|
|
31
|
+
"bike": 0,
|
|
32
|
+
"ridesharing": 0
|
|
33
|
+
},
|
|
34
|
+
"tags": [
|
|
35
|
+
"walking",
|
|
36
|
+
"non_pt",
|
|
37
|
+
"non_pt_walking",
|
|
38
|
+
"ecologic"
|
|
39
|
+
],
|
|
40
|
+
"nb_transfers": 0,
|
|
41
|
+
"durations": {
|
|
42
|
+
"taxi": 0,
|
|
43
|
+
"walking": 104,
|
|
44
|
+
"car": 0,
|
|
45
|
+
"ridesharing": 0,
|
|
46
|
+
"bike": 0,
|
|
47
|
+
"total": 104
|
|
48
|
+
},
|
|
49
|
+
"arrival_date_time": "20230228T164812",
|
|
50
|
+
"departure_date_time": "20230228T164628",
|
|
51
|
+
"requested_date_time": "20230228T164628",
|
|
52
|
+
"fare": {
|
|
53
|
+
"found": false,
|
|
54
|
+
"links": []
|
|
55
|
+
},
|
|
56
|
+
"co2_emission": {
|
|
57
|
+
"unit": "gEC",
|
|
58
|
+
"value": 0.0
|
|
59
|
+
},
|
|
60
|
+
"type": "best",
|
|
61
|
+
"duration": 104,
|
|
62
|
+
"sections": [
|
|
63
|
+
{
|
|
64
|
+
"from": {
|
|
65
|
+
"embedded_type": "address",
|
|
66
|
+
"id": "2.258438;48.841072",
|
|
67
|
+
"quality": 0,
|
|
68
|
+
"name": "88B Rue Michel Ange (Paris)",
|
|
69
|
+
"address": {
|
|
70
|
+
"name": "88B Rue Michel Ange",
|
|
71
|
+
"house_number": 88,
|
|
72
|
+
"coord": {
|
|
73
|
+
"lat": "48.841072",
|
|
74
|
+
"lon": "2.258438"
|
|
75
|
+
},
|
|
76
|
+
"label": "88B Rue Michel Ange (Paris)",
|
|
77
|
+
"administrative_regions": [
|
|
78
|
+
{
|
|
79
|
+
"insee": "",
|
|
80
|
+
"name": "Quartier d'Auteuil",
|
|
81
|
+
"level": 10,
|
|
82
|
+
"coord": {
|
|
83
|
+
"lat": "48.8505894364",
|
|
84
|
+
"lon": "2.2522256986"
|
|
85
|
+
},
|
|
86
|
+
"label": "Quartier d'Auteuil (75016-75116), Paris 16e Arrondissement, Paris, \u00cele-de-France, France",
|
|
87
|
+
"id": "admin:osm:relation:2191090",
|
|
88
|
+
"zip_code": "75016-75116"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"insee": "75056",
|
|
92
|
+
"name": "Paris",
|
|
93
|
+
"level": 8,
|
|
94
|
+
"coord": {
|
|
95
|
+
"lat": "48.8534951",
|
|
96
|
+
"lon": "2.3483915"
|
|
97
|
+
},
|
|
98
|
+
"label": "Paris (75000-75116), \u00cele-de-France, France",
|
|
99
|
+
"id": "admin:fr:75056",
|
|
100
|
+
"zip_code": "75000-75116"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"insee": "75",
|
|
104
|
+
"name": "Paris",
|
|
105
|
+
"level": 6,
|
|
106
|
+
"coord": {
|
|
107
|
+
"lat": "48.8534951",
|
|
108
|
+
"lon": "2.3483915"
|
|
109
|
+
},
|
|
110
|
+
"label": "Paris, \u00cele-de-France, France",
|
|
111
|
+
"id": "admin:osm:relation:71525"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"insee": "11",
|
|
115
|
+
"name": "\u00cele-de-France",
|
|
116
|
+
"level": 4,
|
|
117
|
+
"coord": {
|
|
118
|
+
"lat": "48.8534951",
|
|
119
|
+
"lon": "2.3483915"
|
|
120
|
+
},
|
|
121
|
+
"label": "\u00cele-de-France, France",
|
|
122
|
+
"id": "admin:osm:relation:8649"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"insee": "",
|
|
126
|
+
"name": "France",
|
|
127
|
+
"level": 2,
|
|
128
|
+
"coord": {
|
|
129
|
+
"lat": "48.8534951",
|
|
130
|
+
"lon": "2.3483915"
|
|
131
|
+
},
|
|
132
|
+
"label": "France",
|
|
133
|
+
"id": "admin:osm:relation:2202162"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"insee": "75116",
|
|
137
|
+
"name": "Paris 16e Arrondissement",
|
|
138
|
+
"level": 9,
|
|
139
|
+
"coord": {
|
|
140
|
+
"lat": "48.8631709",
|
|
141
|
+
"lon": "2.2757648"
|
|
142
|
+
},
|
|
143
|
+
"label": "Paris 16e Arrondissement (75016-75116), Paris, \u00cele-de-France, France",
|
|
144
|
+
"id": "admin:osm:relation:9517",
|
|
145
|
+
"zip_code": "75016-75116"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"id": "2.258438;48.841072"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"links": [],
|
|
152
|
+
"arrival_date_time": "20230228T164812",
|
|
153
|
+
"co2_emission": {
|
|
154
|
+
"unit": "gEC",
|
|
155
|
+
"value": 0.0
|
|
156
|
+
},
|
|
157
|
+
"to": {
|
|
158
|
+
"embedded_type": "address",
|
|
159
|
+
"id": "2.259444;48.841529",
|
|
160
|
+
"quality": 0,
|
|
161
|
+
"name": "59 Rue Claude Lorrain (Paris)",
|
|
162
|
+
"address": {
|
|
163
|
+
"name": "59 Rue Claude Lorrain",
|
|
164
|
+
"house_number": 59,
|
|
165
|
+
"coord": {
|
|
166
|
+
"lat": "48.841529",
|
|
167
|
+
"lon": "2.259444"
|
|
168
|
+
},
|
|
169
|
+
"label": "59 Rue Claude Lorrain (Paris)",
|
|
170
|
+
"administrative_regions": [
|
|
171
|
+
{
|
|
172
|
+
"insee": "",
|
|
173
|
+
"name": "Quartier d'Auteuil",
|
|
174
|
+
"level": 10,
|
|
175
|
+
"coord": {
|
|
176
|
+
"lat": "48.8505894364",
|
|
177
|
+
"lon": "2.2522256986"
|
|
178
|
+
},
|
|
179
|
+
"label": "Quartier d'Auteuil (75016-75116), Paris 16e Arrondissement, Paris, \u00cele-de-France, France",
|
|
180
|
+
"id": "admin:osm:relation:2191090",
|
|
181
|
+
"zip_code": "75016-75116"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"insee": "75056",
|
|
185
|
+
"name": "Paris",
|
|
186
|
+
"level": 8,
|
|
187
|
+
"coord": {
|
|
188
|
+
"lat": "48.8534951",
|
|
189
|
+
"lon": "2.3483915"
|
|
190
|
+
},
|
|
191
|
+
"label": "Paris (75000-75116), \u00cele-de-France, France",
|
|
192
|
+
"id": "admin:fr:75056",
|
|
193
|
+
"zip_code": "75000-75116"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"insee": "75",
|
|
197
|
+
"name": "Paris",
|
|
198
|
+
"level": 6,
|
|
199
|
+
"coord": {
|
|
200
|
+
"lat": "48.8534951",
|
|
201
|
+
"lon": "2.3483915"
|
|
202
|
+
},
|
|
203
|
+
"label": "Paris, \u00cele-de-France, France",
|
|
204
|
+
"id": "admin:osm:relation:71525"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"insee": "11",
|
|
208
|
+
"name": "\u00cele-de-France",
|
|
209
|
+
"level": 4,
|
|
210
|
+
"coord": {
|
|
211
|
+
"lat": "48.8534951",
|
|
212
|
+
"lon": "2.3483915"
|
|
213
|
+
},
|
|
214
|
+
"label": "\u00cele-de-France, France",
|
|
215
|
+
"id": "admin:osm:relation:8649"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"insee": "",
|
|
219
|
+
"name": "France",
|
|
220
|
+
"level": 2,
|
|
221
|
+
"coord": {
|
|
222
|
+
"lat": "48.8534951",
|
|
223
|
+
"lon": "2.3483915"
|
|
224
|
+
},
|
|
225
|
+
"label": "France",
|
|
226
|
+
"id": "admin:osm:relation:2202162"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"insee": "75116",
|
|
230
|
+
"name": "Paris 16e Arrondissement",
|
|
231
|
+
"level": 9,
|
|
232
|
+
"coord": {
|
|
233
|
+
"lat": "48.8631709",
|
|
234
|
+
"lon": "2.2757648"
|
|
235
|
+
},
|
|
236
|
+
"label": "Paris 16e Arrondissement (75016-75116), Paris, \u00cele-de-France, France",
|
|
237
|
+
"id": "admin:osm:relation:9517",
|
|
238
|
+
"zip_code": "75016-75116"
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"id": "2.259444;48.841529"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"departure_date_time": "20230228T164628",
|
|
245
|
+
"geojson": {
|
|
246
|
+
"type": "LineString",
|
|
247
|
+
"properties": [
|
|
248
|
+
{
|
|
249
|
+
"length": 116
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"coordinates": [
|
|
253
|
+
[
|
|
254
|
+
2.258438,
|
|
255
|
+
48.841072
|
|
256
|
+
],
|
|
257
|
+
[
|
|
258
|
+
2.258546,
|
|
259
|
+
48.841017
|
|
260
|
+
],
|
|
261
|
+
[
|
|
262
|
+
2.258546,
|
|
263
|
+
48.841017
|
|
264
|
+
],
|
|
265
|
+
[
|
|
266
|
+
2.258712,
|
|
267
|
+
48.84128
|
|
268
|
+
],
|
|
269
|
+
[
|
|
270
|
+
2.258962,
|
|
271
|
+
48.841627
|
|
272
|
+
],
|
|
273
|
+
[
|
|
274
|
+
2.259018,
|
|
275
|
+
48.841704
|
|
276
|
+
],
|
|
277
|
+
[
|
|
278
|
+
2.259018,
|
|
279
|
+
48.841704
|
|
280
|
+
],
|
|
281
|
+
[
|
|
282
|
+
2.259018,
|
|
283
|
+
48.841704
|
|
284
|
+
],
|
|
285
|
+
[
|
|
286
|
+
2.259126,
|
|
287
|
+
48.841677
|
|
288
|
+
],
|
|
289
|
+
[
|
|
290
|
+
2.2594601105,
|
|
291
|
+
48.8415933408
|
|
292
|
+
],
|
|
293
|
+
[
|
|
294
|
+
2.259444,
|
|
295
|
+
48.841529
|
|
296
|
+
]
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
"duration": 104,
|
|
300
|
+
"path": [
|
|
301
|
+
{
|
|
302
|
+
"duration": 74,
|
|
303
|
+
"length": 83,
|
|
304
|
+
"direction": 0,
|
|
305
|
+
"name": "Rue Michel-Ange"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"duration": 30,
|
|
309
|
+
"length": 34,
|
|
310
|
+
"direction": 0,
|
|
311
|
+
"name": "Rue Claude Lorrain"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"type": "street_network",
|
|
315
|
+
"id": "section_0_0",
|
|
316
|
+
"mode": "walking"
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
"disruptions": [],
|
|
322
|
+
"notes": [],
|
|
323
|
+
"feed_publishers": [
|
|
324
|
+
{
|
|
325
|
+
"url": "https:\/\/www.openstreetmap.org\/copyright",
|
|
326
|
+
"id": "osm",
|
|
327
|
+
"license": "ODbL",
|
|
328
|
+
"name": "openstreetmap"
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
"context": {
|
|
332
|
+
"timezone": "Europe\/Paris",
|
|
333
|
+
"current_datetime": "20230228T164628",
|
|
334
|
+
"car_direct_path": {
|
|
335
|
+
"co2_emission": {
|
|
336
|
+
"value": 22.2272123093,
|
|
337
|
+
"unit": "gEC"
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"exceptions": []
|
|
342
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -575,7 +575,8 @@ class RouterResponse {
|
|
|
575
575
|
}
|
|
576
576
|
const HIGHWAYS_PEDESTRIANS = ["footway", "steps", "pedestrian", "living_street", "path", "track", "sidewalk", "elevator"];
|
|
577
577
|
const DEFAULT_WAY_SELECTOR = (way) => {
|
|
578
|
-
|
|
578
|
+
const isElevatorArea = way.tags.highway === "elevator" && way.isArea;
|
|
579
|
+
return HIGHWAYS_PEDESTRIANS.includes(way.tags.highway) && !isElevatorArea || way.tags.footway === "sidewalk" || way.tags.public_transport === "platform" || way.tags.railway === "platform";
|
|
579
580
|
};
|
|
580
581
|
class OsmGraph extends geo.GeoGraph {
|
|
581
582
|
getVertexByCoords(coords) {
|
|
@@ -621,6 +622,16 @@ class OsmGraph extends geo.GeoGraph {
|
|
|
621
622
|
firstNode = secondNode;
|
|
622
623
|
}
|
|
623
624
|
});
|
|
625
|
+
osmModel.ways.filter((way) => way.isElevator).forEach((way) => {
|
|
626
|
+
way.nodes.forEach((node) => {
|
|
627
|
+
const connectedWays = node.ways.filter((otherWay) => otherWay != way);
|
|
628
|
+
if (connectedWays.length) {
|
|
629
|
+
const graphVertex = getOrCreateNode(node);
|
|
630
|
+
graphVertex.data.tags.highway = "elevator";
|
|
631
|
+
elevatorNodes.push(graphVertex);
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
});
|
|
624
635
|
elevatorNodes.forEach((node) => {
|
|
625
636
|
OsmGraph.createNodesAndEdgesFromElevator(nodes, edges, node);
|
|
626
637
|
});
|
|
@@ -997,11 +1008,9 @@ class CitywayRemoteRouter extends RemoteRouter {
|
|
|
997
1008
|
});
|
|
998
1009
|
}
|
|
999
1010
|
if (jsonSection === trip.sections.Section[trip.sections.Section.length - 1]) {
|
|
1000
|
-
const endCoords = jsonToCoordinates$2(trip.Arrival.Site.Position);
|
|
1001
1011
|
minStepsInfo.push({
|
|
1002
|
-
coords:
|
|
1012
|
+
coords: legCoords[legCoords.length - 1]
|
|
1003
1013
|
});
|
|
1004
|
-
legCoords.push(endCoords);
|
|
1005
1014
|
}
|
|
1006
1015
|
} else if (isRoutingModePublicTransport(legMode)) {
|
|
1007
1016
|
legFrom = {
|