@mailwoman/spatial 9.4.0 → 10.1.0

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.
Files changed (156) hide show
  1. package/README.md +2 -2
  2. package/lib/bbox.ts +41 -34
  3. package/lib/{coordinate-bounds.ts → coordinate/bounds.ts} +2 -2
  4. package/lib/{coordinate-formats.ts → coordinate/formats.ts} +11 -28
  5. package/lib/distance.ts +53 -27
  6. package/lib/feature.ts +2 -2
  7. package/lib/geometries/point.ts +41 -33
  8. package/lib/geometries/polygon.ts +24 -128
  9. package/lib/geometries/ring-blob.ts +33 -130
  10. package/lib/google/place-id.ts +4 -2
  11. package/lib/h3/cell.ts +21 -76
  12. package/lib/h3/coverage.ts +11 -7
  13. package/lib/h3/interior-cells.ts +13 -34
  14. package/lib/h3/polygon-cells.ts +59 -165
  15. package/lib/{h3/index.ts → h3.ts} +1 -1
  16. package/lib/index.ts +6 -6
  17. package/lib/objects.ts +6 -6
  18. package/lib/open-location-code.ts +11 -42
  19. package/lib/osgb36.ts +28 -187
  20. package/lib/polyline.ts +5 -3
  21. package/lib/position.ts +20 -4
  22. package/lib/projection/transform.ts +114 -0
  23. package/lib/projection.ts +1 -1
  24. package/lib/well-known-text.ts +8 -8
  25. package/out/bbox.d.ts +16 -13
  26. package/out/bbox.d.ts.map +1 -1
  27. package/out/bbox.js +32 -23
  28. package/out/bbox.js.map +1 -1
  29. package/out/{coordinate-bounds.d.ts → coordinate/bounds.d.ts} +3 -3
  30. package/out/coordinate/bounds.d.ts.map +1 -0
  31. package/out/{coordinate-bounds.js → coordinate/bounds.js} +3 -3
  32. package/out/coordinate/bounds.js.map +1 -0
  33. package/out/{coordinate-formats.d.ts → coordinate/formats.d.ts} +9 -12
  34. package/out/coordinate/formats.d.ts.map +1 -0
  35. package/out/{coordinate-formats.js → coordinate/formats.js} +12 -29
  36. package/out/coordinate/formats.js.map +1 -0
  37. package/out/distance.d.ts +48 -25
  38. package/out/distance.d.ts.map +1 -1
  39. package/out/distance.js +53 -27
  40. package/out/distance.js.map +1 -1
  41. package/out/feature.d.ts +2 -2
  42. package/out/feature.d.ts.map +1 -1
  43. package/out/geometries/point.d.ts +30 -22
  44. package/out/geometries/point.d.ts.map +1 -1
  45. package/out/geometries/point.js +35 -29
  46. package/out/geometries/point.js.map +1 -1
  47. package/out/geometries/polygon.d.ts +23 -122
  48. package/out/geometries/polygon.d.ts.map +1 -1
  49. package/out/geometries/polygon.js +13 -41
  50. package/out/geometries/polygon.js.map +1 -1
  51. package/out/geometries/ring-blob.d.ts +23 -109
  52. package/out/geometries/ring-blob.d.ts.map +1 -1
  53. package/out/geometries/ring-blob.js +29 -115
  54. package/out/geometries/ring-blob.js.map +1 -1
  55. package/out/{geometries/index.js → geometries.d.ts} +1 -1
  56. package/out/geometries.d.ts.map +1 -0
  57. package/out/{geometries/index.d.ts → geometries.js} +1 -1
  58. package/out/geometries.js.map +1 -0
  59. package/out/google/place-id.d.ts +4 -2
  60. package/out/google/place-id.d.ts.map +1 -1
  61. package/out/google/place-id.js.map +1 -1
  62. package/out/{google/index.d.ts → google.d.ts} +1 -1
  63. package/out/google.d.ts.map +1 -0
  64. package/out/{google/index.js → google.js} +1 -1
  65. package/out/google.js.map +1 -0
  66. package/out/h3/cell.d.ts +19 -73
  67. package/out/h3/cell.d.ts.map +1 -1
  68. package/out/h3/cell.js +20 -63
  69. package/out/h3/cell.js.map +1 -1
  70. package/out/h3/coverage.d.ts +11 -7
  71. package/out/h3/coverage.d.ts.map +1 -1
  72. package/out/h3/coverage.js +11 -7
  73. package/out/h3/coverage.js.map +1 -1
  74. package/out/h3/interior-cells.d.ts +9 -28
  75. package/out/h3/interior-cells.d.ts.map +1 -1
  76. package/out/h3/interior-cells.js +13 -32
  77. package/out/h3/interior-cells.js.map +1 -1
  78. package/out/h3/polygon-cells.d.ts +28 -120
  79. package/out/h3/polygon-cells.d.ts.map +1 -1
  80. package/out/h3/polygon-cells.js +48 -146
  81. package/out/h3/polygon-cells.js.map +1 -1
  82. package/out/{h3/index.d.ts → h3.d.ts} +2 -2
  83. package/out/h3.d.ts.map +1 -0
  84. package/out/{h3/index.js → h3.js} +2 -2
  85. package/out/h3.js.map +1 -0
  86. package/out/index.d.ts +6 -6
  87. package/out/index.d.ts.map +1 -1
  88. package/out/index.js +6 -6
  89. package/out/index.js.map +1 -1
  90. package/out/objects.d.ts +6 -6
  91. package/out/objects.d.ts.map +1 -1
  92. package/out/open-location-code.d.ts +11 -22
  93. package/out/open-location-code.d.ts.map +1 -1
  94. package/out/open-location-code.js +9 -40
  95. package/out/open-location-code.js.map +1 -1
  96. package/out/osgb36.d.ts +21 -97
  97. package/out/osgb36.d.ts.map +1 -1
  98. package/out/osgb36.js +12 -165
  99. package/out/osgb36.js.map +1 -1
  100. package/out/polyline.d.ts +5 -3
  101. package/out/polyline.d.ts.map +1 -1
  102. package/out/polyline.js +5 -3
  103. package/out/polyline.js.map +1 -1
  104. package/out/position.d.ts +17 -3
  105. package/out/position.d.ts.map +1 -1
  106. package/out/position.js +2 -2
  107. package/out/position.js.map +1 -1
  108. package/out/projection/transform.d.ts +70 -0
  109. package/out/projection/transform.d.ts.map +1 -0
  110. package/out/{projection-transform.js → projection/transform.js} +15 -17
  111. package/out/projection/transform.js.map +1 -0
  112. package/out/projection.d.ts +1 -1
  113. package/out/projection.d.ts.map +1 -1
  114. package/out/projection.js +1 -1
  115. package/out/regions/codes.d.ts.map +1 -1
  116. package/out/{regions/index.js → regions.d.ts} +1 -1
  117. package/out/regions.d.ts.map +1 -0
  118. package/out/{regions/index.d.ts → regions.js} +1 -1
  119. package/out/regions.js.map +1 -0
  120. package/out/tools/ogr/stream.d.ts +44 -0
  121. package/out/tools/ogr/stream.d.ts.map +1 -0
  122. package/out/tools/{ogr-stream.js → ogr/stream.js} +17 -10
  123. package/out/tools/ogr/stream.js.map +1 -0
  124. package/out/tools/ogr.d.ts +13 -10
  125. package/out/tools/ogr.d.ts.map +1 -1
  126. package/out/tools/ogr.js +18 -14
  127. package/out/tools/ogr.js.map +1 -1
  128. package/out/tools/tsconfig.tsbuildinfo +1 -0
  129. package/out/tsconfig.test.tsbuildinfo +1 -1
  130. package/out/well-known-text.d.ts +8 -8
  131. package/out/well-known-text.js +7 -7
  132. package/package.json +35 -127
  133. package/{lib/tools/ogr-stream.ts → tools/ogr/stream.ts} +25 -14
  134. package/{lib/tools → tools}/ogr.ts +26 -20
  135. package/lib/projection-transform.ts +0 -115
  136. package/out/coordinate-bounds.d.ts.map +0 -1
  137. package/out/coordinate-bounds.js.map +0 -1
  138. package/out/coordinate-formats.d.ts.map +0 -1
  139. package/out/coordinate-formats.js.map +0 -1
  140. package/out/geometries/index.d.ts.map +0 -1
  141. package/out/geometries/index.js.map +0 -1
  142. package/out/google/index.d.ts.map +0 -1
  143. package/out/google/index.js.map +0 -1
  144. package/out/h3/index.d.ts.map +0 -1
  145. package/out/h3/index.js.map +0 -1
  146. package/out/projection-transform.d.ts +0 -67
  147. package/out/projection-transform.d.ts.map +0 -1
  148. package/out/projection-transform.js.map +0 -1
  149. package/out/regions/index.d.ts.map +0 -1
  150. package/out/regions/index.js.map +0 -1
  151. package/out/tools/ogr-stream.d.ts +0 -34
  152. package/out/tools/ogr-stream.d.ts.map +0 -1
  153. package/out/tools/ogr-stream.js.map +0 -1
  154. /package/lib/{geometries/index.ts → geometries.ts} +0 -0
  155. /package/lib/{google/index.ts → google.ts} +0 -0
  156. /package/lib/{regions/index.ts → regions.ts} +0 -0
@@ -14,17 +14,13 @@ export function isPolygonLiteral(input) {
14
14
  /**
15
15
  * Predicate for checking if a polygon geometry is a solid, i.e. it has no holes.
16
16
  */
17
- // The parameter admits BOTH paths because distinguishing them is the function's job: defaulted to
18
- // `SolidPolygonPath`, it cannot be asked about a polygon with holes without the caller asserting past the signature.
17
+ // The parameter admits both paths because distinguishing them is the function's job.
19
18
  export function isSolidPolygonPath(input) {
20
19
  return input.coordinates.length === 1;
21
20
  }
22
21
  /**
23
- * Ray-cast a point against ONE linear ring — the even-odd crossing count. Shoot a ray along +lon and toggle on every
24
- * edge crossing.
25
- *
26
- * Points exactly on an edge are implementation-defined; either side is acceptable for geocoding, where admin boundaries
27
- * are Douglas-Peucker–simplified before they ever reach us.
22
+ * Ray-cast a point against one linear ring — the even-odd crossing count,
23
+ * with points exactly on an edge left implementation-defined.
28
24
  */
29
25
  export function pointInRing(lon, lat, ring) {
30
26
  let inside = false;
@@ -41,11 +37,8 @@ export function pointInRing(lon, lat, ring) {
41
37
  return inside;
42
38
  }
43
39
  /**
44
- * Even-odd containment over a polygon's ring list (`[outer, hole₁, …]`).
45
- *
46
- * Being inside an odd number of rings means inside the polygon, which handles holes — and islands inside holes —
47
- * without depending on ring winding order. GeoJSON nominally specifies orientation, but the gazetteer sources do not
48
- * reliably honour it, so the orientation-free rule is the one that survives real data.
40
+ * Even-odd containment over a polygon's ring list (`[outer, hole₁, …]`), independent of
41
+ * ring winding order because the gazetteer sources do not honor it reliably.
49
42
  */
50
43
  export function pointInPolygon(lon, lat, rings) {
51
44
  let inside = false;
@@ -57,17 +50,14 @@ export function pointInPolygon(lon, lat, rings) {
57
50
  return inside;
58
51
  }
59
52
  /**
60
- * Inside ANY polygon of a multi-polygon.
53
+ * Inside any polygon of a multi-polygon.
61
54
  */
62
55
  export function pointInMultiPolygon(lon, lat, polygons) {
63
56
  return polygons.some((rings) => pointInPolygon(lon, lat, rings));
64
57
  }
65
58
  /**
66
- * A geometry's polygons in the `MultiPolygon` coordinate shape, whichever areal type it arrived as — `null` when the
67
- * geometry is not areal (a Point or a LineString bounds no area).
68
- *
69
- * The one place a `Polygon` is lifted to `[rings]`; a caller that must refuse a non-areal geometry does so on the
70
- * `null`, with its own message.
59
+ * A geometry's polygons in the `MultiPolygon` coordinate shape, with a bare `Polygon`
60
+ * lifted to `[rings]` and `null` for any non-areal geometry.
71
61
  */
72
62
  export function arealPolygons(geometry) {
73
63
  if (!geometry)
@@ -79,12 +69,8 @@ export function arealPolygons(geometry) {
79
69
  return null;
80
70
  }
81
71
  /**
82
- * The polygons of a geometry that MUST be areal — {@linkcode arealPolygons} with the refusal every polygon ingest was
83
- * writing for itself.
84
- *
85
- * @param subject Names the feature in the refusal, e.g. `feature 41209`.
86
- * @param context Names the calling ingest, so a build log says which layer stopped.
87
- * @throws {Error} When the geometry is neither a `Polygon` nor a `MultiPolygon`.
72
+ * The polygons of a geometry that must be areal, throwing when the geometry
73
+ * is not a `Polygon` or `MultiPolygon`.
88
74
  */
89
75
  export function requireArealPolygons(geometry, subject, context) {
90
76
  const polygons = arealPolygons(geometry);
@@ -93,15 +79,8 @@ export function requireArealPolygons(geometry, subject, context) {
93
79
  throw new Error(`${context}: ${subject} is a ${geometry.type}, expected Polygon or MultiPolygon`);
94
80
  }
95
81
  /**
96
- * Does an areal GeoJSON geometry contain the point?
97
- *
98
- * The three-valued return is the point of the function. `null` means the geometry is NOT AREAL — a Point or a
99
- * LineString cannot contain anything — and a caller must read that as "no polygon on record", the same as a missing
100
- * geometry, never as a rejection. Collapsing it to `false` is how a place with a point-only record gets excluded from a
101
- * containment pass instead of falling through to the approximate path.
102
- *
103
- * `scripts/eval/pip-containment.py` grades the same containment truth against its own ray cast and has to be matched BY
104
- * HAND if this one changes — it is the one copy no import can reach.
82
+ * Does an areal GeoJSON geometry contain the point, returning `null` for a
83
+ * non-areal geometry rather than `false`.
105
84
  */
106
85
  export function geometryContains(geometry, lon, lat) {
107
86
  const polygons = arealPolygons(geometry);
@@ -110,13 +89,7 @@ export function geometryContains(geometry, lon, lat) {
110
89
  return polygons.some((rings) => pointInPolygon(lon, lat, rings));
111
90
  }
112
91
  /**
113
- * An axis-aligned rectangle as a closed ring, in GeoJSON `[lon, lat]` order and counter-clockwise — the exterior
114
- * winding.
115
- *
116
- * SHARED BECAUSE THE WINDING IS A CONVENTION AND A SECOND COPY IS A SECOND PLACE FOR IT TO DRIFT. Three layer builders
117
- * hand-build rectangles for their fixture rungs, and each pairs this with {@link reversedRing} to make a hole. A copy
118
- * whose hole is wound the same way as its exterior produces a fixture that passes every structural check and tests
119
- * nothing about hole handling — which is the exact failure the area cross-check exists to catch in production data.
92
+ * An axis-aligned rectangle as a closed ring, in GeoJSON `[lon, lat]` order and counter-clockwise.
120
93
  */
121
94
  export function rectangleRing(minLon, minLat, maxLon, maxLat) {
122
95
  return [
@@ -139,5 +112,4 @@ export function reversedRing(minLon, minLat, maxLon, maxLat) {
139
112
  [minLon, minLat],
140
113
  ];
141
114
  }
142
- //#endregion
143
115
  //# sourceMappingURL=polygon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"polygon.js","sourceRoot":"","sources":["../../lib/geometries/polygon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsGH;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAsC,KAAc;IACnF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAE7D,OAAO,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,aAAa,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;AACjH,CAAC;AAED;;GAEG;AACH,kGAAkG;AAClG,qHAAqH;AACrH,MAAM,UAAU,kBAAkB,CAAC,KAAkC;IACpE,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,CAAA;AACtC,CAAC;AAwBD;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,GAAW,EAAE,IAAqB;IAC1E,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;IAErB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,CAA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120 +3,55 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The ring blob — how a polygon layer stores one authority feature's UNSIMPLIFIED coordinates, and the
7
- * point test that reads it without materializing them.
8
- *
9
- * THE GEOMETRY IS THE TRUTH TABLE. An H3 index above it answers a cell that lies wholly inside one
10
- * feature; a cell a boundary crosses falls through to a ray cast against the few features the index
11
- * already named. A rooftop answer at a boundary — which is where the answer usually matters most — has
12
- * no other source, so the rings are stored at the resolution the authority published them and never
13
- * simplified.
14
- *
15
- * THE LAYOUT PUTS THE COORDINATES ON AN 8-BYTE BOUNDARY, so the reader takes a `Float64Array` view over
16
- * them instead of a `DataView.getFloat64` per ordinate. Header is `u32 version`, `u32 ringCount`, then
17
- * one `(u32 pointCount, u32 polygonIndex)` pair per ring — `8 + 8 × ringCount` bytes, a multiple of
18
- * eight by construction. Coordinates follow as `[lon, lat]` pairs, ring by ring.
19
- *
20
- * `polygonIndex` IS required AND CANNOT BE INFERRED. A source feature is a MultiPolygon, so its
21
- * rings belong to several polygons and "the first ring is the exterior" is true only per polygon. The
22
- * point test is orientation-free and nesting-free (even-odd across a polygon's own rings, the rule
23
- * {@link pointInPolygon} uses), but it still has to know which rings share a polygon: an island sitting
24
- * inside another polygon's hole is inside the layer and would cancel to "outside" if every ring were
25
- * pooled into one list.
26
- *
27
- * SHARED BY EVERY POLYGON LAYER RATHER THAN COPIED INTO EACH. `@mailwoman/flood` and `@mailwoman/soil`
28
- * both store an authority's rings this way, and a second copy of the alignment arithmetic or of the
29
- * signed-area reading would be a second thing to get right — both failure modes are silent, since a
30
- * mis-read blob answers a containment question wrongly and a hole-blind area reading answers "inside"
31
- * for every point in a hole.
6
+ * A polygon layer's stored ring blob: an 8-byte header, then a `(u32 pointCount, u32 polygonIndex)`
7
+ * pair per ring, then `[lon, lat]` pairs on an 8-byte boundary so the reader takes a
8
+ * `Float64Array` view; `polygonIndex` is required because one feature's rings belong to several polygons.
32
9
  */
10
+ import type { LatLonBounds } from "#bbox";
33
11
  import type { MultiPolygonRings } from "#geometries/polygon";
34
12
  /**
35
- * Format version stamped into every blob. A reader that meets a different number throws rather than reinterpreting
36
- * bytes it does not know the shape of.
13
+ * Format version stamped into every blob, rejected by a reader that meets a different number.
37
14
  */
38
15
  export declare const RING_BLOB_VERSION = 1;
39
16
  /**
40
- * One decoded feature: `[exteriorRing, ...holes]` per polygon, each ring a flat `[lon, lat, lon, lat, …]` run.
17
+ * One decoded feature: `[exteriorRing, ...holes]` per polygon, each ring a
18
+ * flat `[lon, lat, lon, lat, …]` run.
41
19
  */
42
20
  export interface DecodedRings {
43
- /**
44
- * `polygons[p][r]` is a flat coordinate run for ring `r` of polygon `p`.
45
- */
46
21
  polygons: number[][][];
47
22
  }
48
23
  /**
49
- * Pack a GeoJSON `MultiPolygon`/`Polygon` coordinate tree into the stored blob.
50
- *
51
- * @throws {RangeError} When the geometry carries no ring, or a ring carries fewer than four positions (a linear ring is
52
- * closed, so three is the minimum distinct-vertex count plus the repeat).
24
+ * Pack a GeoJSON `MultiPolygon`/`Polygon` coordinate tree into the stored blob, throwing
25
+ * when the geometry has no ring or a ring has fewer than four positions.
53
26
  */
54
27
  export declare function encodeRings(polygons: MultiPolygonRings): Uint8Array;
55
28
  /**
56
- * Is the point inside the stored geometry?
57
- *
58
- * Even-odd within each polygon's own ring list, inside-any-polygon across them — the orientation-free rule
59
- * {@linkcode pointInPolygon} states, applied without allocating the ring arrays. Reading a hole as an exterior ring is
60
- * what this rule survives: a point inside a hole crosses two rings and comes out even, whichever way either ring
61
- * winds.
29
+ * Is the point inside the stored geometry, even-odd within each polygon's own ring list
30
+ * and inside-any-polygon across them, without allocating the ring arrays.
62
31
  */
63
32
  export declare function pointInEncodedRings(blob: Uint8Array, lon: number, lat: number): boolean;
64
33
  /**
65
- * Unpack the blob back into per-polygon flat coordinate runs — for tests, for a debug render, and for the round-trip
66
- * check a build's fixtures assert.
34
+ * Unpack the blob back into per-polygon flat coordinate runs.
67
35
  */
68
36
  export declare function decodeRings(blob: Uint8Array): DecodedRings;
69
37
  /**
70
- * Signed spherical area of one linear ring, in square metres. **CLOCKWISE is positive**, counter-clockwise negative.
71
- *
72
- * The sign is the whole point: an orientation-respecting sum over a polygon's rings subtracts its holes, while a sum of
73
- * absolute values adds them. Comparing the two against the source's own area figure is what tells a builder whether it
74
- * has read the holes at all — the failure mode is silent, because a hole read as an exterior ring produces a perfectly
75
- * well-formed polygon that simply covers more ground than the authority mapped.
76
- *
77
- * WHICH WINDING IS POSITIVE IS A CONTRACT, NOT A DETAIL, because a builder whose source encodes hole roles by
78
- * ORIENTATION reads roles off this sign. It is the opposite of the standard planar shoelace: this sum runs `(lonᵢ −
79
- * lonⱼ)` against the shoelace's `(xⱼ − xᵢ)`, so a ring `@mailwoman/spatial`'s own {@link rectangleRing} builds
80
- * counter-clockwise answers NEGATIVE here. `@mailwoman/zoning` is the caller that depends on it, and
81
- * `packages/zoning/test/unit/ring-roles.test.ts` pins the sign directly.
38
+ * Signed spherical area of one linear ring, in square meters, with clockwise positive
39
+ * and counter-clockwise negative.
82
40
  */
83
41
  export declare function ringSignedAreaM2(ring: ReadonlyArray<readonly number[]>): number;
84
42
  /**
85
- * Both readings of one feature's area, in square metres: `nested` respects ring orientation (holes subtract) and
86
- * `allExterior` does not (holes add).
87
- *
88
- * A source whose holes are correctly nested makes `nested` match the authority's own figure and `allExterior` exceed
89
- * it. The gap between them is the area a hole-blind reader would answer "inside" for.
43
+ * Both readings of one feature's area, in square meters: `nested` respects ring
44
+ * orientation (holes subtract) and `allExterior` does not (holes add).
90
45
  */
91
46
  export declare function ringAreaReadings(polygons: MultiPolygonRings): {
92
47
  nested: number;
93
48
  allExterior: number;
94
49
  };
95
50
  /**
96
- * A rectangle in CRS84 degrees.
97
- */
98
- export interface DegreeExtent {
99
- minLon: number;
100
- minLat: number;
101
- maxLon: number;
102
- maxLat: number;
103
- }
104
- /**
105
- * Refuse a feature whose reprojected vertices fall outside the publisher's own declared extent.
106
- *
107
- * THE CHECK A PROJECTION CHECK CANNOT MAKE. A swapped coordinate order survives an authority-code comparison — both
108
- * axes are still numbers in a plausible range — and a source read in its own metres as if they were degrees produces
109
- * perfectly well-formed coordinates in the wrong ocean. Both show up here on the first feature, before a whole layer is
110
- * written to the wrong side of the planet.
111
- *
112
- * SHARED BY EVERY POLYGON INGEST, because it is rectangle arithmetic over the ring types and knows nothing about any
113
- * product. `marginDegrees` is the caller's, because a declared extent is itself a rounded published value and how
114
- * tightly a source hugs its own is a fact about that source.
115
- *
116
- * @param context Names the calling ingest in the refusal, so a build log says which layer stopped.
117
- * @throws {RangeError} On the first vertex outside the extent.
51
+ * Refuse a feature whose reprojected vertices fall outside the publisher's own
52
+ * declared extent, throwing on the first vertex outside it.
118
53
  */
119
- export declare function assertRingsInsideExtent(polygons: MultiPolygonRings, label: string, extent: DegreeExtent, marginDegrees: number, context?: string): void;
54
+ export declare function assertRingsInsideExtent(polygons: MultiPolygonRings, label: string, extent: LatLonBounds, marginDegrees: number, context?: string): void;
120
55
  /**
121
56
  * One stored polygon's bounding box and geometry, as every polygon layer's truth table stores them.
122
57
  */
@@ -128,40 +63,19 @@ export interface EncodedArea {
128
63
  rings: Uint8Array;
129
64
  }
130
65
  /**
131
- * A point INSIDE one stored polygon, for a verification sampler.
132
- *
133
- * The bounding-box centre is tried first; where it is not inside — a crescent, a band hugging a river, a polygon with a
134
- * hole through its middle — a small deterministic grid over the box is scanned. A polygon no grid point lands inside is
135
- * refused (`undefined`) rather than approximated, because a sample point that is not actually inside the polygon turns
136
- * an agreement check into a check on the sampler.
137
- *
138
- * SHARED BY EVERY POLYGON LAYER'S VERIFY, because it is bounding-box arithmetic over the ring blob and knows nothing
139
- * about any product. `gridSteps` is the one thing that differs between them: a layer whose polygons are narrow strips
140
- * needs a finer grid than one whose polygons are compact, and the value is part of a layer's sampling receipt — two
141
- * runs of the same layer must draw the same points, so it is a caller's choice rather than a shared default nobody
142
- * owns.
143
- *
144
- * @param gridSteps Grid divisions per axis. Only `steps − 1` interior lines are tested, so 7 gives a 6 × 6 grid.
66
+ * A point inside one stored polygon for a verification sampler, returning `undefined` when neither
67
+ * the bounding-box center nor any of the `gridSteps − 1` interior grid lines lands inside.
145
68
  */
146
69
  export declare function interiorPointOfEncodedRings(area: EncodedArea, gridSteps?: number): {
147
70
  latitude: number;
148
71
  longitude: number;
149
72
  } | undefined;
150
73
  /**
151
- * Whether a stored polygon's precomputed bounding box contains the point — the ray cast's prefilter, so the blob is
152
- * only pulled off disk for a polygon that could contain the point.
74
+ * Whether a stored polygon's precomputed bounding box contains the point.
153
75
  */
154
76
  export declare function bboxContains(bounds: Pick<EncodedArea, "min_lat" | "min_lon" | "max_lat" | "max_lon">, longitude: number, latitude: number): boolean;
155
77
  /**
156
- * A reproducible sample of interior points drawn by a deterministic STRIDE over a key list — the shape every polygon
157
- * layer's verification sampler shares.
158
- *
159
- * The keys are chosen before any geometry is read: selecting them alone is an index-only walk over the primary key, and
160
- * the rows they name are then fetched by key. The draw is deterministic rather than random, so a re-run compares the
161
- * same points and a disagreement can be looked at rather than re-rolled.
162
- *
163
- * @param options.gridSteps The interior-point search depth, per {@link interiorPointOfEncodedRings} — part of a layer's
164
- * sampling receipt, so it is a caller's choice rather than a shared default nobody owns.
78
+ * A reproducible sample of interior points drawn by a deterministic stride over a key list.
165
79
  */
166
80
  export declare function strideSampleInteriorPoints<Area extends EncodedArea, Point>(keys: readonly string[], count: number, options: {
167
81
  fetch: (key: string) => Area | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"ring-blob.d.ts","sourceRoot":"","sources":["../../lib/geometries/ring-blob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAA;AAkBlC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;O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AAS,GAAG,SAAS,CAAC,EACxE,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACd,OAAO,CAOT;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,SAAS,WAAW,EAAE,KAAK,EACzE,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IACR,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,CAAA;IACxC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAA;CACjF,GACC,KAAK,EAAE,CAoBT;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,GAAG;IAC9D,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACd,CAgCA"}
@@ -3,56 +3,24 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The ring blob — how a polygon layer stores one authority feature's UNSIMPLIFIED coordinates, and the
7
- * point test that reads it without materializing them.
8
- *
9
- * THE GEOMETRY IS THE TRUTH TABLE. An H3 index above it answers a cell that lies wholly inside one
10
- * feature; a cell a boundary crosses falls through to a ray cast against the few features the index
11
- * already named. A rooftop answer at a boundary — which is where the answer usually matters most — has
12
- * no other source, so the rings are stored at the resolution the authority published them and never
13
- * simplified.
14
- *
15
- * THE LAYOUT PUTS THE COORDINATES ON AN 8-BYTE BOUNDARY, so the reader takes a `Float64Array` view over
16
- * them instead of a `DataView.getFloat64` per ordinate. Header is `u32 version`, `u32 ringCount`, then
17
- * one `(u32 pointCount, u32 polygonIndex)` pair per ring — `8 + 8 × ringCount` bytes, a multiple of
18
- * eight by construction. Coordinates follow as `[lon, lat]` pairs, ring by ring.
19
- *
20
- * `polygonIndex` IS required AND CANNOT BE INFERRED. A source feature is a MultiPolygon, so its
21
- * rings belong to several polygons and "the first ring is the exterior" is true only per polygon. The
22
- * point test is orientation-free and nesting-free (even-odd across a polygon's own rings, the rule
23
- * {@link pointInPolygon} uses), but it still has to know which rings share a polygon: an island sitting
24
- * inside another polygon's hole is inside the layer and would cancel to "outside" if every ring were
25
- * pooled into one list.
26
- *
27
- * SHARED BY EVERY POLYGON LAYER RATHER THAN COPIED INTO EACH. `@mailwoman/flood` and `@mailwoman/soil`
28
- * both store an authority's rings this way, and a second copy of the alignment arithmetic or of the
29
- * signed-area reading would be a second thing to get right — both failure modes are silent, since a
30
- * mis-read blob answers a containment question wrongly and a hole-blind area reading answers "inside"
31
- * for every point in a hole.
6
+ * A polygon layer's stored ring blob: an 8-byte header, then a `(u32 pointCount, u32 polygonIndex)`
7
+ * pair per ring, then `[lon, lat]` pairs on an 8-byte boundary so the reader takes a
8
+ * `Float64Array` view; `polygonIndex` is required because one feature's rings belong to several polygons.
32
9
  */
33
10
  /**
34
- * Format version stamped into every blob. A reader that meets a different number throws rather than reinterpreting
35
- * bytes it does not know the shape of.
11
+ * Format version stamped into every blob, rejected by a reader that meets a different number.
36
12
  */
37
13
  export const RING_BLOB_VERSION = 1;
38
- /**
39
- * Bytes of fixed header before the per-ring table.
40
- */
41
14
  const HEADER_BYTES = 8;
42
- /**
43
- * Bytes per ring-table entry: `u32 pointCount`, `u32 polygonIndex`.
44
- */
45
15
  const RING_ENTRY_BYTES = 8;
46
16
  /**
47
- * Positions a linear ring needs to bound an area: three distinct vertices plus the repeat that closes it (RFC 7946
48
- * §3.1.6). Fewer is a degenerate ring, and encoding one would store a polygon no point can be inside.
17
+ * Positions a linear ring needs to bound an area: three distinct vertices plus
18
+ * the repeat that closes it (RFC 7946 §3.1.6).
49
19
  */
50
20
  const MINIMUM_RING_POSITIONS = 4;
51
21
  /**
52
- * Pack a GeoJSON `MultiPolygon`/`Polygon` coordinate tree into the stored blob.
53
- *
54
- * @throws {RangeError} When the geometry carries no ring, or a ring carries fewer than four positions (a linear ring is
55
- * closed, so three is the minimum distinct-vertex count plus the repeat).
22
+ * Pack a GeoJSON `MultiPolygon`/`Polygon` coordinate tree into the stored blob, throwing
23
+ * when the geometry has no ring or a ring has fewer than four positions.
56
24
  */
57
25
  export function encodeRings(polygons) {
58
26
  const entries = [];
@@ -91,11 +59,8 @@ export function encodeRings(polygons) {
91
59
  return new Uint8Array(buffer);
92
60
  }
93
61
  /**
94
- * The ring table plus a `Float64Array` over the coordinates — what both the point test and the decoder walk.
95
- *
96
- * @throws {Error} When the blob's version is not {@linkcode RING_BLOB_VERSION}, or its declared ring table does not
97
- * account for the bytes present. A blob that is silently mis-read answers a containment question wrongly, and a wrong
98
- * containment answer is indistinguishable from a real one.
62
+ * The ring table plus a `Float64Array` over the coordinates, throwing when the blob's version is not
63
+ * {@linkcode RING_BLOB_VERSION} or its declared ring table does not account for the bytes present.
99
64
  */
100
65
  function openRings(blob) {
101
66
  // `blob.byteOffset` is not always zero: node:sqlite hands back a view into a shared buffer.
@@ -119,8 +84,8 @@ function openRings(blob) {
119
84
  if (expected !== blob.byteLength) {
120
85
  throw new Error(`ring blob: blob declares ${expected} bytes of geometry, holds ${blob.byteLength}`);
121
86
  }
122
- // The header is a multiple of eight by construction, so the coordinate run is 8-byte aligned and this view is legal
123
- // on a shared buffer whose own offset is aligned. A misaligned source buffer is copied rather than rejected.
87
+ // The header is a multiple of eight by construction, so the coordinate run is 8-byte aligned.
88
+ // A misaligned source buffer is copied rather than rejected.
124
89
  const absoluteOffset = blob.byteOffset + headerBytes;
125
90
  const coordinates = absoluteOffset % Float64Array.BYTES_PER_ELEMENT === 0
126
91
  ? new Float64Array(blob.buffer, absoluteOffset, totalPoints * 2)
@@ -128,12 +93,8 @@ function openRings(blob) {
128
93
  return { ringCount, pointCounts, polygonIndices, coordinates };
129
94
  }
130
95
  /**
131
- * Is the point inside the stored geometry?
132
- *
133
- * Even-odd within each polygon's own ring list, inside-any-polygon across them — the orientation-free rule
134
- * {@linkcode pointInPolygon} states, applied without allocating the ring arrays. Reading a hole as an exterior ring is
135
- * what this rule survives: a point inside a hole crosses two rings and comes out even, whichever way either ring
136
- * winds.
96
+ * Is the point inside the stored geometry, even-odd within each polygon's own ring list
97
+ * and inside-any-polygon across them, without allocating the ring arrays.
137
98
  */
138
99
  export function pointInEncodedRings(blob, lon, lat) {
139
100
  const { ringCount, pointCounts, polygonIndices, coordinates } = openRings(blob);
@@ -158,8 +119,8 @@ export function pointInEncodedRings(blob, lon, lat) {
158
119
  return inside;
159
120
  }
160
121
  /**
161
- * The even-odd crossing count over one ring held in a flat coordinate run. Mirrors {@linkcode pointInRing} exactly —
162
- * same predicate, same tie behavior — so a decoded ring and an encoded one never disagree.
122
+ * The even-odd crossing count over one ring held in a flat coordinate run, mirroring
123
+ * {@linkcode pointInRing} exactly so a decoded ring and an encoded one never disagree.
163
124
  */
164
125
  function crossesOdd(coordinates, offset, pointCount, lon, lat) {
165
126
  let inside = false;
@@ -175,8 +136,7 @@ function crossesOdd(coordinates, offset, pointCount, lon, lat) {
175
136
  return inside;
176
137
  }
177
138
  /**
178
- * Unpack the blob back into per-polygon flat coordinate runs — for tests, for a debug render, and for the round-trip
179
- * check a build's fixtures assert.
139
+ * Unpack the blob back into per-polygon flat coordinate runs.
180
140
  */
181
141
  export function decodeRings(blob) {
182
142
  const { ringCount, pointCounts, polygonIndices, coordinates } = openRings(blob);
@@ -192,22 +152,12 @@ export function decodeRings(blob) {
192
152
  return { polygons };
193
153
  }
194
154
  /**
195
- * Mean Earth radius in metres — the sphere the ring areas below are measured on.
155
+ * Mean Earth radius in meters, the sphere the ring areas are measured on.
196
156
  */
197
157
  const EARTH_RADIUS_M = 6_371_008.8;
198
158
  /**
199
- * Signed spherical area of one linear ring, in square metres. **CLOCKWISE is positive**, counter-clockwise negative.
200
- *
201
- * The sign is the whole point: an orientation-respecting sum over a polygon's rings subtracts its holes, while a sum of
202
- * absolute values adds them. Comparing the two against the source's own area figure is what tells a builder whether it
203
- * has read the holes at all — the failure mode is silent, because a hole read as an exterior ring produces a perfectly
204
- * well-formed polygon that simply covers more ground than the authority mapped.
205
- *
206
- * WHICH WINDING IS POSITIVE IS A CONTRACT, NOT A DETAIL, because a builder whose source encodes hole roles by
207
- * ORIENTATION reads roles off this sign. It is the opposite of the standard planar shoelace: this sum runs `(lonᵢ −
208
- * lonⱼ)` against the shoelace's `(xⱼ − xᵢ)`, so a ring `@mailwoman/spatial`'s own {@link rectangleRing} builds
209
- * counter-clockwise answers NEGATIVE here. `@mailwoman/zoning` is the caller that depends on it, and
210
- * `packages/zoning/test/unit/ring-roles.test.ts` pins the sign directly.
159
+ * Signed spherical area of one linear ring, in square meters, with clockwise positive
160
+ * and counter-clockwise negative.
211
161
  */
212
162
  export function ringSignedAreaM2(ring) {
213
163
  let total = 0;
@@ -220,18 +170,14 @@ export function ringSignedAreaM2(ring) {
220
170
  return (total * EARTH_RADIUS_M * EARTH_RADIUS_M) / 2;
221
171
  }
222
172
  /**
223
- * Both readings of one feature's area, in square metres: `nested` respects ring orientation (holes subtract) and
224
- * `allExterior` does not (holes add).
225
- *
226
- * A source whose holes are correctly nested makes `nested` match the authority's own figure and `allExterior` exceed
227
- * it. The gap between them is the area a hole-blind reader would answer "inside" for.
173
+ * Both readings of one feature's area, in square meters: `nested` respects ring
174
+ * orientation (holes subtract) and `allExterior` does not (holes add).
228
175
  */
229
176
  export function ringAreaReadings(polygons) {
230
177
  let nested = 0;
231
178
  let allExterior = 0;
232
179
  for (const rings of polygons) {
233
- // Per POLYGON, not pooled: two disjoint polygons of one feature can wind opposite ways without either being a
234
- // hole, and a pooled sum would silently cancel them against each other.
180
+ // Per polygon rather than pooled, so two disjoint polygons wound opposite ways do not cancel out.
235
181
  let signedTotal = 0;
236
182
  for (const ring of rings) {
237
183
  const signed = ringSignedAreaM2(ring);
@@ -243,19 +189,8 @@ export function ringAreaReadings(polygons) {
243
189
  return { nested, allExterior };
244
190
  }
245
191
  /**
246
- * Refuse a feature whose reprojected vertices fall outside the publisher's own declared extent.
247
- *
248
- * THE CHECK A PROJECTION CHECK CANNOT MAKE. A swapped coordinate order survives an authority-code comparison — both
249
- * axes are still numbers in a plausible range — and a source read in its own metres as if they were degrees produces
250
- * perfectly well-formed coordinates in the wrong ocean. Both show up here on the first feature, before a whole layer is
251
- * written to the wrong side of the planet.
252
- *
253
- * SHARED BY EVERY POLYGON INGEST, because it is rectangle arithmetic over the ring types and knows nothing about any
254
- * product. `marginDegrees` is the caller's, because a declared extent is itself a rounded published value and how
255
- * tightly a source hugs its own is a fact about that source.
256
- *
257
- * @param context Names the calling ingest in the refusal, so a build log says which layer stopped.
258
- * @throws {RangeError} On the first vertex outside the extent.
192
+ * Refuse a feature whose reprojected vertices fall outside the publisher's own
193
+ * declared extent, throwing on the first vertex outside it.
259
194
  */
260
195
  export function assertRingsInsideExtent(polygons, label, extent, marginDegrees, context = "polygon ingest") {
261
196
  for (const rings of polygons) {
@@ -275,20 +210,8 @@ export function assertRingsInsideExtent(polygons, label, extent, marginDegrees,
275
210
  }
276
211
  }
277
212
  /**
278
- * A point INSIDE one stored polygon, for a verification sampler.
279
- *
280
- * The bounding-box centre is tried first; where it is not inside — a crescent, a band hugging a river, a polygon with a
281
- * hole through its middle — a small deterministic grid over the box is scanned. A polygon no grid point lands inside is
282
- * refused (`undefined`) rather than approximated, because a sample point that is not actually inside the polygon turns
283
- * an agreement check into a check on the sampler.
284
- *
285
- * SHARED BY EVERY POLYGON LAYER'S VERIFY, because it is bounding-box arithmetic over the ring blob and knows nothing
286
- * about any product. `gridSteps` is the one thing that differs between them: a layer whose polygons are narrow strips
287
- * needs a finer grid than one whose polygons are compact, and the value is part of a layer's sampling receipt — two
288
- * runs of the same layer must draw the same points, so it is a caller's choice rather than a shared default nobody
289
- * owns.
290
- *
291
- * @param gridSteps Grid divisions per axis. Only `steps − 1` interior lines are tested, so 7 gives a 6 × 6 grid.
213
+ * A point inside one stored polygon for a verification sampler, returning `undefined` when neither
214
+ * the bounding-box center nor any of the `gridSteps − 1` interior grid lines lands inside.
292
215
  */
293
216
  export function interiorPointOfEncodedRings(area, gridSteps = 7) {
294
217
  const centreLat = (area.min_lat + area.max_lat) / 2;
@@ -307,8 +230,7 @@ export function interiorPointOfEncodedRings(area, gridSteps = 7) {
307
230
  return undefined;
308
231
  }
309
232
  /**
310
- * Whether a stored polygon's precomputed bounding box contains the point — the ray cast's prefilter, so the blob is
311
- * only pulled off disk for a polygon that could contain the point.
233
+ * Whether a stored polygon's precomputed bounding box contains the point.
312
234
  */
313
235
  export function bboxContains(bounds, longitude, latitude) {
314
236
  return (longitude >= bounds.min_lon &&
@@ -317,15 +239,7 @@ export function bboxContains(bounds, longitude, latitude) {
317
239
  latitude <= bounds.max_lat);
318
240
  }
319
241
  /**
320
- * A reproducible sample of interior points drawn by a deterministic STRIDE over a key list — the shape every polygon
321
- * layer's verification sampler shares.
322
- *
323
- * The keys are chosen before any geometry is read: selecting them alone is an index-only walk over the primary key, and
324
- * the rows they name are then fetched by key. The draw is deterministic rather than random, so a re-run compares the
325
- * same points and a disagreement can be looked at rather than re-rolled.
326
- *
327
- * @param options.gridSteps The interior-point search depth, per {@link interiorPointOfEncodedRings} — part of a layer's
328
- * sampling receipt, so it is a caller's choice rather than a shared default nobody owns.
242
+ * A reproducible sample of interior points drawn by a deterministic stride over a key list.
329
243
  */
330
244
  export function strideSampleInteriorPoints(keys, count, options) {
331
245
  const points = [];
@@ -1 +1 @@
1
- {"version":3,"file":"ring-blob.js","sourceRoot":"","sources":["../../lib/geometries/ring-blob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAA;AAElC;;GAEG;AACH,MAAM,YAAY,GAA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,GAAG,CAAC,QAAQ,CAAA;IACtB,IAAI,MAAM,GAAG,CAAC,QAAQ,CAAA;IAEtB,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC9B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC1B,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE,CAAC;gBAC7B,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAE,CAAA;gBACxB,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAE,CAAA;gBAExB,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC;oBAClB,MAAM,GAAG,GAAG,CAAA;gBACb,CAAC;gBAED,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC;oBAClB,MAAM,GAAG,GAAG,CAAA;gBACb,CAAC;gBAED,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC;oBAClB,MAAM,GAAG,GAAG,CAAA;gBACb,CAAC;gBAED,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC;oBAClB,MAAM,GAAG,GAAG,CAAA;gBACb,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC1C,CAAC"}
@@ -10,4 +10,4 @@ export * from "#geometries/line-string";
10
10
  export * from "#geometries/point";
11
11
  export * from "#geometries/polygon";
12
12
  export * from "#geometries/ring-blob";
13
- //# sourceMappingURL=index.js.map
13
+ //# sourceMappingURL=geometries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometries.d.ts","sourceRoot":"","sources":["../lib/geometries.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA"}