@truelies/osm-dybuf 0.4.1 → 0.4.2
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 +4 -4
- package/grid_index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Current frontend-facing schema notes:
|
|
|
28
28
|
- Breaking change in `0.4.x`: `GridFeature.featureId` is numeric. Consumers should map it with `ID_TO_FEATURE_KIND[String(featureId)]` or `unpackFeatureId(featureId)` when string/debug output is needed.
|
|
29
29
|
- `road_express` covers motorway corridors plus `trunk` ways tagged with `motorroad=yes` (for example many Taiwan expressway mainlines).
|
|
30
30
|
- `water_wetland` separates marsh / bog / fen / wetland polygons from deeper open water.
|
|
31
|
-
-
|
|
31
|
+
- Geometry payload exports currently stop at `lv13`, but Gridex/index helpers remain valid through `lv16` for higher-detail indexing metadata.
|
|
32
32
|
|
|
33
33
|
## Usage
|
|
34
34
|
|
|
@@ -101,7 +101,7 @@ const parent = new GridUnit(9).toUpperLevelGridex(children[0]); // back to level
|
|
|
101
101
|
|
|
102
102
|
- `toLowerLevelGridexes(gridex)`:
|
|
103
103
|
- returns 4 child cells at `level + 1`
|
|
104
|
-
- throws when current unit is already max level (`
|
|
104
|
+
- throws when current unit is already max level (`16`)
|
|
105
105
|
- `toUpperLevelGridex(gridex)`:
|
|
106
106
|
- returns the parent cell at `level - 1`
|
|
107
107
|
- throws when current unit is level `0`
|
|
@@ -117,7 +117,7 @@ npm test # runs unit tests (node:test)
|
|
|
117
117
|
Unit test example (`tests/grid_index.test.mjs`) covers:
|
|
118
118
|
- `gridexesAt` near axis (no zero index cell)
|
|
119
119
|
- `toLowerLevelGridexes` and `toUpperLevelGridex` roundtrip
|
|
120
|
-
- level boundary errors (`lv0` has no upper level, `
|
|
120
|
+
- level boundary errors (`lv0` has no upper level, `lv16` has no lower level)
|
|
121
121
|
|
|
122
122
|
- `npm pack`: build a tarball so other repos can install via `npm install ./path/to/osm-dybuf-*.tgz`
|
|
123
123
|
- `npm link`: link the package locally (`npm link` here, then `npm link @truelies/osm-dybuf` in the consumer repo)
|
|
@@ -139,4 +139,4 @@ Unit test example (`tests/grid_index.test.mjs`) covers:
|
|
|
139
139
|
- `region_numeric_codes.json`: latest region ID table (generated via `scripts/dump_region_codes.py`)
|
|
140
140
|
- `inspect_dybuf.mjs`: CLI tool that uses the package locally
|
|
141
141
|
|
|
142
|
-
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.4.
|
|
142
|
+
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.4.2` aligns the package with the current `lv0~13` export range, the current frontend feature set (`water_wetland`, `building`, derived `label_*`, no exported `place_label`), and the numeric `featureId` parser contract.
|
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 = 16;
|
|
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;
|