@mailwoman/soil 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.
- package/README.md +118 -116
- package/lib/index.ts +66 -98
- package/lib/paths.ts +24 -0
- package/lib/schema.ts +188 -120
- package/lib/vocabulary.ts +40 -107
- package/out/index.d.ts +52 -70
- package/out/index.d.ts.map +1 -1
- package/out/index.js +24 -72
- package/out/index.js.map +1 -1
- package/out/paths.d.ts +19 -0
- package/out/paths.d.ts.map +1 -0
- package/out/paths.js +21 -0
- package/out/paths.js.map +1 -0
- package/out/schema.d.ts +187 -119
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js +31 -31
- package/out/schema.js.map +1 -1
- package/out/sdk/acquire.d.ts +15 -24
- package/out/sdk/acquire.d.ts.map +1 -1
- package/out/sdk/acquire.js +5 -20
- package/out/sdk/acquire.js.map +1 -1
- package/out/sdk/build-soil.d.ts +67 -70
- package/out/sdk/build-soil.d.ts.map +1 -1
- package/out/sdk/build-soil.js +65 -95
- package/out/sdk/build-soil.js.map +1 -1
- package/out/sdk/cell-tiers.d.ts +7 -19
- package/out/sdk/cell-tiers.d.ts.map +1 -1
- package/out/sdk/cell-tiers.js +19 -38
- package/out/sdk/cell-tiers.js.map +1 -1
- package/out/sdk/cells.d.ts +15 -41
- package/out/sdk/cells.d.ts.map +1 -1
- package/out/sdk/cells.js +11 -38
- package/out/sdk/cells.js.map +1 -1
- package/out/sdk/client.d.ts +23 -48
- package/out/sdk/client.d.ts.map +1 -1
- package/out/sdk/client.js +19 -63
- package/out/sdk/client.js.map +1 -1
- package/out/sdk/download.d.ts +24 -47
- package/out/sdk/download.d.ts.map +1 -1
- package/out/sdk/download.js +14 -54
- package/out/sdk/download.js.map +1 -1
- package/out/sdk/ingest/chunk.d.ts +77 -0
- package/out/sdk/ingest/chunk.d.ts.map +1 -0
- package/out/sdk/{ingest-chunk.js → ingest/chunk.js} +19 -17
- package/out/sdk/ingest/chunk.js.map +1 -0
- package/out/sdk/ingest/worker.d.ts +9 -0
- package/out/sdk/ingest/worker.d.ts.map +1 -0
- package/out/{scripts/ingest-chunk.js → sdk/ingest/worker.js} +11 -10
- package/out/sdk/ingest/worker.js.map +1 -0
- package/out/sdk/ingest.d.ts +40 -52
- package/out/sdk/ingest.d.ts.map +1 -1
- package/out/sdk/ingest.js +18 -61
- package/out/sdk/ingest.js.map +1 -1
- package/out/sdk/measure-resolutions.d.ts +5 -16
- package/out/sdk/measure-resolutions.d.ts.map +1 -1
- package/out/sdk/measure-resolutions.js +3 -15
- package/out/sdk/measure-resolutions.js.map +1 -1
- package/out/sdk/reduce.d.ts +33 -59
- package/out/sdk/reduce.d.ts.map +1 -1
- package/out/sdk/reduce.js +47 -78
- package/out/sdk/reduce.js.map +1 -1
- package/out/sdk/survey-area.d.ts +16 -48
- package/out/sdk/survey-area.d.ts.map +1 -1
- package/out/sdk/survey-area.js +33 -77
- package/out/sdk/survey-area.js.map +1 -1
- package/out/sdk/tabular.d.ts +32 -31
- package/out/sdk/tabular.d.ts.map +1 -1
- package/out/sdk/tabular.js +58 -56
- package/out/sdk/tabular.js.map +1 -1
- package/out/sdk/test-kit.d.ts +57 -0
- package/out/sdk/test-kit.d.ts.map +1 -0
- package/out/{test-kit.js → sdk/test-kit.js} +18 -39
- package/out/sdk/test-kit.js.map +1 -0
- package/out/sdk/verify.d.ts +15 -51
- package/out/sdk/verify.d.ts.map +1 -1
- package/out/sdk/verify.js +19 -77
- package/out/sdk/verify.js.map +1 -1
- package/out/vocabulary.d.ts +37 -103
- package/out/vocabulary.d.ts.map +1 -1
- package/out/vocabulary.js +34 -107
- package/out/vocabulary.js.map +1 -1
- package/package.json +36 -190
- package/{lib/sdk → sdk}/acquire.ts +17 -27
- package/{lib/sdk → sdk}/build-soil.ts +114 -128
- package/{lib/sdk → sdk}/cell-tiers.ts +20 -39
- package/{lib/sdk → sdk}/cells.ts +17 -43
- package/sdk/client.ts +147 -0
- package/sdk/download.ts +131 -0
- package/{lib/sdk/ingest-chunk.ts → sdk/ingest/chunk.ts} +34 -26
- package/{lib/scripts/ingest-chunk.ts → sdk/ingest/worker.ts} +10 -9
- package/sdk/ingest.ts +253 -0
- package/{lib/sdk → sdk}/measure-resolutions.ts +5 -16
- package/sdk/reduce.ts +344 -0
- package/{lib/sdk → sdk}/survey-area.ts +39 -83
- package/{lib/sdk → sdk}/tabular.ts +62 -59
- package/{lib → sdk}/test-kit.ts +18 -40
- package/{lib/sdk → sdk}/verify.ts +29 -85
- package/lib/sdk/client.ts +0 -184
- package/lib/sdk/download.ts +0 -161
- package/lib/sdk/index.ts +0 -20
- package/lib/sdk/ingest.ts +0 -278
- package/lib/sdk/reduce.ts +0 -375
- package/out/scripts/ingest-chunk.d.ts +0 -11
- package/out/scripts/ingest-chunk.d.ts.map +0 -1
- package/out/scripts/ingest-chunk.js.map +0 -1
- package/out/sdk/index.d.ts +0 -20
- package/out/sdk/index.d.ts.map +0 -1
- package/out/sdk/index.js +0 -20
- package/out/sdk/index.js.map +0 -1
- package/out/sdk/ingest-chunk.d.ts +0 -73
- package/out/sdk/ingest-chunk.d.ts.map +0 -1
- package/out/sdk/ingest-chunk.js.map +0 -1
- package/out/test-kit.d.ts +0 -79
- package/out/test-kit.d.ts.map +0 -1
- package/out/test-kit.js.map +0 -1
package/out/sdk/verify.d.ts
CHANGED
|
@@ -2,40 +2,13 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The two-path agreement check, and its negative half.
|
|
7
|
-
*
|
|
8
|
-
* POSITIVE HALF. A sample of points is answered from the sealed artifact and then re-asked of Soil Data
|
|
9
|
-
* Access — the same authority, a different distribution channel, and geometry this package has never
|
|
10
|
-
* touched. What is compared is the MAP UNIT the two channels put at the point, which is the thing a
|
|
11
|
-
* conversion can get wrong; comparing the derived capability class instead would let a wrong delineation
|
|
12
|
-
* agree by accident whenever two neighbouring map units happen to share a class.
|
|
13
|
-
*
|
|
14
|
-
* NEGATIVE HALF, AND IT MATTERS AS MUCH. A sample of points in states with no rows must come back
|
|
15
|
-
* `unknown` — no coverage row at all — and never a low-capability reading. The positive half alone would
|
|
16
|
-
* pass on an artifact that answered class 8 for the whole planet.
|
|
17
|
-
*
|
|
18
|
-
* A DISAGREEMENT NEAR A DELINEATION EDGE IS NOT A DEFECT, AND THE DISTANCE IS MEASURED TO THE EDGE RATHER
|
|
19
|
-
* THAN TO THE NEAREST VERTEX. A point a centimetre from a long edge can be metres from every vertex of it
|
|
20
|
-
* — the flood layer's one near-miss read 1.58 m to vertices and 0.009 m to edges, a 9 mm difference
|
|
21
|
-
* overstated 175-fold. Measuring vertices makes the boundary tolerance far stricter than it reads, which
|
|
22
|
-
* is how a rendering difference gets reported as a conversion defect.
|
|
23
|
-
*
|
|
24
|
-
* THE ARTIFACT'S OWN ANSWER IS THE CELL SUMMARY, AND THE POINT'S MAP UNIT IS UNDER IT. So the comparison
|
|
25
|
-
* reaches the GEOMETRY — the truth table — rather than the reduction: the reduction is a per-cell
|
|
26
|
-
* distribution and has no single map unit to compare. That makes this a check on the CONVERSION, which is
|
|
27
|
-
* what it is for; the reduction is checked by the fixtures and by the share-sum invariant.
|
|
28
|
-
*
|
|
29
|
-
* IT REACHES IT THROUGH THE CELL INDEX, NOT THROUGH A BOUNDING-BOX SCAN. A `WHERE min_lat <= ? AND …` over
|
|
30
|
-
* the geometry table reads like a prefilter and is a full table scan: none of those columns is indexed and
|
|
31
|
-
* every row carries a ring blob, so at the pilot's 2.7 million delineations it reads gigabytes per point.
|
|
32
|
-
* Naming the point's cell is a primary-key range scan over a `WITHOUT ROWID` table, which is the whole
|
|
33
|
-
* reason the index exists.
|
|
34
5
|
*/
|
|
6
|
+
import type { PathBuilderLike } from "path-ts";
|
|
35
7
|
import { SoilReadingKind } from "#index";
|
|
36
8
|
import type { SoilDataAccessClient } from "#sdk/client";
|
|
37
9
|
/**
|
|
38
|
-
* One
|
|
10
|
+
* One comparison row for a point.
|
|
11
|
+
* It records both verdicts and whether they agree.
|
|
39
12
|
*/
|
|
40
13
|
export interface SoilAgreementRow {
|
|
41
14
|
label: string;
|
|
@@ -51,10 +24,10 @@ export interface SoilAgreementRow {
|
|
|
51
24
|
serviceMukey: string | null;
|
|
52
25
|
outcome: "agree" | "disagree" | "boundary_tolerance";
|
|
53
26
|
/**
|
|
54
|
-
*
|
|
27
|
+
* Meters from the point to the nearest edge of the delineation the artifact matched.
|
|
55
28
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
29
|
+
* Included on every row because it separates a real defect from two channels
|
|
30
|
+
* rendering the same edge differently.
|
|
58
31
|
*/
|
|
59
32
|
nearestEdgeMetres?: number;
|
|
60
33
|
}
|
|
@@ -67,7 +40,7 @@ export interface SoilOutsideRow {
|
|
|
67
40
|
longitude: number;
|
|
68
41
|
kind: SoilReadingKind;
|
|
69
42
|
/**
|
|
70
|
-
* True when the artifact answered `unknown
|
|
43
|
+
* True when the artifact answered `unknown`, the only acceptable reading outside the built survey areas.
|
|
71
44
|
*/
|
|
72
45
|
passed: boolean;
|
|
73
46
|
}
|
|
@@ -80,13 +53,10 @@ export interface VerifySoilResult {
|
|
|
80
53
|
outsidePassed: number;
|
|
81
54
|
}
|
|
82
55
|
/**
|
|
83
|
-
* Points outside the pilot region
|
|
84
|
-
* name is a coordinate nobody can check.
|
|
56
|
+
* Points outside the pilot region.
|
|
85
57
|
*
|
|
86
|
-
* Every
|
|
87
|
-
*
|
|
88
|
-
* these sit close to the Iowa border on purpose: the outline test is conservative, so a near-border point must read
|
|
89
|
-
* unknown rather than borrow Iowa's coverage.
|
|
58
|
+
* Every neighboring state is included because a footprint clipped to "the
|
|
59
|
+
* Midwest" would pass a one-state check.
|
|
90
60
|
*/
|
|
91
61
|
export declare const OUTSIDE_PILOT_POINTS: ReadonlyArray<{
|
|
92
62
|
label: string;
|
|
@@ -94,10 +64,10 @@ export declare const OUTSIDE_PILOT_POINTS: ReadonlyArray<{
|
|
|
94
64
|
longitude: number;
|
|
95
65
|
}>;
|
|
96
66
|
export interface VerifySoilOptions {
|
|
97
|
-
databasePath:
|
|
67
|
+
databasePath: PathBuilderLike;
|
|
98
68
|
client: Pick<SoilDataAccessClient, "mukeyAtPoint">;
|
|
99
69
|
/**
|
|
100
|
-
* Points to re-ask the service about
|
|
70
|
+
* Points to re-ask the service about, sampled from the artifact — see {@link sampleAgreementPoints}.
|
|
101
71
|
*/
|
|
102
72
|
points: ReadonlyArray<{
|
|
103
73
|
label: string;
|
|
@@ -116,16 +86,10 @@ export interface VerifySoilOptions {
|
|
|
116
86
|
*/
|
|
117
87
|
export declare function verifySoilDatabase(options: VerifySoilOptions): Promise<VerifySoilResult>;
|
|
118
88
|
/**
|
|
119
|
-
* Draw a reproducible sample of points from the artifact
|
|
120
|
-
*
|
|
121
|
-
* The draw is a deterministic stride over the primary key, not a random one, so a re-run compares the same points and a
|
|
122
|
-
* disagreement can be looked at rather than re-rolled.
|
|
123
|
-
*
|
|
124
|
-
* ONE ROW IS READ PER SAMPLE POINT AND NO MORE. A `WHERE rowid % stride = 0` scan looks like the same thing and is not:
|
|
125
|
-
* it walks the table itself, which means reading every ring blob to keep a few dozen. `ORDER BY area_id LIMIT 1 OFFSET
|
|
126
|
-
* n` walks the primary-key index to the offset and fetches exactly the row it lands on.
|
|
89
|
+
* Draw a reproducible sample of points from the artifact, a deterministic stride
|
|
90
|
+
* over the primary key so a re-run compares the same points.
|
|
127
91
|
*/
|
|
128
|
-
export declare function sampleAgreementPoints(databasePath:
|
|
92
|
+
export declare function sampleAgreementPoints(databasePath: PathBuilderLike, options?: {
|
|
129
93
|
count?: number;
|
|
130
94
|
}): Array<{
|
|
131
95
|
label: string;
|
package/out/sdk/verify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"verify.d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eAAe,CAAA;IAC7B,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAA;IAClD;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC7E,aAAa,CAAC,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACrF,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACtC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsD9F;AAyGD;;;GAGG;AACH,wBAAgB,qBAAqB,CACpC,YAAY,EAAE,eAAe,EAC7B,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9B,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAsC/D"}
|
package/out/sdk/verify.js
CHANGED
|
@@ -2,48 +2,16 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The two-path agreement check, and its negative half.
|
|
7
|
-
*
|
|
8
|
-
* POSITIVE HALF. A sample of points is answered from the sealed artifact and then re-asked of Soil Data
|
|
9
|
-
* Access — the same authority, a different distribution channel, and geometry this package has never
|
|
10
|
-
* touched. What is compared is the MAP UNIT the two channels put at the point, which is the thing a
|
|
11
|
-
* conversion can get wrong; comparing the derived capability class instead would let a wrong delineation
|
|
12
|
-
* agree by accident whenever two neighbouring map units happen to share a class.
|
|
13
|
-
*
|
|
14
|
-
* NEGATIVE HALF, AND IT MATTERS AS MUCH. A sample of points in states with no rows must come back
|
|
15
|
-
* `unknown` — no coverage row at all — and never a low-capability reading. The positive half alone would
|
|
16
|
-
* pass on an artifact that answered class 8 for the whole planet.
|
|
17
|
-
*
|
|
18
|
-
* A DISAGREEMENT NEAR A DELINEATION EDGE IS NOT A DEFECT, AND THE DISTANCE IS MEASURED TO THE EDGE RATHER
|
|
19
|
-
* THAN TO THE NEAREST VERTEX. A point a centimetre from a long edge can be metres from every vertex of it
|
|
20
|
-
* — the flood layer's one near-miss read 1.58 m to vertices and 0.009 m to edges, a 9 mm difference
|
|
21
|
-
* overstated 175-fold. Measuring vertices makes the boundary tolerance far stricter than it reads, which
|
|
22
|
-
* is how a rendering difference gets reported as a conversion defect.
|
|
23
|
-
*
|
|
24
|
-
* THE ARTIFACT'S OWN ANSWER IS THE CELL SUMMARY, AND THE POINT'S MAP UNIT IS UNDER IT. So the comparison
|
|
25
|
-
* reaches the GEOMETRY — the truth table — rather than the reduction: the reduction is a per-cell
|
|
26
|
-
* distribution and has no single map unit to compare. That makes this a check on the CONVERSION, which is
|
|
27
|
-
* what it is for; the reduction is checked by the fixtures and by the share-sum invariant.
|
|
28
|
-
*
|
|
29
|
-
* IT REACHES IT THROUGH THE CELL INDEX, NOT THROUGH A BOUNDING-BOX SCAN. A `WHERE min_lat <= ? AND …` over
|
|
30
|
-
* the geometry table reads like a prefilter and is a full table scan: none of those columns is indexed and
|
|
31
|
-
* every row carries a ring blob, so at the pilot's 2.7 million delineations it reads gigabytes per point.
|
|
32
|
-
* Naming the point's cell is a primary-key range scan over a `WITHOUT ROWID` table, which is the whole
|
|
33
|
-
* reason the index exists.
|
|
34
5
|
*/
|
|
35
6
|
import { decodeRings, interiorPointOfEncodedRings, pointInEncodedRings, segmentDistanceMetres, shortCellToInt, } from "@mailwoman/spatial";
|
|
36
7
|
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
37
8
|
import { cellToParent, latLngToCell } from "h3-js";
|
|
38
9
|
import { SoilCapabilityLookup, SoilReadingKind } from "#index";
|
|
39
10
|
/**
|
|
40
|
-
* Points outside the pilot region
|
|
41
|
-
* name is a coordinate nobody can check.
|
|
11
|
+
* Points outside the pilot region.
|
|
42
12
|
*
|
|
43
|
-
* Every
|
|
44
|
-
*
|
|
45
|
-
* these sit close to the Iowa border on purpose: the outline test is conservative, so a near-border point must read
|
|
46
|
-
* unknown rather than borrow Iowa's coverage.
|
|
13
|
+
* Every neighboring state is included because a footprint clipped to "the
|
|
14
|
+
* Midwest" would pass a one-state check.
|
|
47
15
|
*/
|
|
48
16
|
export const OUTSIDE_PILOT_POINTS = [
|
|
49
17
|
{ label: "Lincoln, Nebraska", latitude: 40.8136, longitude: -96.7026 },
|
|
@@ -56,13 +24,8 @@ export const OUTSIDE_PILOT_POINTS = [
|
|
|
56
24
|
{ label: "Sioux Falls, South Dakota", latitude: 43.5446, longitude: -96.7311 },
|
|
57
25
|
];
|
|
58
26
|
/**
|
|
59
|
-
*
|
|
60
|
-
* conversion.
|
|
61
|
-
*
|
|
62
|
-
* One metre. The published shapefile carries nine decimals through this package's ingest and Soil Data Access renders
|
|
63
|
-
* its own geometry independently; NRCS's own positional-accuracy statement says the difference between a boundary's
|
|
64
|
-
* field location and its digitized location "is unknown", so this tolerance is about the two RENDERINGS agreeing rather
|
|
65
|
-
* than about ground truth. One metre is far below the median delineation, which is 24,863 m² — about 158 m across.
|
|
27
|
+
* One meter, far below the median delineation, so a disagreement within it is the two
|
|
28
|
+
* channels rendering the same edge differently rather than a conversion defect.
|
|
66
29
|
*/
|
|
67
30
|
const BOUNDARY_TOLERANCE_METRES = 1;
|
|
68
31
|
/**
|
|
@@ -71,7 +34,7 @@ const BOUNDARY_TOLERANCE_METRES = 1;
|
|
|
71
34
|
export async function verifySoilDatabase(options) {
|
|
72
35
|
const database = new DatabaseClient(options.databasePath, { readOnly: true });
|
|
73
36
|
const lookup = new SoilCapabilityLookup({ databasePath: options.databasePath });
|
|
74
|
-
// Read once: the stored index is mixed-resolution
|
|
37
|
+
// Read once: the stored index is mixed-resolution, so a probe that assumed one
|
|
75
38
|
// resolution would read every row at the others as an absence.
|
|
76
39
|
const resolutions = database.prepare("SELECT DISTINCT resolution FROM soil_map_unit_cell ORDER BY resolution").all().map((row) => row.resolution);
|
|
77
40
|
const { indexResolution } = lookup.identity;
|
|
@@ -110,16 +73,9 @@ export async function verifySoilDatabase(options) {
|
|
|
110
73
|
}
|
|
111
74
|
}
|
|
112
75
|
/**
|
|
113
|
-
* The candidate delineations reaching a point, found
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* is indexed, the rows carry the ring blobs, and at the pilot's scale that is 2.7 million rows and several gigabytes
|
|
117
|
-
* read per point. The cell index exists to make exactly this question cheap — `soil_map_unit_cell` is `WITHOUT ROWID`
|
|
118
|
-
* keyed `(h3_cell, area_id)`, so naming the point's cell is a primary-key range scan.
|
|
119
|
-
*
|
|
120
|
-
* EVERY STORED RESOLUTION IS PROBED, not just the index one. The whole tier is compacted parent-ward, so a delineation
|
|
121
|
-
* that fills a run of cells is stored at a coarser resolution and a probe at the index resolution alone would read it
|
|
122
|
-
* as an absence — the same ancestor walk the reader does, and the same false negative it avoids.
|
|
76
|
+
* The candidate delineations reaching a point, found through the cell index
|
|
77
|
+
* because a bounding-box scan over `soil_map_unit_area` is a full table scan. every
|
|
78
|
+
* stored resolution is probed since the tier is compacted parent-ward.
|
|
123
79
|
*/
|
|
124
80
|
function candidateDelineations(database, resolutions, indexResolution, latitude, longitude) {
|
|
125
81
|
const selectCandidates = database.prepare("SELECT c.area_id AS area_id, a.mukey AS mukey, a.rings AS rings FROM soil_map_unit_cell c " +
|
|
@@ -130,12 +86,8 @@ function candidateDelineations(database, resolutions, indexResolution, latitude,
|
|
|
130
86
|
for (const resolution of resolutions) {
|
|
131
87
|
const cell = resolution === indexResolution ? indexCell : cellToParent(indexCell, resolution);
|
|
132
88
|
for (const row of selectCandidates.all(shortCellToInt(cell))) {
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
// different ground and must both be tested. Keying on the map unit drops the second, and it drops it silently —
|
|
136
|
-
// the point test simply finds nothing and the row reads as a disagreement with the authority. Measured at Iowa
|
|
137
|
-
// scale: one point in 60, where the artifact's own geometry does contain the point and the index-driven read
|
|
138
|
-
// could not reach the delineation that holds it.
|
|
89
|
+
// Dedupe on the delineation rather than its map unit, since two different delineations
|
|
90
|
+
// of one map unit cover different ground and both must be tested.
|
|
139
91
|
if (seen.has(row.area_id))
|
|
140
92
|
continue;
|
|
141
93
|
seen.add(row.area_id);
|
|
@@ -145,11 +97,9 @@ function candidateDelineations(database, resolutions, indexResolution, latitude,
|
|
|
145
97
|
return candidates;
|
|
146
98
|
}
|
|
147
99
|
/**
|
|
148
|
-
*
|
|
149
|
-
* edge.
|
|
100
|
+
* The map unit that the artifact's geometry places at a point.
|
|
150
101
|
*
|
|
151
|
-
*
|
|
152
|
-
* is reported with a distance rather than with nothing.
|
|
102
|
+
* Also records the distance to that delineation's nearest edge.
|
|
153
103
|
*/
|
|
154
104
|
function localDelineationAt(database, resolutions, indexResolution, latitude, longitude) {
|
|
155
105
|
const candidates = candidateDelineations(database, resolutions, indexResolution, latitude, longitude);
|
|
@@ -167,10 +117,9 @@ function localDelineationAt(database, resolutions, indexResolution, latitude, lo
|
|
|
167
117
|
return Number.isFinite(nearest) ? { mukey, nearestEdgeMetres: nearest } : { mukey };
|
|
168
118
|
}
|
|
169
119
|
/**
|
|
170
|
-
*
|
|
120
|
+
* Meters from a point to the nearest edge of an encoded ring set.
|
|
171
121
|
*
|
|
172
|
-
*
|
|
173
|
-
* geocode, and the decoded form is what makes the segment walk readable.
|
|
122
|
+
* This function decodes here because it runs once per verification rather than once per geocode.
|
|
174
123
|
*/
|
|
175
124
|
function nearestEdgeDistance(blob, lon, lat) {
|
|
176
125
|
const { polygons } = decodeRings(blob);
|
|
@@ -188,23 +137,16 @@ function nearestEdgeDistance(blob, lon, lat) {
|
|
|
188
137
|
return nearest;
|
|
189
138
|
}
|
|
190
139
|
/**
|
|
191
|
-
* Draw a reproducible sample of points from the artifact
|
|
192
|
-
*
|
|
193
|
-
* The draw is a deterministic stride over the primary key, not a random one, so a re-run compares the same points and a
|
|
194
|
-
* disagreement can be looked at rather than re-rolled.
|
|
195
|
-
*
|
|
196
|
-
* ONE ROW IS READ PER SAMPLE POINT AND NO MORE. A `WHERE rowid % stride = 0` scan looks like the same thing and is not:
|
|
197
|
-
* it walks the table itself, which means reading every ring blob to keep a few dozen. `ORDER BY area_id LIMIT 1 OFFSET
|
|
198
|
-
* n` walks the primary-key index to the offset and fetches exactly the row it lands on.
|
|
140
|
+
* Draw a reproducible sample of points from the artifact, a deterministic stride
|
|
141
|
+
* over the primary key so a re-run compares the same points.
|
|
199
142
|
*/
|
|
200
143
|
export function sampleAgreementPoints(databasePath, options = {}) {
|
|
201
144
|
const count = options.count ?? 60;
|
|
202
145
|
using database = new DatabaseClient(databasePath, { readOnly: true });
|
|
203
146
|
const total = database.prepare("SELECT count(*) AS n FROM soil_map_unit_area").get().n;
|
|
204
147
|
const stride = Math.max(1, Math.floor(total / Math.max(1, count)));
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
// sixty of them.
|
|
148
|
+
// Use one offset probe per sample point instead of materializing a key list.
|
|
149
|
+
// That list would retain every primary key to select sixty points.
|
|
208
150
|
const selectByOffset = database.prepare("SELECT area_id, mukey, min_lat, min_lon, max_lat, max_lon, rings FROM soil_map_unit_area ORDER BY area_id LIMIT 1 OFFSET ?");
|
|
209
151
|
const points = [];
|
|
210
152
|
for (let index = 0; index < total && points.length < count; index += stride) {
|
package/out/sdk/verify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../sdk/verify.ts"],"names":[],"mappings":"AAAA;;;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AE,SAAQ;QAEvB,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,IAAI,CAAC,KAAK,gBAAgB,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAA;IAC1F,CAAC;IAED,OAAO,MAAM,CAAA;AACd,CAAC"}
|
package/out/vocabulary.d.ts
CHANGED
|
@@ -2,178 +2,112 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* NRCS's own words, as data: the product identity, the licence sentence it ships inside every archive,
|
|
7
|
-
* the acknowledgement it asks for, and the caveats that decide what a reading may claim.
|
|
8
|
-
*
|
|
9
|
-
* THE RATING VOCABULARY IS NOT HERE, BECAUSE THE AUTHORITY SHIPS IT. `msdomdet.txt` inside each survey
|
|
10
|
-
* area's tabular export carries the declared domain for every `Choice` column, WITH the authority's own
|
|
11
|
-
* prose definition of each member — capability classes 1 through 8, subclasses `c`/`e`/`s`/`w`, the 28
|
|
12
|
-
* farmland classifications, the six component kinds. So the layer reads the domain out of the file it
|
|
13
|
-
* ingested rather than transcribing it from the National Soil Survey Handbook, and an out-of-domain value
|
|
14
|
-
* throws: an unknown code is a source-schema change, which is the event a reader most needs to hear
|
|
15
|
-
* about, and coercing it to a nearest neighbour or to NULL converts "the source changed" into "there is
|
|
16
|
-
* nothing here".
|
|
17
|
-
*
|
|
18
|
-
* THE FARMLAND VOCABULARY IS CONDITIONAL AND THE CONDITION IS THE CLAIM. 28 declared values, of which 24
|
|
19
|
-
* carry an "if" — `Prime farmland if drained`, `Prime farmland if irrigated and reclaimed of excess salts
|
|
20
|
-
* and sodium`. A boolean `arable` column would be this layer's invention rather than the authority's
|
|
21
|
-
* statement, so the string is stored whole.
|
|
22
|
-
*
|
|
23
|
-
* AND TWO OF ITS CATEGORIES TRAVEL WHILE THE OTHERS DO NOT. 7 CFR 657.5 defines prime farmland and unique
|
|
24
|
-
* farmland nationally against nine specific criteria; §657.5(c) and (d) hand "additional farmland of
|
|
25
|
-
* statewide importance" and "of local importance" to state and local agencies respectively. So
|
|
26
|
-
* `Farmland of statewide importance` in Iowa and in Georgia are not the same claim, and a consumer that
|
|
27
|
-
* pooled them into one rank would be pooling incompatible vocabularies. {@link FarmlandScope} carries
|
|
28
|
-
* that distinction into the artifact rather than leaving it in a document.
|
|
29
5
|
*/
|
|
30
6
|
/**
|
|
31
|
-
* The
|
|
32
|
-
*
|
|
33
|
-
* States".
|
|
7
|
+
* The prefix of every soil layer name.
|
|
8
|
+
* The reader rejects an artifact whose layer name lacks it.
|
|
34
9
|
*/
|
|
35
10
|
export declare const SOIL_LAYER_NAME_PREFIX = "soil-capability-nrcs-ssurgo-";
|
|
36
11
|
/**
|
|
37
|
-
*
|
|
12
|
+
* Returns the layer name for a build over `region`.
|
|
38
13
|
*/
|
|
39
14
|
export declare function soilLayerName(region: string): string;
|
|
40
15
|
/**
|
|
41
|
-
* The pilot region
|
|
16
|
+
* The pilot region, Iowa.
|
|
42
17
|
*/
|
|
43
18
|
export declare const SOIL_PILOT_REGION = "ia";
|
|
44
19
|
/**
|
|
45
|
-
* The acknowledgement
|
|
46
|
-
*
|
|
47
|
-
* from these data", so it rides in `layer_manifest.attribution`.
|
|
20
|
+
* The agency acknowledgement that the SSURGO use constraints require,
|
|
21
|
+
* written to `layer_manifest.attribution`.
|
|
48
22
|
*/
|
|
49
23
|
export declare const SSURGO_ATTRIBUTION = "U.S. Department of Agriculture, Natural Resources Conservation Service";
|
|
50
24
|
/**
|
|
51
|
-
* The
|
|
52
|
-
*
|
|
53
|
-
* A public-domain identifier, and the grant behind it is the producing agency's own sentence rather than a catalogue
|
|
54
|
-
* field: data.gov's entry points at `usa.gov/publicdomain/label/1.0/`, which redirects to a page that declines a
|
|
55
|
-
* blanket grant and tells the reader to check with the agency. The agency was checked at the strongest available place
|
|
56
|
-
* — the FGDC metadata NRCS ships inside the archive — and it says {@link SSURGO_PUBLIC_INFORMATION_SENTENCE}.
|
|
25
|
+
* The public-domain license expression written to `layer_manifest.license`, granted by
|
|
26
|
+
* {@link SSURGO_PUBLIC_INFORMATION_SENTENCE} in each archive's FGDC metadata.
|
|
57
27
|
*/
|
|
58
28
|
export declare const SSURGO_LICENSE = "LicenseRef-USGov-Public-Domain";
|
|
59
29
|
/**
|
|
60
|
-
* The
|
|
61
|
-
* survey-area archive.
|
|
30
|
+
* The public-information grant quoted from each survey area's FGDC use constraints.
|
|
62
31
|
*
|
|
63
|
-
* The
|
|
64
|
-
*
|
|
32
|
+
* The survey-area loader rejects an area whose metadata lacks it, since its
|
|
33
|
+
* absence signals a license change.
|
|
65
34
|
*/
|
|
66
35
|
export declare const SSURGO_PUBLIC_INFORMATION_SENTENCE = "This is public information";
|
|
67
36
|
/**
|
|
68
|
-
* The use constraints
|
|
69
|
-
* authority's own words rather than against this package's summary of them.
|
|
37
|
+
* The full SSURGO use constraints, quoted from the FGDC metadata.
|
|
70
38
|
*/
|
|
71
39
|
export declare const SSURGO_USE_CONSTRAINTS: string;
|
|
72
40
|
/**
|
|
73
|
-
*
|
|
74
|
-
* capability class that the survey declines to speak about a specific site.
|
|
41
|
+
* NRCS states these SSURGO limitations verbatim.
|
|
75
42
|
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
43
|
+
* Every reading includes them.
|
|
44
|
+
* They describe the map unit covering a point rather than a site-specific determination.
|
|
78
45
|
*/
|
|
79
46
|
export declare const SSURGO_PRODUCT_LIMITS: ReadonlyArray<string>;
|
|
80
47
|
/**
|
|
81
|
-
* The coverage statement
|
|
82
|
-
*
|
|
83
|
-
* It is the mapping at the survey's own scale, NOT a site-specific determination — which is why the observation reports
|
|
84
|
-
* what the survey assigns to the map unit covering a location and never whether the land can be farmed.
|
|
48
|
+
* The coverage statement: soil mapping is complete at survey scale inside a
|
|
49
|
+
* published survey area and absent outside one.
|
|
85
50
|
*/
|
|
86
51
|
export declare const SSURGO_COVERAGE_STATEMENT: string;
|
|
87
52
|
/**
|
|
88
|
-
*
|
|
53
|
+
* The page that publishes the product's identity and update schedule.
|
|
89
54
|
*/
|
|
90
55
|
export declare const SSURGO_STATEMENT_URL = "https://www.nrcs.usda.gov/conservation-basics/natural-resource-concerns/soil/annual-soils-refresh";
|
|
91
56
|
/**
|
|
92
|
-
* The dataset identifier written
|
|
57
|
+
* The dataset identifier written to `layer_manifest.source`.
|
|
93
58
|
*/
|
|
94
59
|
export declare const SSURGO_SOURCE = "nrcs.usda.gov/SSURGO";
|
|
95
60
|
/**
|
|
96
|
-
* The
|
|
97
|
-
* GDAL resolves to this authority code — so no reprojection is needed before H3, and a survey area declaring anything
|
|
98
|
-
* else is a product change rather than a variation to absorb.
|
|
61
|
+
* The EPSG code that every SSURGO survey-area shapefile declares, required by the ingest by default.
|
|
99
62
|
*/
|
|
100
63
|
export declare const SSURGO_SOURCE_EPSG = 4326;
|
|
101
64
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* 7 CFR 657.5 defines prime and unique farmland against nine national criteria; (c) and (d) delegate statewide and
|
|
105
|
-
* local importance. A consumer comparing two states may compare the national categories and must not compare the
|
|
106
|
-
* delegated ones.
|
|
65
|
+
* The authorities that can set a farmland classification's criteria; `None` covers
|
|
66
|
+
* not-prime farmland and land with no classification.
|
|
107
67
|
*/
|
|
108
68
|
export declare const FarmlandScope: {
|
|
109
|
-
/**
|
|
110
|
-
* Criteria set by 7 CFR 657.5(a)–(b). Comparable across the country.
|
|
111
|
-
*/
|
|
112
69
|
readonly Federal: "federal";
|
|
113
|
-
/**
|
|
114
|
-
* Criteria "determined by the appropriate State agency or agencies" — 7 CFR 657.5(c).
|
|
115
|
-
*/
|
|
116
70
|
readonly State: "state";
|
|
117
|
-
/**
|
|
118
|
-
* Criteria "identified by the local agency or agencies concerned" — 7 CFR 657.5(d).
|
|
119
|
-
*/
|
|
120
71
|
readonly Local: "local";
|
|
121
|
-
/**
|
|
122
|
-
* The value states no farmland importance at all.
|
|
123
|
-
*/
|
|
124
72
|
readonly None: "none";
|
|
125
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* One {@link FarmlandScope} value, as stored in the `farmland_scope` column.
|
|
76
|
+
*/
|
|
126
77
|
export type FarmlandScope = (typeof FarmlandScope)[keyof typeof FarmlandScope];
|
|
127
78
|
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* Matching on the phrase rather than on an enumerated list of the 28 values is deliberate: the domain grows — the
|
|
131
|
-
* conditional tail is generated by combining a base category with a condition — and a new `Farmland of statewide
|
|
132
|
-
* importance, if …` must land in {@link FarmlandScope.State} on the day it appears rather than silently defaulting to
|
|
133
|
-
* the comparable bucket.
|
|
79
|
+
* Classifies a `farmlndcl` value into a {@link FarmlandScope} by the phrase the regulation uses,
|
|
80
|
+
* so a conditional value such as `Farmland of statewide importance, if …` still gets the right scope.
|
|
134
81
|
*/
|
|
135
82
|
export declare function farmlandScope(value: string | null | undefined): FarmlandScope;
|
|
136
83
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* These are polygons rather than holes — the same wall-to-wall discipline that makes them separable from land outside a
|
|
140
|
-
* survey area entirely. Measured nationally through Soil Data Access: 37 map units carry `NOTCOM` (`No Digital Data
|
|
141
|
-
* Available`) and 7 carry `NOTPUB` (`Not Public Information`).
|
|
84
|
+
* The upper-case map-unit symbols that NRCS gives a delineation it drew without soil mapping.
|
|
142
85
|
*/
|
|
143
86
|
export declare const SSURGO_NO_MAPPING_SYMBOLS: ReadonlySet<string>;
|
|
144
87
|
/**
|
|
145
|
-
*
|
|
146
|
-
* `Area not surveyed, access denied`.
|
|
88
|
+
* The lower-case map-unit names that mark a delineation without soil mapping when its symbol does not.
|
|
147
89
|
*
|
|
148
|
-
*
|
|
149
|
-
* pending` and would also catch nothing else, but it would equally catch a real soil name beginning with those words,
|
|
150
|
-
* and there is no such thing to be gained by guessing.
|
|
90
|
+
* The match uses the whole name, since a prefix could also match a real soil name.
|
|
151
91
|
*/
|
|
152
92
|
export declare const SSURGO_NO_MAPPING_NAMES: ReadonlySet<string>;
|
|
153
93
|
/**
|
|
154
|
-
* The
|
|
155
|
-
*
|
|
156
|
-
* Its `interphr` is an index in [0, 1] — measured 0.001 to 0.991 nationally, 0.022 to 0.990 on `IA153` — and it is
|
|
157
|
-
* never blended with the capability class: they are two ratings from one authority answering different questions, and
|
|
158
|
-
* combining them would produce a number NRCS does not publish.
|
|
94
|
+
* The `cointerp.mrulename` of the productivity index this layer stores, kept apart from the capability
|
|
95
|
+
* class because a combination of the two would be a number NRCS does not publish.
|
|
159
96
|
*/
|
|
160
97
|
export declare const NCCPI_V3_RULE_NAME = "NCCPI - National Commodity Crop Productivity Index (Ver 3.0)";
|
|
161
98
|
/**
|
|
162
|
-
* The
|
|
163
|
-
* submodels (corn, soybeans, small grains, cotton), which this layer does not carry.
|
|
99
|
+
* The `cointerp.ruledepth` at which a rule reports its overall value instead of a crop submodel.
|
|
164
100
|
*/
|
|
165
101
|
export declare const COINTERP_OVERALL_RULE_DEPTH = "0";
|
|
166
102
|
/**
|
|
167
|
-
*
|
|
103
|
+
* The code of the area-times-component-percentage weighting that produced the per-cell shares.
|
|
168
104
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* lies in map units whose components are class 2" and "the components in this cell sum to 60% class 2" are different
|
|
172
|
-
* claims, and a reader holding only a share cannot tell which one it is holding.
|
|
105
|
+
* Component percentages have no location, so a share indicates how much of a cell
|
|
106
|
+
* lies in rated map units and not where the rating applies.
|
|
173
107
|
*/
|
|
174
108
|
export declare const SOIL_SHARE_WEIGHTING = "cell_area_x_comppct_r";
|
|
175
109
|
/**
|
|
176
|
-
* The
|
|
110
|
+
* The prose description of {@link SOIL_SHARE_WEIGHTING}, stored beside it in the artifact.
|
|
177
111
|
*/
|
|
178
112
|
export declare const SOIL_SHARE_WEIGHTING_DESCRIPTION: string;
|
|
179
113
|
//# sourceMappingURL=vocabulary.d.ts.map
|
package/out/vocabulary.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../lib/vocabulary.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../lib/vocabulary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,eAAO,MAAM,sBAAsB,iCAAiC,CAAA;AAEpE;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAA;AAErC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,2EAA2E,CAAA;AAE1G;;;GAGG;AACH,eAAO,MAAM,cAAc,mCAAmC,CAAA;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,+BAA+B,CAAA;AAE9E;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAKY,CAAA;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAMvD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAEoD,CAAA;AAE1F;;GAEG;AACH,eAAO,MAAM,oBAAoB,sGACmE,CAAA;AAEpG;;GAEG;AACH,eAAO,MAAM,aAAa,yBAAyB,CAAA;AAEnD;;GAEG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,aAAa;aACzB,OAAO,EAAE,SAAS;aAElB,KAAK,EAAE,OAAO;aAEd,KAAK,EAAE,OAAO;aAEd,IAAI,EAAE,MAAM;CACH,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAA;AAE9E;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,I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