@wemap/osm 4.0.13 → 4.0.15
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/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/osm"
|
|
12
12
|
},
|
|
13
13
|
"name": "@wemap/osm",
|
|
14
|
-
"version": "4.0.
|
|
14
|
+
"version": "4.0.15",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
17
17
|
},
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@wemap/geo": "^4.0.
|
|
28
|
+
"@wemap/geo": "^4.0.14",
|
|
29
29
|
"@wemap/logger": "^4.0.0",
|
|
30
30
|
"@wemap/maths": "^4.0.3",
|
|
31
31
|
"sax": "^1.2.4"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "eaaaf8ba0d4ba7e2d1de5a8910f7cf8e0ad8aaf1"
|
|
34
34
|
}
|
|
@@ -7,7 +7,12 @@ import OsmNode from '../model/OsmNode.js';
|
|
|
7
7
|
class OsmNetworkUtils {
|
|
8
8
|
|
|
9
9
|
static HIGHWAYS_PEDESTRIANS = ['footway', 'steps', 'pedestrian', 'living_street', 'path', 'track', 'sidewalk'];
|
|
10
|
-
static DEFAULT_WAY_SELECTOR = way =>
|
|
10
|
+
static DEFAULT_WAY_SELECTOR = way => {
|
|
11
|
+
return this.HIGHWAYS_PEDESTRIANS.includes(way.tags.highway)
|
|
12
|
+
|| way.tags.footway === 'sidewalk'
|
|
13
|
+
|| way.tags.public_transport === 'platform'
|
|
14
|
+
|| way.tags.railway === 'platform';
|
|
15
|
+
};
|
|
11
16
|
|
|
12
17
|
/**
|
|
13
18
|
* @param {OsmModel} osmModel
|
package/src/osrm/OsrmUtils.js
CHANGED
|
@@ -78,7 +78,7 @@ export function itineraryToOsrmJson(itinerary) {
|
|
|
78
78
|
|
|
79
79
|
const {
|
|
80
80
|
nodes, length, nextEdge, nextBearing, previousBearing, angle, node,
|
|
81
|
-
duration, levelChange
|
|
81
|
+
duration, levelChange, subwayEntrance, subwayEntranceRef
|
|
82
82
|
} = itinerarySteps[i];
|
|
83
83
|
|
|
84
84
|
const name = (i === lastStepId ? node.name : nextEdge.name) || '';
|
|
@@ -108,11 +108,11 @@ export function itineraryToOsrmJson(itinerary) {
|
|
|
108
108
|
if (levelChange !== null) {
|
|
109
109
|
osrmStep.levelChange = levelChange;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (subwayEntrance) {
|
|
112
112
|
osrmStep.name = node.name;
|
|
113
113
|
osrmStep.subwayEntrance = true;
|
|
114
|
-
if (
|
|
115
|
-
osrmStep.subwayEntranceRef =
|
|
114
|
+
if (subwayEntranceRef) {
|
|
115
|
+
osrmStep.subwayEntranceRef = subwayEntranceRef;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -149,6 +149,10 @@ export function itineraryToOsrmJson(itinerary) {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* @param {Itinerary} itinerary
|
|
154
|
+
* @param {object} jsonSteps
|
|
155
|
+
*/
|
|
152
156
|
function _parseSteps(itinerary, jsonSteps) {
|
|
153
157
|
|
|
154
158
|
itinerary._steps = [];
|
|
@@ -205,6 +209,17 @@ function _parseSteps(itinerary, jsonSteps) {
|
|
|
205
209
|
currentNodeIndex++;
|
|
206
210
|
}
|
|
207
211
|
|
|
212
|
+
|
|
213
|
+
const firstStepNode = step.nodes[0];
|
|
214
|
+
if (jsonStep.subwayEntrance === true) {
|
|
215
|
+
firstStepNode.subwayEntrance = true;
|
|
216
|
+
step.subwayEntrance = true;
|
|
217
|
+
if (jsonStep.subwayEntranceRef) {
|
|
218
|
+
firstStepNode.subwayEntranceRef = jsonStep.subwayEntranceRef;
|
|
219
|
+
step.subwayEntranceRef = jsonStep.subwayEntranceRef;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
208
223
|
/**
|
|
209
224
|
* Add common fields
|
|
210
225
|
*/
|