@osmix/core 0.1.6 → 0.1.7
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/CHANGELOG.md +128 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mocks.d.ts +13 -0
- package/dist/mocks.d.ts.map +1 -0
- package/dist/mocks.js +122 -0
- package/dist/mocks.js.map +1 -0
- package/package.json +10 -35
- package/src/index.ts +1 -0
- package/{test/mock-osm.ts → src/mocks.ts} +3 -3
- package/tsconfig.build.json +5 -0
- package/tsconfig.json +9 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# @osmix/core
|
|
2
|
+
|
|
3
|
+
## 0.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2a634cb: Fix publishing
|
|
8
|
+
- Updated dependencies [2a634cb]
|
|
9
|
+
- @osmix/shared@0.0.12
|
|
10
|
+
|
|
11
|
+
## 0.1.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 3c8ee95: Fix and simplify package exports
|
|
16
|
+
- Updated dependencies [3c8ee95]
|
|
17
|
+
- @osmix/shared@0.0.11
|
|
18
|
+
|
|
19
|
+
## 0.1.5
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [12728ed]
|
|
24
|
+
- @osmix/shared@0.0.10
|
|
25
|
+
|
|
26
|
+
## 0.1.4
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- f32e4ee: General cleanup
|
|
31
|
+
- Updated dependencies [f32e4ee]
|
|
32
|
+
- @osmix/shared@0.0.9
|
|
33
|
+
|
|
34
|
+
## 0.1.3
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- f468db5: Fix publishing (2)
|
|
39
|
+
- Updated dependencies [f468db5]
|
|
40
|
+
- @osmix/shared@0.0.8
|
|
41
|
+
|
|
42
|
+
## 0.1.2
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- 68d6bd8: Fix publishing for packages.
|
|
47
|
+
- Updated dependencies [68d6bd8]
|
|
48
|
+
- @osmix/shared@0.0.7
|
|
49
|
+
|
|
50
|
+
## 0.1.1
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- d4f4b1f: Add content hashing for quick `isEqual`s checks of two similar `Osm` indexes. Typically used for checking post-merge.
|
|
55
|
+
|
|
56
|
+
## 0.1.0
|
|
57
|
+
|
|
58
|
+
### Minor Changes
|
|
59
|
+
|
|
60
|
+
- 29ed376: Routing: make graph transferable
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- 803c05c: Merge app style cleanup
|
|
65
|
+
- cbe4273: Osm index storage and reload
|
|
66
|
+
- ff40416: Refactor main `osmix` lib external APIs
|
|
67
|
+
|
|
68
|
+
## 0.0.6
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- 3846a0c: Integrate geographic spatial indexing libraries
|
|
73
|
+
- cdab4db: Add router
|
|
74
|
+
- Updated dependencies [0cd8a2e]
|
|
75
|
+
- @osmix/shared@0.0.6
|
|
76
|
+
|
|
77
|
+
## 0.0.5
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- a33a280: Create an easy way to estimate bytes required for a given OSM size
|
|
82
|
+
- edbb26b: Handle more Relation types
|
|
83
|
+
- 69a36bd: Switch Nodes coordinate storage to Int32Array
|
|
84
|
+
- Updated dependencies [bb629cf]
|
|
85
|
+
- Updated dependencies [edbb26b]
|
|
86
|
+
- Updated dependencies [69a36bd]
|
|
87
|
+
- @osmix/shared@0.0.5
|
|
88
|
+
|
|
89
|
+
## 0.0.4
|
|
90
|
+
|
|
91
|
+
### Patch Changes
|
|
92
|
+
|
|
93
|
+
- d001d9a: Refactor to align around new main external API
|
|
94
|
+
- 4303c40: Refactor core Osmix index to prepare for future work
|
|
95
|
+
- Updated dependencies [572cbd8]
|
|
96
|
+
- Updated dependencies [d001d9a]
|
|
97
|
+
- @osmix/shared@0.0.4
|
|
98
|
+
|
|
99
|
+
## 0.0.3
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- b4a3ff2: Improve Relation handling and display
|
|
104
|
+
- c0193dd: Import GeoJSON into Osmix
|
|
105
|
+
- Updated dependencies [b4a3ff2]
|
|
106
|
+
- @osmix/shared@0.0.3
|
|
107
|
+
- @osmix/json@0.0.3
|
|
108
|
+
- @osmix/pbf@0.0.2
|
|
109
|
+
|
|
110
|
+
## 0.0.2
|
|
111
|
+
|
|
112
|
+
### Patch Changes
|
|
113
|
+
|
|
114
|
+
- 33d9c12: Modify types to take Uint8Array<ArrayBufferLike> for compatiblity
|
|
115
|
+
- Updated dependencies [33d9c12]
|
|
116
|
+
- @osmix/shared@0.0.2
|
|
117
|
+
- @osmix/json@0.0.2
|
|
118
|
+
- @osmix/pbf@0.0.2
|
|
119
|
+
|
|
120
|
+
## 0.0.1
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- Initial release
|
|
125
|
+
- Updated dependencies
|
|
126
|
+
- @osmix/json@0.0.1
|
|
127
|
+
- @osmix/pbf@0.0.1
|
|
128
|
+
- @osmix/shared@0.0.1
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACnE,cAAc,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACnE,cAAc,QAAQ,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAmB,MAAM,gBAAgB,CAAA;AACnE,cAAc,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAmB,MAAM,gBAAgB,CAAA;AACnE,cAAc,QAAQ,CAAA"}
|
package/dist/mocks.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Osm } from "./osm";
|
|
2
|
+
/**
|
|
3
|
+
* Create a base OSM with one way and two nodes.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createMockBaseOsm(): Osm;
|
|
6
|
+
/**
|
|
7
|
+
* Create a patch OSM with:
|
|
8
|
+
* - The same way as the base OSM, with new tags
|
|
9
|
+
* - A way that has an overlapping node with the first way, but does not share a node and so starts disconnected
|
|
10
|
+
* - A way that crosses over the first way, but does not share a node and so starts disconnected
|
|
11
|
+
*/
|
|
12
|
+
export declare function createMockPatchOsm(): Osm;
|
|
13
|
+
//# sourceMappingURL=mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAmC3B;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CAOvC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,GAAG,CAqFxC"}
|
package/dist/mocks.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Osm } from "./osm";
|
|
2
|
+
const YAKIM_LAT = 46.60207;
|
|
3
|
+
const YAKIM_LON = -120.505898;
|
|
4
|
+
const ONE_KM_LON = 0.0131; // approximately
|
|
5
|
+
const ONE_KM_LAT = 0.009;
|
|
6
|
+
const node0 = {
|
|
7
|
+
id: 0,
|
|
8
|
+
lat: YAKIM_LAT,
|
|
9
|
+
lon: YAKIM_LON,
|
|
10
|
+
};
|
|
11
|
+
const node1 = {
|
|
12
|
+
id: 1,
|
|
13
|
+
lat: YAKIM_LAT,
|
|
14
|
+
lon: YAKIM_LON - ONE_KM_LON, // approximately 1km west
|
|
15
|
+
};
|
|
16
|
+
function addBaseNodes(osm) {
|
|
17
|
+
osm.nodes.addNode(node0);
|
|
18
|
+
osm.nodes.addNode(node1);
|
|
19
|
+
}
|
|
20
|
+
function addBaseWays(osm) {
|
|
21
|
+
osm.ways.addWay({
|
|
22
|
+
id: 1,
|
|
23
|
+
refs: [0, 1],
|
|
24
|
+
tags: {
|
|
25
|
+
highway: "primary",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create a base OSM with one way and two nodes.
|
|
31
|
+
*/
|
|
32
|
+
export function createMockBaseOsm() {
|
|
33
|
+
const base = new Osm();
|
|
34
|
+
addBaseNodes(base);
|
|
35
|
+
base.nodes.buildIndex();
|
|
36
|
+
addBaseWays(base);
|
|
37
|
+
base.buildIndexes();
|
|
38
|
+
return base;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a patch OSM with:
|
|
42
|
+
* - The same way as the base OSM, with new tags
|
|
43
|
+
* - A way that has an overlapping node with the first way, but does not share a node and so starts disconnected
|
|
44
|
+
* - A way that crosses over the first way, but does not share a node and so starts disconnected
|
|
45
|
+
*/
|
|
46
|
+
export function createMockPatchOsm() {
|
|
47
|
+
const osm = new Osm();
|
|
48
|
+
addBaseNodes(osm);
|
|
49
|
+
// Add way the connects with base way node 0 (will replace it)
|
|
50
|
+
osm.nodes.addNode({
|
|
51
|
+
...node0,
|
|
52
|
+
id: 2,
|
|
53
|
+
tags: {
|
|
54
|
+
crossing: "yes",
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
osm.nodes.addNode({
|
|
58
|
+
...node1,
|
|
59
|
+
id: 3,
|
|
60
|
+
lon: YAKIM_LON + ONE_KM_LON, // ends 1km east of the center point
|
|
61
|
+
});
|
|
62
|
+
// Add nodes for disconnected way
|
|
63
|
+
osm.nodes.addNode({
|
|
64
|
+
id: 4,
|
|
65
|
+
lat: YAKIM_LAT - ONE_KM_LAT, // 1km south
|
|
66
|
+
lon: YAKIM_LON + ONE_KM_LON / 4, // 250m east
|
|
67
|
+
});
|
|
68
|
+
osm.nodes.addNode({
|
|
69
|
+
id: 5,
|
|
70
|
+
lat: YAKIM_LAT + ONE_KM_LAT, // 1km north
|
|
71
|
+
lon: YAKIM_LON + ONE_KM_LON / 4, // 250m east
|
|
72
|
+
});
|
|
73
|
+
// Add nodes for crossing way
|
|
74
|
+
osm.nodes.addNode({
|
|
75
|
+
id: 6,
|
|
76
|
+
lat: YAKIM_LAT - ONE_KM_LAT, // 1km south
|
|
77
|
+
lon: YAKIM_LON + ONE_KM_LON / 2, // 500m east
|
|
78
|
+
});
|
|
79
|
+
osm.nodes.addNode({
|
|
80
|
+
id: 7,
|
|
81
|
+
lat: YAKIM_LAT + ONE_KM_LAT, // 1km north
|
|
82
|
+
lon: YAKIM_LON + ONE_KM_LON / 2, // 500m east
|
|
83
|
+
});
|
|
84
|
+
osm.nodes.buildIndex();
|
|
85
|
+
// Add same base way with new tags
|
|
86
|
+
osm.ways.addWay({
|
|
87
|
+
id: 1,
|
|
88
|
+
refs: [0, 1],
|
|
89
|
+
tags: {
|
|
90
|
+
highway: "primary",
|
|
91
|
+
version: "2",
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
// Add way that overlaps with base way node 1. Node should be de-duplicated.
|
|
95
|
+
osm.ways.addWay({
|
|
96
|
+
id: 2,
|
|
97
|
+
refs: [2, 3],
|
|
98
|
+
tags: {
|
|
99
|
+
highway: "secondary",
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
// Add way that crosses way 2, and should generate 1 intersection.
|
|
103
|
+
osm.ways.addWay({
|
|
104
|
+
id: 3,
|
|
105
|
+
refs: [4, 5],
|
|
106
|
+
tags: {
|
|
107
|
+
highway: "primary",
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
// Add a way that crosses way 2, but has a tag indicating it is an underpass and should be left alone
|
|
111
|
+
osm.ways.addWay({
|
|
112
|
+
id: 4,
|
|
113
|
+
refs: [6, 7],
|
|
114
|
+
tags: {
|
|
115
|
+
highway: "underpass",
|
|
116
|
+
tunnel: "yes",
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
osm.buildIndexes();
|
|
120
|
+
return osm;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=mocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAE3B,MAAM,SAAS,GAAG,QAAQ,CAAA;AAC1B,MAAM,SAAS,GAAG,CAAC,UAAU,CAAA;AAE7B,MAAM,UAAU,GAAG,MAAM,CAAA,CAAC,gBAAgB;AAC1C,MAAM,UAAU,GAAG,KAAK,CAAA;AAExB,MAAM,KAAK,GAAY;IACtB,EAAE,EAAE,CAAC;IACL,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;CACd,CAAA;AAED,MAAM,KAAK,GAAY;IACtB,EAAE,EAAE,CAAC;IACL,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS,GAAG,UAAU,EAAE,yBAAyB;CACtD,CAAA;AAED,SAAS,YAAY,CAAC,GAAQ;IAC7B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACxB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AACzB,CAAC;AAED,SAAS,WAAW,CAAC,GAAQ;IAC5B,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;QACf,EAAE,EAAE,CAAC;QACL,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACZ,IAAI,EAAE;YACL,OAAO,EAAE,SAAS;SAClB;KACD,CAAC,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAChC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAA;IACtB,Y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json.schemastore.org/package.json",
|
|
3
3
|
"name": "@osmix/core",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.7",
|
|
6
6
|
"description": "An OSM PBF reader, writer, and merge tool written in TypeScript",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
},
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./src/index.ts",
|
|
14
|
-
"bun": "./src/index.ts",
|
|
15
|
-
"development|production": "./src/index.ts",
|
|
16
|
-
"default": "./dist/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./test/*": "./test/*.ts"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"dist",
|
|
22
|
-
"src",
|
|
23
|
-
"test",
|
|
24
|
-
"README.md",
|
|
25
|
-
"LICENSE"
|
|
26
|
-
],
|
|
27
7
|
"license": "MIT",
|
|
28
8
|
"repository": {
|
|
29
9
|
"type": "git",
|
|
30
10
|
"url": "git+https://github.com/conveyal/osmix.git"
|
|
31
11
|
},
|
|
32
|
-
"
|
|
33
|
-
"bugs": {
|
|
34
|
-
"url": "https://github.com/conveyal/osmix/issues"
|
|
35
|
-
},
|
|
36
|
-
"sideEffects": false,
|
|
12
|
+
"main": "./dist/index.js",
|
|
37
13
|
"scripts": {
|
|
38
14
|
"build": "tsc -p tsconfig.build.json",
|
|
39
15
|
"bench": "bun test --bench",
|
|
40
|
-
"prepare": "bun run build",
|
|
41
|
-
"release": "bun publish",
|
|
42
16
|
"test": "bun test",
|
|
43
17
|
"typecheck": "tsgo --noEmit"
|
|
44
18
|
},
|
|
45
19
|
"devDependencies": {
|
|
46
|
-
"@osmix/pbf": "
|
|
47
|
-
"@types/bun": "
|
|
48
|
-
"typescript": "
|
|
20
|
+
"@osmix/pbf": "0.0.8",
|
|
21
|
+
"@types/bun": "^1.3.9",
|
|
22
|
+
"typescript": "^5.9.0"
|
|
49
23
|
},
|
|
50
24
|
"dependencies": {
|
|
51
|
-
"@osmix/shared": "
|
|
25
|
+
"@osmix/shared": "0.0.12",
|
|
52
26
|
"flatbush": "^4.4.1",
|
|
53
27
|
"geoflatbush": "^2.1.0",
|
|
54
28
|
"geokdbush": "^2.0.1",
|
|
55
29
|
"kdbush": "mourner/kdbush#16416cd"
|
|
56
|
-
}
|
|
57
|
-
|
|
30
|
+
},
|
|
31
|
+
"types": "./dist/index.d.ts"
|
|
32
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OsmNode } from "@osmix/shared/types"
|
|
2
|
-
import { Osm } from "
|
|
2
|
+
import { Osm } from "./osm"
|
|
3
3
|
|
|
4
4
|
const YAKIM_LAT = 46.60207
|
|
5
5
|
const YAKIM_LON = -120.505898
|
|
@@ -37,7 +37,7 @@ function addBaseWays(osm: Osm) {
|
|
|
37
37
|
/**
|
|
38
38
|
* Create a base OSM with one way and two nodes.
|
|
39
39
|
*/
|
|
40
|
-
export function
|
|
40
|
+
export function createMockBaseOsm(): Osm {
|
|
41
41
|
const base = new Osm()
|
|
42
42
|
addBaseNodes(base)
|
|
43
43
|
base.nodes.buildIndex()
|
|
@@ -52,7 +52,7 @@ export function createBaseOsm(): Osm {
|
|
|
52
52
|
* - A way that has an overlapping node with the first way, but does not share a node and so starts disconnected
|
|
53
53
|
* - A way that crosses over the first way, but does not share a node and so starts disconnected
|
|
54
54
|
*/
|
|
55
|
-
export function
|
|
55
|
+
export function createMockPatchOsm(): Osm {
|
|
56
56
|
const osm = new Osm()
|
|
57
57
|
|
|
58
58
|
addBaseNodes(osm)
|