@truelies/osm-dybuf 0.3.2 → 0.3.3
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/README.md +6 -4
- package/grid_index.mjs +1 -1
- package/package.json +1 -1
- package/schema_ids.mjs +3 -0
package/README.md
CHANGED
|
@@ -21,8 +21,10 @@ Support matrix:
|
|
|
21
21
|
Current frontend-facing schema notes:
|
|
22
22
|
|
|
23
23
|
- `admin_boundary` is retained in schema IDs for compatibility, but new exports no longer send boundary lines to the frontend.
|
|
24
|
-
-
|
|
24
|
+
- `place_label` remains in schema IDs for compatibility, but current exports no longer emit place-name labels to the frontend.
|
|
25
25
|
- `road_express` was added for motorway / controlled-access corridors.
|
|
26
|
+
- `water_wetland` separates marsh / bog / fen / wetland polygons from deeper open water.
|
|
27
|
+
- Current project max level is `13`; newer exports no longer emit `lv14~16`.
|
|
26
28
|
|
|
27
29
|
## Usage
|
|
28
30
|
|
|
@@ -83,7 +85,7 @@ const parent = new GridUnit(9).toUpperLevelGridex(children[0]); // back to level
|
|
|
83
85
|
|
|
84
86
|
- `toLowerLevelGridexes(gridex)`:
|
|
85
87
|
- returns 4 child cells at `level + 1`
|
|
86
|
-
- throws when current unit is already max level (`
|
|
88
|
+
- throws when current unit is already max level (`13`)
|
|
87
89
|
- `toUpperLevelGridex(gridex)`:
|
|
88
90
|
- returns the parent cell at `level - 1`
|
|
89
91
|
- throws when current unit is level `0`
|
|
@@ -99,7 +101,7 @@ npm test # runs unit tests (node:test)
|
|
|
99
101
|
Unit test example (`tests/grid_index.test.mjs`) covers:
|
|
100
102
|
- `gridexesAt` near axis (no zero index cell)
|
|
101
103
|
- `toLowerLevelGridexes` and `toUpperLevelGridex` roundtrip
|
|
102
|
-
- level boundary errors (`lv0` has no upper level, `
|
|
104
|
+
- level boundary errors (`lv0` has no upper level, `lv13` has no lower level)
|
|
103
105
|
|
|
104
106
|
- `npm pack`: build a tarball so other repos can install via `npm install ./path/to/osm-dybuf-*.tgz`
|
|
105
107
|
- `npm link`: link the package locally (`npm link` here, then `npm link @truelies/osm-dybuf` in the consumer repo)
|
|
@@ -121,4 +123,4 @@ Unit test example (`tests/grid_index.test.mjs`) covers:
|
|
|
121
123
|
- `region_numeric_codes.json`: latest region ID table (generated via `scripts/dump_region_codes.py`)
|
|
122
124
|
- `inspect_dybuf.mjs`: CLI tool that uses the package locally
|
|
123
125
|
|
|
124
|
-
When schema IDs or DyBuf layouts change in the exporter, remember to bump the version here and re-publish/install so frontends and tools stay in sync. Version `0.3.
|
|
126
|
+
When schema IDs or DyBuf layouts change in the exporter, remember to bump the version here and re-publish/install so frontends and tools stay in sync. Version `0.3.3` aligns the package with the current `lv0~13` export range and the frontend feature set (`water_wetland`, `building`, no exported `place_label`).
|
package/grid_index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ export const GRID_LV0_UNIT = 30 * INT_COORD_SCALE;
|
|
|
6
6
|
const GRID_LV0_UNIT_FINE = GRID_LV0_UNIT * GRID_FINE_RES;
|
|
7
7
|
const GRID_LV0_LONDEX = 6;
|
|
8
8
|
const GRID_LV0_LATDEX = 3;
|
|
9
|
-
const MAX_LEVEL =
|
|
9
|
+
const MAX_LEVEL = 13;
|
|
10
10
|
const MAX_LONGITUDE_FINE = 180 * INT_COORD_SCALE * GRID_FINE_RES;
|
|
11
11
|
const MIN_LONGITUDE_FINE = -MAX_LONGITUDE_FINE;
|
|
12
12
|
const MAX_LATITUDE_FINE = 90 * INT_COORD_SCALE * GRID_FINE_RES;
|
package/package.json
CHANGED
package/schema_ids.mjs
CHANGED
|
@@ -32,6 +32,7 @@ export const MAIN_FEATURE_IDS = Object.freeze({
|
|
|
32
32
|
road: 7,
|
|
33
33
|
waterway: 8,
|
|
34
34
|
place_label: 9,
|
|
35
|
+
building: 10,
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
const FEATURE_KIND_CODES = Object.freeze({
|
|
@@ -42,6 +43,8 @@ const FEATURE_KIND_CODES = Object.freeze({
|
|
|
42
43
|
natural_vegetation: ["natural", 1],
|
|
43
44
|
natural_bare: ["natural", 2],
|
|
44
45
|
waterbody: ["waterbody", 0],
|
|
46
|
+
water_wetland: ["waterbody", 1],
|
|
47
|
+
building: ["building", 0],
|
|
45
48
|
landuse: ["landuse", 0],
|
|
46
49
|
park: ["park", 0],
|
|
47
50
|
road_express: ["road", 0],
|