@wemap/osm 10.10.0 → 10.11.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/index.d.ts +62 -0
- package/package.json +5 -4
package/index.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Coordinates, GraphEdge, GraphNode, Level_t, Network } from "@wemap/geo";
|
|
2
|
+
|
|
3
|
+
declare module '@wemap/osm' {
|
|
4
|
+
|
|
5
|
+
export type OsmTags = { [key: string]: string };
|
|
6
|
+
|
|
7
|
+
export class OsmElement {
|
|
8
|
+
id: number | null;
|
|
9
|
+
tags: OsmTags;
|
|
10
|
+
constructor(id: number, tags?: OsmTags)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class OsmModel {
|
|
14
|
+
nodes: OsmNode[];
|
|
15
|
+
ways: OsmWay[];
|
|
16
|
+
|
|
17
|
+
constructor(nodes?: OsmNode[], ways?: OsmWay[]);
|
|
18
|
+
|
|
19
|
+
getNodeById(id: number): OsmNode | null;
|
|
20
|
+
getNodeByName(name: string): OsmNode | null;
|
|
21
|
+
getWayById(id: number): OsmWay | null;
|
|
22
|
+
getWayByName(name: string): OsmWay | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class OsmNode extends OsmElement {
|
|
26
|
+
coords: Coordinates | null;
|
|
27
|
+
ways: OsmWay[];
|
|
28
|
+
|
|
29
|
+
constructor(id: number, coords: Coordinates, tags?: OsmTags);
|
|
30
|
+
|
|
31
|
+
get isElevator(): boolean;
|
|
32
|
+
get isConveying(): boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class OsmParser {
|
|
36
|
+
static parseOsmXmlString(osmXmlString: string): OsmModel;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class OsmWay {
|
|
40
|
+
nodes: OsmNode[];
|
|
41
|
+
level: Level_t;
|
|
42
|
+
|
|
43
|
+
constructor(id: number, tags?: OsmTags, level?: Level_t);
|
|
44
|
+
|
|
45
|
+
get areStairs(): boolean;
|
|
46
|
+
get isConveying(): boolean;
|
|
47
|
+
get isEscalator(): boolean;
|
|
48
|
+
get isMovingWalkway(): boolean;
|
|
49
|
+
get isArea(): boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type WaySelector = (way: OsmWay) => boolean;
|
|
53
|
+
export const DEFAULT_WAY_SELECTOR: WaySelector;
|
|
54
|
+
export const HIGHWAYS_PEDESTRIANS: string[];
|
|
55
|
+
|
|
56
|
+
export class OsmNetworkUtils {
|
|
57
|
+
static getNodeByName(network: Network<OsmElement>, name: string): GraphNode<OsmElement> | null;
|
|
58
|
+
static getEdgeByName(network: Network<OsmElement>, name: string): GraphEdge<OsmElement> | null;
|
|
59
|
+
static createNetworkFromOsmModel(osmModel: OsmModel, waySelectionFilter?: WaySelector): Network<OsmElement>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
],
|
|
6
6
|
"description": "Wemap OSM utils package",
|
|
7
7
|
"main": "index.js",
|
|
8
|
+
"typings": "index.d.ts",
|
|
8
9
|
"repository": {
|
|
9
10
|
"type": "git",
|
|
10
11
|
"url": "git+https://github.com/wemap/wemap-modules-js.git",
|
|
11
12
|
"directory": "packages/osm"
|
|
12
13
|
},
|
|
13
14
|
"name": "@wemap/osm",
|
|
14
|
-
"version": "10.
|
|
15
|
+
"version": "10.11.1",
|
|
15
16
|
"bugs": {
|
|
16
17
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
17
18
|
},
|
|
@@ -25,9 +26,9 @@
|
|
|
25
26
|
],
|
|
26
27
|
"license": "ISC",
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@wemap/geo": "^10.
|
|
29
|
-
"@wemap/logger": "^10.
|
|
29
|
+
"@wemap/geo": "^10.11.1",
|
|
30
|
+
"@wemap/logger": "^10.11.1",
|
|
30
31
|
"saxes": "^5.0.1"
|
|
31
32
|
},
|
|
32
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "e01001affc1f02f2c847a63de870f63734b98a1c"
|
|
33
34
|
}
|