@wemap/osm 0.3.0 → 0.3.1
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": "0.3.
|
|
14
|
+
"version": "0.3.1",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/wemap/wemap-utils-js/issues"
|
|
17
17
|
},
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
],
|
|
27
27
|
"license": "ISC",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@wemap/geo": "^0.
|
|
29
|
+
"@wemap/geo": "^1.0.0",
|
|
30
30
|
"@wemap/logger": "^0.1.6",
|
|
31
31
|
"lodash.isnumber": "^3.0.3",
|
|
32
32
|
"sax": "^1.2.4"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "2a8dc4304fae3f175819ed1a1561a818e871cf44"
|
|
35
35
|
}
|
package/src/network/OsmRouter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GraphRouter, Utils
|
|
3
|
-
} from '@wemap/
|
|
3
|
+
} from '@wemap/graph';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_OPTIONS = { useStairs: true };
|
|
6
6
|
|
|
@@ -27,12 +27,22 @@ class OsmRouter extends GraphRouter {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const acceptOneWayFn = (edge, reversed) => {
|
|
30
|
-
if (!reversed) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
30
|
if (edge.data && edge.data.tags) {
|
|
34
|
-
const {
|
|
35
|
-
|
|
31
|
+
const {
|
|
32
|
+
oneway, highway, conveying
|
|
33
|
+
} = edge.data.tags;
|
|
34
|
+
if (reversed && (oneway === 'yes' || oneway === 'true' || oneway === '1')) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
if (conveying && highway) {
|
|
38
|
+
if (conveying === 'forward' && reversed) {
|
|
39
|
+
return false;
|
|
40
|
+
} if (conveying === 'backward' && !reversed) {
|
|
41
|
+
return false;
|
|
42
|
+
} if (conveying === 'yes' && reversed) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
36
46
|
}
|
|
37
47
|
return true;
|
|
38
48
|
};
|
|
@@ -4,8 +4,9 @@ import fs from 'fs';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
Level, WGS84
|
|
8
8
|
} from '@wemap/geo';
|
|
9
|
+
import { Node } from '@wemap/graph';
|
|
9
10
|
|
|
10
11
|
import OsmParser from '../model/OsmParser';
|
|
11
12
|
import OsmRouter from './OsmRouter';
|
|
@@ -13,7 +14,7 @@ import OsmNetwork from './OsmNetwork';
|
|
|
13
14
|
|
|
14
15
|
import {
|
|
15
16
|
itineraryStart, itineraryEnd
|
|
16
|
-
} from '../../../
|
|
17
|
+
} from '../../../graph/tests/CommonTest';
|
|
17
18
|
|
|
18
19
|
const verifyNodesOrder = (nodes, names) => {
|
|
19
20
|
expect(nodes.length).equals(names.length);
|
package/src/osrm/OsrmUtils.js
CHANGED