@truelies/osm-dybuf 0.2.6 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truelies/osm-dybuf",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Gridex OSM DyBuf parser and schema utilities",
5
5
  "type": "module",
6
6
  "main": "./osm_dybuf.mjs",
package/schema_ids.d.mts CHANGED
@@ -2,6 +2,7 @@ export declare const ENTITY_TYPE_IDS: Readonly<Record<string, number>>;
2
2
  export declare const ID_TO_ENTITY_TYPE: Readonly<Record<number, string>>;
3
3
  export declare const GEOMETRY_KIND_IDS: Readonly<Record<string, number>>;
4
4
  export declare const ID_TO_GEOMETRY_KIND: Readonly<Record<number, string>>;
5
+ export declare const MAIN_FEATURE_IDS: Readonly<Record<string, number>>;
5
6
  export declare const FEATURE_KIND_IDS: Readonly<Record<string, number>>;
6
7
  export declare const ID_TO_FEATURE_KIND: Readonly<Record<number, string>>;
7
8
  export declare const REGION_NUMERIC_CODES: Readonly<Record<string, number>>;
package/schema_ids.mjs CHANGED
@@ -21,20 +21,48 @@ export const GEOMETRY_KIND_IDS = Object.freeze({
21
21
  export const ID_TO_GEOMETRY_KIND = Object.freeze(
22
22
  Object.fromEntries(Object.entries(GEOMETRY_KIND_IDS).map(([k, v]) => [String(v), k]))
23
23
  );
24
- export const FEATURE_KIND_IDS = Object.freeze({
24
+ export const MAIN_FEATURE_IDS = Object.freeze({
25
25
  country_land: 0,
26
- admin_boundary: 100,
27
- coastline: 200,
28
- natural_area: 210,
29
- waterbody: 220,
30
- landuse: 230,
31
- park: 240,
32
- road_major: 300,
33
- road_minor: 301,
34
- waterway: 400,
35
- place_label: 500,
26
+ admin_boundary: 1,
27
+ coastline: 2,
28
+ natural: 3,
29
+ waterbody: 4,
30
+ landuse: 5,
31
+ park: 6,
32
+ road: 7,
33
+ waterway: 8,
34
+ place_label: 9,
36
35
  });
37
36
 
37
+ const FEATURE_KIND_CODES = Object.freeze({
38
+ country_land: ["country_land", 0],
39
+ admin_boundary: ["admin_boundary", 0],
40
+ coastline: ["coastline", 0],
41
+ natural_forest: ["natural", 0],
42
+ natural_vegetation: ["natural", 1],
43
+ natural_bare: ["natural", 2],
44
+ waterbody: ["waterbody", 0],
45
+ landuse: ["landuse", 0],
46
+ park: ["park", 0],
47
+ road_major: ["road", 0],
48
+ road_minor: ["road", 1],
49
+ road_local: ["road", 2],
50
+ road_trail: ["road", 3],
51
+ waterway_major: ["waterway", 0],
52
+ waterway_stream: ["waterway", 1],
53
+ waterway_minor: ["waterway", 2],
54
+ place_label: ["place_label", 0],
55
+ });
56
+
57
+ export const FEATURE_KIND_IDS = Object.freeze(
58
+ Object.fromEntries(
59
+ Object.entries(FEATURE_KIND_CODES).map(([kind, [main, sub]]) => [
60
+ kind,
61
+ sub * 64 + MAIN_FEATURE_IDS[main],
62
+ ])
63
+ )
64
+ );
65
+
38
66
  export const REGION_NUMERIC_CODES = Object.freeze(REGION_CODES_RAW);
39
67
 
40
68
  export const ID_TO_FEATURE_KIND = Object.freeze(