@mailwoman/spatial 10.0.0 → 10.2.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.
- package/README.md +2 -2
- package/lib/bbox.ts +41 -34
- package/lib/coordinate/bounds.ts +2 -2
- package/lib/coordinate/formats.ts +21 -33
- package/lib/distance.ts +56 -28
- package/lib/feature.ts +2 -2
- package/lib/geometries/point.ts +42 -35
- package/lib/geometries/polygon.ts +27 -135
- package/lib/geometries/ring-blob.ts +35 -132
- package/lib/google/place-id.ts +4 -2
- package/lib/h3/cell.ts +23 -78
- package/lib/h3/coverage.ts +13 -9
- package/lib/h3/interior-cells.ts +13 -34
- package/lib/h3/polygon-cells.ts +61 -167
- package/lib/{h3/index.ts → h3.ts} +1 -1
- package/lib/index.ts +6 -5
- package/lib/objects.ts +6 -6
- package/lib/open-location-code.ts +11 -42
- package/lib/osgb36.ts +28 -187
- package/lib/polyline.ts +5 -3
- package/lib/position.ts +39 -20
- package/lib/projection/transform.ts +43 -44
- package/lib/{projection/index.ts → projection.ts} +1 -1
- package/lib/well-known-text.ts +9 -9
- package/out/bbox.d.ts +17 -14
- package/out/bbox.d.ts.map +1 -1
- package/out/bbox.js +32 -23
- package/out/bbox.js.map +1 -1
- package/out/coordinate/bounds.d.ts +2 -2
- package/out/coordinate/bounds.js +2 -2
- package/out/coordinate/formats.d.ts +17 -16
- package/out/coordinate/formats.d.ts.map +1 -1
- package/out/coordinate/formats.js +20 -32
- package/out/coordinate/formats.js.map +1 -1
- package/out/distance.d.ts +51 -26
- package/out/distance.d.ts.map +1 -1
- package/out/distance.js +53 -27
- package/out/distance.js.map +1 -1
- package/out/feature.d.ts +2 -2
- package/out/feature.d.ts.map +1 -1
- package/out/geometries/point.d.ts +30 -22
- package/out/geometries/point.d.ts.map +1 -1
- package/out/geometries/point.js +37 -30
- package/out/geometries/point.js.map +1 -1
- package/out/geometries/polygon.d.ts +27 -126
- package/out/geometries/polygon.d.ts.map +1 -1
- package/out/geometries/polygon.js +14 -42
- package/out/geometries/polygon.js.map +1 -1
- package/out/geometries/ring-blob.d.ts +24 -110
- package/out/geometries/ring-blob.d.ts.map +1 -1
- package/out/geometries/ring-blob.js +30 -116
- package/out/geometries/ring-blob.js.map +1 -1
- package/out/{geometries/index.js → geometries.d.ts} +1 -1
- package/out/geometries.d.ts.map +1 -0
- package/out/{geometries/index.d.ts → geometries.js} +1 -1
- package/out/geometries.js.map +1 -0
- package/out/google/place-id.d.ts +4 -2
- package/out/google/place-id.d.ts.map +1 -1
- package/out/google/place-id.js.map +1 -1
- package/out/{google/index.d.ts → google.d.ts} +1 -1
- package/out/google.d.ts.map +1 -0
- package/out/{google/index.js → google.js} +1 -1
- package/out/google.js.map +1 -0
- package/out/h3/cell.d.ts +19 -73
- package/out/h3/cell.d.ts.map +1 -1
- package/out/h3/cell.js +22 -65
- package/out/h3/cell.js.map +1 -1
- package/out/h3/coverage.d.ts +12 -8
- package/out/h3/coverage.d.ts.map +1 -1
- package/out/h3/coverage.js +12 -8
- package/out/h3/coverage.js.map +1 -1
- package/out/h3/interior-cells.d.ts +9 -28
- package/out/h3/interior-cells.d.ts.map +1 -1
- package/out/h3/interior-cells.js +13 -32
- package/out/h3/interior-cells.js.map +1 -1
- package/out/h3/polygon-cells.d.ts +28 -120
- package/out/h3/polygon-cells.d.ts.map +1 -1
- package/out/h3/polygon-cells.js +50 -148
- package/out/h3/polygon-cells.js.map +1 -1
- package/out/{h3/index.d.ts → h3.d.ts} +2 -2
- package/out/h3.d.ts.map +1 -0
- package/out/{h3/index.js → h3.js} +2 -2
- package/out/h3.js.map +1 -0
- package/out/index.d.ts +6 -5
- package/out/index.d.ts.map +1 -1
- package/out/index.js +6 -5
- package/out/index.js.map +1 -1
- package/out/objects.d.ts +6 -6
- package/out/open-location-code.d.ts +11 -22
- package/out/open-location-code.d.ts.map +1 -1
- package/out/open-location-code.js +9 -40
- package/out/open-location-code.js.map +1 -1
- package/out/osgb36.d.ts +21 -97
- package/out/osgb36.d.ts.map +1 -1
- package/out/osgb36.js +12 -165
- package/out/osgb36.js.map +1 -1
- package/out/polyline.d.ts +5 -3
- package/out/polyline.d.ts.map +1 -1
- package/out/polyline.js +5 -3
- package/out/polyline.js.map +1 -1
- package/out/position.d.ts +36 -20
- package/out/position.d.ts.map +1 -1
- package/out/position.js +0 -1
- package/out/position.js.map +1 -1
- package/out/projection/transform.d.ts +33 -30
- package/out/projection/transform.d.ts.map +1 -1
- package/out/projection/transform.js +15 -17
- package/out/projection/transform.js.map +1 -1
- package/out/{projection/index.d.ts → projection.d.ts} +2 -2
- package/out/projection.d.ts.map +1 -0
- package/out/{projection/index.js → projection.js} +2 -2
- package/out/projection.js.map +1 -0
- package/out/{regions/index.js → regions.d.ts} +1 -1
- package/out/regions.d.ts.map +1 -0
- package/out/{regions/index.d.ts → regions.js} +1 -1
- package/out/regions.js.map +1 -0
- package/out/tools/ogr/stream.d.ts +21 -11
- package/out/tools/ogr/stream.d.ts.map +1 -1
- package/out/tools/ogr/stream.js +17 -10
- package/out/tools/ogr/stream.js.map +1 -1
- package/out/tools/{ogr/index.d.ts → ogr.d.ts} +25 -15
- package/out/tools/ogr.d.ts.map +1 -0
- package/out/tools/{ogr/index.js → ogr.js} +25 -21
- package/out/tools/ogr.js.map +1 -0
- package/out/tools/tsconfig.tsbuildinfo +1 -0
- package/out/tsconfig.test.tsbuildinfo +1 -1
- package/out/well-known-text.d.ts +9 -9
- package/out/well-known-text.d.ts.map +1 -1
- package/out/well-known-text.js +7 -7
- package/out/well-known-text.js.map +1 -1
- package/package.json +37 -129
- package/{lib/tools → tools}/ogr/stream.ts +26 -15
- package/{lib/tools/ogr/index.ts → tools/ogr.ts} +44 -30
- package/out/geometries/index.d.ts.map +0 -1
- package/out/geometries/index.js.map +0 -1
- package/out/google/index.d.ts.map +0 -1
- package/out/google/index.js.map +0 -1
- package/out/h3/index.d.ts.map +0 -1
- package/out/h3/index.js.map +0 -1
- package/out/projection/index.d.ts.map +0 -1
- package/out/projection/index.js.map +0 -1
- package/out/regions/index.d.ts.map +0 -1
- package/out/regions/index.js.map +0 -1
- package/out/tools/ogr/index.d.ts.map +0 -1
- package/out/tools/ogr/index.js.map +0 -1
- /package/lib/{geometries/index.ts → geometries.ts} +0 -0
- /package/lib/{google/index.ts → google.ts} +0 -0
- /package/lib/{regions/index.ts → regions.ts} +0 -0
|
@@ -3,56 +3,24 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
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
|
|
48
|
-
* §3.1.6).
|
|
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
|
|
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
|
|
123
|
-
//
|
|
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
|
|
162
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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;
|
|
@@ -304,11 +227,10 @@ export function interiorPointOfEncodedRings(area, gridSteps = 7) {
|
|
|
304
227
|
return { latitude, longitude };
|
|
305
228
|
}
|
|
306
229
|
}
|
|
307
|
-
return
|
|
230
|
+
return null;
|
|
308
231
|
}
|
|
309
232
|
/**
|
|
310
|
-
* Whether a stored polygon's precomputed bounding box contains the point
|
|
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
|
|
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,GAAG,CAAC,CAAA;AAEtB;;GAEG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAE1B;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAAC,CAAA;AAYhC;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,QAA2B;IACtD,MAAM,OAAO,GAAwD,EAAE,CAAA;IACvE,IAAI,WAAW,GAAG,CAAC,CAAA;IAEnB,KAAK,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,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M,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"}
|
|
@@ -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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometries.js","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"}
|
package/out/google/place-id.d.ts
CHANGED
|
@@ -9,12 +9,14 @@ import type { Tagged } from "type-fest";
|
|
|
9
9
|
/**
|
|
10
10
|
* A Place ID uniquely identifies a place in the Google Places database and on Google Maps.
|
|
11
11
|
*
|
|
12
|
-
* The length of the identifier may vary.
|
|
12
|
+
* The length of the identifier may vary.
|
|
13
|
+
* Generally, the identifier is a 27-character string, however, more specific
|
|
13
14
|
* places may have longer identifiers.
|
|
14
15
|
*
|
|
15
16
|
* Place IDs appear to be base64-encoded strings, delimited by underscores and dashes.
|
|
16
17
|
*
|
|
17
|
-
* Note that Place IDs do change.
|
|
18
|
+
* Note that Place IDs do change.
|
|
19
|
+
* Consider a them stale after a few days.
|
|
18
20
|
*
|
|
19
21
|
* @category Google
|
|
20
22
|
* @category Geocoding
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-id.d.ts","sourceRoot":"","sources":["../../lib/google/place-id.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"place-id.d.ts","sourceRoot":"","sources":["../../lib/google/place-id.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;AAE3D;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAqB,CAAA;AAEzD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-id.js","sourceRoot":"","sources":["../../lib/google/place-id.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"place-id.js","sourceRoot":"","sources":["../../lib/google/place-id.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAA;AAEzD;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC5C,OAAO,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../lib/google.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google.js","sourceRoot":"","sources":["../lib/google.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAA"}
|
package/out/h3/cell.d.ts
CHANGED
|
@@ -3,110 +3,56 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
* @file H3 cell primitives — the index types and the widen/shorten conversions.
|
|
6
|
-
|
|
7
|
-
* Split out from `./index.ts` because these carry no dependency on `GeoPoint`, while the
|
|
8
|
-
* point-valued helpers there do. `geometries/point.ts` needs the primitives and is itself imported
|
|
9
|
-
* by `./index.ts`, so keeping them together closed an import cycle.
|
|
6
|
+
|
|
10
7
|
*/
|
|
11
8
|
import type { Tagged } from "type-fest";
|
|
12
9
|
/**
|
|
13
|
-
* The finest resolution H3 defines.
|
|
10
|
+
* The finest resolution H3 defines.
|
|
11
|
+
* Resolutions run `[0, H3_MAX_RESOLUTION]`.
|
|
14
12
|
*/
|
|
15
13
|
export declare const H3_MAX_RESOLUTION = 15;
|
|
16
14
|
/**
|
|
17
|
-
* A H3 cell index, full 64 bits
|
|
18
|
-
*
|
|
19
|
-
* Written as 15 hex characters because the top nibble of a cell index is always zero: bit 63 is reserved, and the 4-bit
|
|
20
|
-
* mode field that follows is `1` for a cell, which lands entirely inside the second nibble. That is why every cell
|
|
21
|
-
* index printed here begins with `8`.
|
|
22
|
-
*
|
|
23
|
-
* @type {string}
|
|
24
|
-
* @title H3 Cell Index
|
|
25
|
-
* @pattern ^[0-9a-f]{15}$
|
|
15
|
+
* A H3 cell index, full 64 bits, written as 15 lowercase hex characters matching `^[0-9a-f]{15}$`.
|
|
26
16
|
*/
|
|
27
17
|
export type H3Cell = Tagged<string, "H3Cell">;
|
|
28
18
|
/**
|
|
29
|
-
* Is `value` a real H3 cell index
|
|
30
|
-
*
|
|
31
|
-
* Delegates to h3-js rather than testing the surface shape. The shape is necessary but nowhere near sufficient —
|
|
32
|
-
* `000000000000000`, `fffffffffffffff` and `123456789abcdef` are all fifteen lowercase hex characters and none of them
|
|
33
|
-
* is a cell. A guard that returns `value is H3Cell` on those hands the caller a branded type it has not earned, and the
|
|
34
|
-
* error surfaces later inside h3-js with no reference to where the bad value entered.
|
|
19
|
+
* Is `value` a real H3 cell index, delegating to h3-js because the hex surface
|
|
20
|
+
* shape is necessary but not sufficient.
|
|
35
21
|
*/
|
|
36
22
|
export declare function isH3Cell(value: string): value is H3Cell;
|
|
37
23
|
/**
|
|
38
24
|
* A H3 cell index with its mode and resolution nibbles removed — the low 52 bits, fixed width.
|
|
39
|
-
*
|
|
40
|
-
* @type {string}
|
|
41
|
-
* @title H3 Cell Index (Short)
|
|
42
|
-
* @pattern ^[0-9a-f]{13}$
|
|
43
25
|
*/
|
|
44
26
|
export type H3CellShort = Tagged<string, "H3CellShort">;
|
|
45
27
|
/**
|
|
46
|
-
* Strip the mode and resolution nibbles off a full H3 cell index, keeping the base cell
|
|
47
|
-
*
|
|
48
|
-
* The digits past the cell's own resolution are all `7` in a valid index, so nothing is discarded and nothing is
|
|
49
|
-
* inferred: the short form carries the cell losslessly for every resolution, and {@link expandH3Cell} reverses it
|
|
50
|
-
* exactly once you tell it which resolution the cell was captured at.
|
|
51
|
-
*
|
|
52
|
-
* Zero-padded to a fixed 13 characters, so the hex form orders and compares the same way the integer
|
|
53
|
-
* {@link shortCellToInt} packs does. Base cells 0-7 leave the leading nibble zero, and an unpadded string would both
|
|
54
|
-
* mis-sort and mis-expand.
|
|
28
|
+
* Strip the mode and resolution nibbles off a full H3 cell index, keeping the base cell
|
|
29
|
+
* and the whole digit path, zero-padded to a fixed 13 characters so hex order matches integer order.
|
|
55
30
|
*/
|
|
56
31
|
export declare function shortenH3Cell(cell: H3Cell): H3CellShort;
|
|
57
32
|
/**
|
|
58
|
-
* Rebuild a full H3 cell index from a short cell captured at `resolution
|
|
59
|
-
*
|
|
60
|
-
* The short form drops only the mode and resolution nibbles, so reconstruction is a straight concatenation: `"8"` (cell
|
|
61
|
-
* mode) + the resolution nibble + the 52 bits verbatim. The result is the identical index `latLngToCell` would have
|
|
62
|
-
* produced at that resolution.
|
|
63
|
-
*
|
|
64
|
-
* `resolution` is a required piece of external knowledge — a short cell does not name its own resolution, so the caller
|
|
65
|
-
* has to supply the one the cell was shortened at. Supplying the wrong one is caught rather than tolerated: a mismatch
|
|
66
|
-
* leaves digits past the stated resolution set to something other than `7`, which H3 rejects, and this throws instead
|
|
67
|
-
* of returning an index that downstream `cellToParent` calls would refuse with `Cell arguments had incompatible
|
|
68
|
-
* resolutions`.
|
|
69
|
-
*
|
|
70
|
-
* @throws {RangeError} If `resolution` is not an integer in `[0, 15]`, or `h3CellShort` is wider than 13 hex
|
|
71
|
-
* characters.
|
|
72
|
-
* @throws {Error} If the short cell and resolution do not together name a valid H3 cell.
|
|
33
|
+
* Rebuild a full H3 cell index from a short cell captured at `resolution`, throwing
|
|
34
|
+
* when the resolution is out of range or the pair does not name a valid cell.
|
|
73
35
|
*/
|
|
74
36
|
export declare function expandH3Cell(h3CellShort: H3CellShort, resolution?: number): H3Cell;
|
|
75
37
|
/**
|
|
76
|
-
* The full H3 index for a short cell held as an integer, stored at `resolution
|
|
77
|
-
*
|
|
78
|
-
* Through {@link expandH3Cell} rather than a string concatenation, because it VALIDATES: a short cell that does not name
|
|
79
|
-
* a valid cell at the stated resolution throws here instead of reaching `compactCells` as a plausible-looking index.
|
|
38
|
+
* The full H3 index for a short cell held as an integer, stored at `resolution`,
|
|
39
|
+
* through {@link expandH3Cell} so an invalid pair throws rather than reaching `compactCells`.
|
|
80
40
|
*/
|
|
81
41
|
export declare function expandShortCellInt(shortCell: number, resolution: number): H3Cell;
|
|
82
42
|
/**
|
|
83
|
-
* Pack an H3 cell into the short-cell integer used as a clustered B-tree key across layer databases
|
|
84
|
-
*
|
|
43
|
+
* Pack an H3 cell into the short-cell integer used as a clustered B-tree key across layer databases —
|
|
44
|
+
* 52 bits, inside `Number.MAX_SAFE_INTEGER` and SQLite's signed 64-bit integer column.
|
|
85
45
|
*/
|
|
86
46
|
export declare function shortCellToInt(cell: H3Cell): number;
|
|
87
47
|
/**
|
|
88
|
-
* The one resolution a set of stored short cells was captured at
|
|
89
|
-
*
|
|
90
|
-
* A short cell drops the resolution nibble, so a table of them does not say what resolution it is keyed at — and every
|
|
91
|
-
* `layer_coverage` reader needs that number to derive a probe's coverage cell. It is recoverable because
|
|
92
|
-
* {@link expandH3Cell} validates: a short cell expands to a valid index at EXACTLY ONE resolution, so trying all
|
|
93
|
-
* sixteen and keeping the one that survives is an exact answer rather than an inference.
|
|
94
|
-
*
|
|
95
|
-
* SHARED RATHER THAN COPIED, because both failure modes it names are silent in a second copy. A table that mixes
|
|
96
|
-
* resolutions read at one of them reports every cell at the other as unsurveyed, and an empty table read as "resolution
|
|
97
|
-
* 0" puts every probe in the same cell. `packages/mailwoman/lib/observations/absence-route.ts` re-exports this under
|
|
98
|
-
* its own name; `@mailwoman/coastal` calls it directly.
|
|
99
|
-
*
|
|
100
|
-
* @param context Names the caller in both messages, so a failure says which reader refused.
|
|
101
|
-
* @throws {Error} When `cells` is empty, when a value is not a short cell, or when the set mixes resolutions.
|
|
48
|
+
* The one resolution a set of stored short cells was captured at, recovered by keeping
|
|
49
|
+
* the resolution at which a short cell expands to a valid index.
|
|
102
50
|
*/
|
|
103
51
|
export declare function recoverShortCellResolution(cells: readonly number[], context?: string): number;
|
|
104
52
|
/**
|
|
105
|
-
* Reconstruct a short-cell int's ancestor at a coarser resolution
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* the original cell belonged to (measured at ~6% of CONUS blocks between res 9 and res 6), so a coverage read and the
|
|
109
|
-
* build that wrote it disagree on a fraction of cells. Reconstructing from the stored cell itself is exact.
|
|
53
|
+
* Reconstruct a short-cell int's ancestor at a coarser resolution from the
|
|
54
|
+
* stored cell itself rather than a centroid.
|
|
55
|
+
* A centroid can land in a different parent.
|
|
110
56
|
*/
|
|
111
57
|
export declare function shortCellToParentInt(shortCell: number, from: number, to: number): number;
|
|
112
58
|
//# sourceMappingURL=cell.d.ts.map
|
package/out/h3/cell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../lib/h3/cell.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../lib/h3/cell.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAE7C;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,MAAM,CAEvD;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAYvD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAKvD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,SAAoB,GAAG,MAAM,CAsB7F;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,SAAmB,GAAG,MAAM,CA0CvG;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAExF"}
|