@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/schema.js
CHANGED
|
@@ -3,33 +3,23 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Typed schema for `soil.db
|
|
7
|
-
*
|
|
6
|
+
* Typed schema for `soil.db`. It defines the polygon truth table, its containment index and the shared reduction
|
|
7
|
+
* that both consumers read. It also defines the layer-interface tables from `@mailwoman/core/layers`.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* weights change silently.
|
|
9
|
+
* {@link SoilMapUnitAreaTable} stores the authority's unsimplified geometry.
|
|
10
|
+
* {@link SoilMapUnitCellTable} records which cells each delineation reaches and whether it fills them.
|
|
11
|
+
* {@link SoilCapabilityCellTable} is that index reduced once, at build time, into a per-cell
|
|
12
|
+
* distribution. A `partial` cell's contribution is weighted by the area it covers. The truth table keeps
|
|
13
|
+
* unsimplified rings so simplification cannot change those weights silently.
|
|
15
14
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* `muaggatt.niccdcd` — its own dominant-condition capability class — beside `niccdcdpct`, the share that
|
|
21
|
-
* class actually covers, with an observed minimum of 2%. This table reproduces that pattern at cell grain
|
|
22
|
-
* rather than inventing one.
|
|
15
|
+
* The reduction stores a distribution instead of one winning class. Four separate shares record reasons for
|
|
16
|
+
* absence. Class 8 is a determination, so it contributes a class share. A fold that places a `notcom` polygon, a water body
|
|
17
|
+
* and an unrated series into "not arable" would produce a well-formed but wrong answer. The four shares preserve
|
|
18
|
+
* those distinctions.
|
|
23
19
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* polygon, a water body and an unrated series into "not arable" would produce a well-formed wrong answer,
|
|
28
|
-
* which is what the four shares exist to make impossible.
|
|
29
|
-
*
|
|
30
|
-
* `WITHOUT ROWID` ON THE CELL TABLES AND NEVER ON THE GEOMETRY TABLE. Small fixed-width rows probed by
|
|
31
|
-
* their exact primary key belong in the B-tree; a row carrying a geometry blob does not — clustering it
|
|
32
|
-
* into the B-tree makes every index page a geometry page.
|
|
20
|
+
* Cell tables use `without rowid`; the geometry table uses ordinary rowids. Small fixed-width rows are probed by
|
|
21
|
+
* their exact primary key, so they fit the B-tree. A geometry blob would make every index page a geometry page if
|
|
22
|
+
* stored in that B-tree.
|
|
33
23
|
*/
|
|
34
24
|
import { addBoundingBoxColumns, addCellIndexColumns, addRingGeometryColumns } from "@mailwoman/sqlite/schema-columns";
|
|
35
25
|
import { sql } from "kysely";
|
|
@@ -38,17 +28,24 @@ import { sql } from "kysely";
|
|
|
38
28
|
*/
|
|
39
29
|
export const SoilCellContainment = {
|
|
40
30
|
/**
|
|
41
|
-
* Every point in the cell is inside the delineation.
|
|
31
|
+
* Every point in the cell is inside the delineation.
|
|
32
|
+
*
|
|
33
|
+
* Answered from the index without reading geometry.
|
|
42
34
|
*/
|
|
43
35
|
Whole: "whole",
|
|
44
36
|
/**
|
|
45
|
-
* The delineation's boundary crosses the cell.
|
|
37
|
+
* The delineation's boundary crosses the cell.
|
|
38
|
+
*
|
|
39
|
+
* The index has narrowed the candidates.
|
|
40
|
+
* The point test decides.
|
|
46
41
|
*/
|
|
47
42
|
Partial: "partial",
|
|
48
43
|
};
|
|
49
44
|
/**
|
|
50
|
-
* Create `soil_map_unit_area`.
|
|
51
|
-
*
|
|
45
|
+
* Create `soil_map_unit_area`.
|
|
46
|
+
*
|
|
47
|
+
* A plain rowid table on purpose.
|
|
48
|
+
* The `rings` blob is exactly the payload `without rowid` penalizes.
|
|
52
49
|
*/
|
|
53
50
|
export async function createSoilMapUnitAreaTable(db) {
|
|
54
51
|
const table = db.schema
|
|
@@ -59,13 +56,15 @@ export async function createSoilMapUnitAreaTable(db) {
|
|
|
59
56
|
await addRingGeometryColumns(table).execute();
|
|
60
57
|
}
|
|
61
58
|
/**
|
|
62
|
-
* Create `soil_map_unit_cell
|
|
59
|
+
* Create `soil_map_unit_cell`, the containment index.
|
|
60
|
+
*
|
|
61
|
+
* Small fixed-width rows probed by their exact primary key.
|
|
63
62
|
*/
|
|
64
63
|
export async function createSoilMapUnitCellTable(db) {
|
|
65
64
|
const table = db.schema.createTable("soil_map_unit_cell");
|
|
66
65
|
await addCellIndexColumns(table, "area_id")
|
|
67
66
|
.addPrimaryKeyConstraint("soil_map_unit_cell_pk", ["h3_cell", "area_id"])
|
|
68
|
-
// `
|
|
67
|
+
// `without rowid` has no first-class builder. The raw modifier is the idiomatic fallback.
|
|
69
68
|
.modifyEnd(sql `without rowid`)
|
|
70
69
|
.execute();
|
|
71
70
|
}
|
|
@@ -107,7 +106,8 @@ export async function createSoilComponentTable(db) {
|
|
|
107
106
|
.execute();
|
|
108
107
|
}
|
|
109
108
|
/**
|
|
110
|
-
* Create `soil_capability_cell
|
|
109
|
+
* Create `soil_capability_cell`.
|
|
110
|
+
* The reduction both consumers read.
|
|
111
111
|
*/
|
|
112
112
|
export async function createSoilCapabilityCellTable(db) {
|
|
113
113
|
await db.schema
|
package/out/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../lib/schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../lib/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACrH,OAAO,EAAE,GAAG,EAAe,MAAM,QAAQ,CAAA;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC;;;;OAIG;IACH,KAAK,EAAE,OAAO;IACd;;;;;OAKG;IACH,OAAO,EAAE,SAAS;CACT,CAAA;AA+WV;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,EAAoB;IACpE,MAAM,KAAK,GAAG,EAAE,CAAC,MAAM;SACrB,WAAW,CAAC,oBAAoB,CAAC;SACjC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;SACnD,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAC9C,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,C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C,CAAC,CAAC,OAAO,EAAE,CAAC;SACpD,uBAAuB,CAAC,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;SACjE,SAAS,CAAC,GAAG,CAAA,eAAe,CAAC;SAC7B,OAAO,EAAE,CAAA;AACZ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EAAoB;IAC1D,MAAM,0BAA0B,CAAC,EAAE,CAAC,CAAA;IACpC,MAAM,0BAA0B,CAAC,EAAE,CAAC,CAAA;IACpC,MAAM,sBAAsB,CAAC,EAAE,CAAC,CAAA;IAChC,MAAM,wBAAwB,CAAC,EAAE,CAAC,CAAA;IAClC,MAAM,6BAA6B,CAAC,EAAE,CAAC,CAAA;IACvC,MAAM,yBAAyB,CAAC,EAAE,CAAC,CAAA;IACnC,MAAM,yBAAyB,CAAC,EAAE,CAAC,CAAA;AACpC,CAAC"}
|
package/out/sdk/acquire.d.ts
CHANGED
|
@@ -3,58 +3,49 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* takes.
|
|
8
|
-
*
|
|
9
|
-
* THE FRESHNESS QUESTION IS ANSWERED BY THE TABULAR SERVICE, NOT BY THE FILE HOST. `sacatalog.saverest` is
|
|
10
|
-
* the version-established date, and it is also what the archive's filename embeds — so one catalogue call
|
|
11
|
-
* both decides what to download and names the file. The download host cannot answer it: it refuses `HEAD`
|
|
12
|
-
* with 405 and ignores `Range`, so a length probe there is a full transfer.
|
|
13
|
-
*
|
|
14
|
-
* THE VINTAGE IS THE REFRESH THE BUILD INGESTED, AND IT IS ONE DATE FOR THE WHOLE ARTIFACT. NRCS performs
|
|
15
|
-
* ONE coordinated Annual Soils Refresh, each October 1; grouping `sacatalog` by year of `saverest` returns
|
|
16
|
-
* 2016: 1, 2025: 3,323, 2026: 56. So a region's areas share a refresh and the manifest can carry one
|
|
17
|
-
* `source_vintage` — the LATEST of the areas built, because that is the date after which nothing in the
|
|
18
|
-
* artifact changed. Every area's own date is kept per row in `soil_survey_area`, and so is the far older
|
|
19
|
-
* field-survey date, which is the number a currency claim actually turns on.
|
|
6
|
+
* Downloads a region's soil survey areas and turns them into builder inputs. The catalogue's `saverest` date picks the archive and the host rejects `HEAD` and ignores `Range`.
|
|
20
7
|
*/
|
|
8
|
+
import type { PathBuilderLike } from "path-ts";
|
|
21
9
|
import type { SurveyAreaInput } from "#sdk/build-soil";
|
|
22
10
|
import type { SoilDataAccessClient, SurveyAreaCatalogEntry } from "#sdk/client";
|
|
23
11
|
import { type SurveyAreaArchive } from "#sdk/download";
|
|
12
|
+
/**
|
|
13
|
+
* Options for {@link acquireRegion}.
|
|
14
|
+
*/
|
|
24
15
|
export interface AcquireRegionOptions {
|
|
25
16
|
client: SoilDataAccessClient;
|
|
26
17
|
/**
|
|
27
|
-
* The survey-area symbol prefix
|
|
28
|
-
*
|
|
18
|
+
* The survey-area symbol prefix, where a state code such as `IA` selects a whole state
|
|
19
|
+
* and a full symbol such as `IA153` selects one area.
|
|
29
20
|
*/
|
|
30
21
|
prefix: string;
|
|
31
22
|
/**
|
|
32
|
-
*
|
|
23
|
+
* The directory where downloaded archives are cached.
|
|
33
24
|
*/
|
|
34
|
-
cacheRoot:
|
|
25
|
+
cacheRoot: PathBuilderLike;
|
|
35
26
|
/**
|
|
36
|
-
*
|
|
27
|
+
* The symbols to build from the catalogue's results, defaulting to every symbol.
|
|
37
28
|
*/
|
|
38
29
|
only?: ReadonlyArray<string>;
|
|
39
30
|
onProgress?: (message: string) => void;
|
|
40
31
|
}
|
|
41
32
|
/**
|
|
42
|
-
*
|
|
33
|
+
* The result of acquiring one region.
|
|
43
34
|
*/
|
|
44
35
|
export interface AcquiredRegion {
|
|
45
36
|
catalog: SurveyAreaCatalogEntry[];
|
|
46
37
|
archives: SurveyAreaArchive[];
|
|
47
38
|
areas: SurveyAreaInput[];
|
|
48
39
|
/**
|
|
49
|
-
* The
|
|
40
|
+
* The latest `saverest` date among the areas built, used as the artifact's source vintage.
|
|
50
41
|
*/
|
|
51
42
|
sourceVintage: string;
|
|
52
43
|
}
|
|
53
44
|
/**
|
|
54
|
-
*
|
|
45
|
+
* Downloads every survey area that matches the prefix and turns each into a builder input.
|
|
55
46
|
*
|
|
56
|
-
* @throws {Error} When the catalogue
|
|
57
|
-
*
|
|
47
|
+
* @throws {Error} When the catalogue has no entry for the prefix, when `only` lists a symbol
|
|
48
|
+
* that the catalogue lacks, or when an area's archive, metadata or shapefile cannot be read.
|
|
58
49
|
*/
|
|
59
50
|
export declare function acquireRegion(options: AcquireRegionOptions): Promise<AcquiredRegion>;
|
|
60
51
|
//# sourceMappingURL=acquire.d.ts.map
|
package/out/sdk/acquire.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acquire.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"acquire.d.ts","sourceRoot":"","sources":["../../sdk/acquire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAI1E;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,oBAAoB,CAAA;IAC5B;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,SAAS,EAAE,eAAe,CAAA;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC5B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,sBAAsB,EAAE,CAAA;IACjC,QAAQ,EAAE,iBAAiB,EAAE,CAAA;IAC7B,KAAK,EAAE,eAAe,EAAE,CAAA;IACxB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAyD1F"}
|
package/out/sdk/acquire.js
CHANGED
|
@@ -3,29 +3,16 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* takes.
|
|
8
|
-
*
|
|
9
|
-
* THE FRESHNESS QUESTION IS ANSWERED BY THE TABULAR SERVICE, NOT BY THE FILE HOST. `sacatalog.saverest` is
|
|
10
|
-
* the version-established date, and it is also what the archive's filename embeds — so one catalogue call
|
|
11
|
-
* both decides what to download and names the file. The download host cannot answer it: it refuses `HEAD`
|
|
12
|
-
* with 405 and ignores `Range`, so a length probe there is a full transfer.
|
|
13
|
-
*
|
|
14
|
-
* THE VINTAGE IS THE REFRESH THE BUILD INGESTED, AND IT IS ONE DATE FOR THE WHOLE ARTIFACT. NRCS performs
|
|
15
|
-
* ONE coordinated Annual Soils Refresh, each October 1; grouping `sacatalog` by year of `saverest` returns
|
|
16
|
-
* 2016: 1, 2025: 3,323, 2026: 56. So a region's areas share a refresh and the manifest can carry one
|
|
17
|
-
* `source_vintage` — the LATEST of the areas built, because that is the date after which nothing in the
|
|
18
|
-
* artifact changed. Every area's own date is kept per row in `soil_survey_area`, and so is the far older
|
|
19
|
-
* field-survey date, which is the number a currency claim actually turns on.
|
|
6
|
+
* Downloads a region's soil survey areas and turns them into builder inputs. The catalogue's `saverest` date picks the archive and the host rejects `HEAD` and ignores `Range`.
|
|
20
7
|
*/
|
|
21
8
|
import { downloadSurveyArea } from "#sdk/download";
|
|
22
9
|
import { mapUnitShapefile, readSoilSourceIdentity, surveyAreaShapefile } from "#sdk/ingest";
|
|
23
10
|
import { readSurveyAreaAttributes, readSurveyAreaOutline } from "#sdk/survey-area";
|
|
24
11
|
/**
|
|
25
|
-
*
|
|
12
|
+
* Downloads every survey area that matches the prefix and turns each into a builder input.
|
|
26
13
|
*
|
|
27
|
-
* @throws {Error} When the catalogue
|
|
28
|
-
*
|
|
14
|
+
* @throws {Error} When the catalogue has no entry for the prefix, when `only` lists a symbol
|
|
15
|
+
* that the catalogue lacks, or when an area's archive, metadata or shapefile cannot be read.
|
|
29
16
|
*/
|
|
30
17
|
export async function acquireRegion(options) {
|
|
31
18
|
const catalog = await options.client.readSurveyAreaCatalog(options.prefix);
|
|
@@ -62,9 +49,7 @@ export async function acquireRegion(options) {
|
|
|
62
49
|
declaredFeatureCount: identity.featureCount,
|
|
63
50
|
});
|
|
64
51
|
}
|
|
65
|
-
// The
|
|
66
|
-
// Taking the earliest would claim a currency the newest area does not have; taking today's date would claim one no
|
|
67
|
-
// area has.
|
|
52
|
+
// The latest refresh date is the date after which no entry in this artifact changed.
|
|
68
53
|
const sourceVintage = selected
|
|
69
54
|
.map((entry) => entry.saverest)
|
|
70
55
|
.toSorted()
|
package/out/sdk/acquire.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acquire.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"acquire.js","sourceRoot":"","sources":["../../sdk/acquire.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAE,kBAAkB,EAA0B,MAAM,eAAe,CAAA;AAC1E,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAC3F,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAoClF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA6B;IAChE,MAAM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,CAAC,QAAQ,CAAC;SAC9B,QAAQ,EAAE;SACV,EAAE,CAAC,CAAC,CAAC,CAAE,CAAA;IAET,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA;AACnD,CAAC"}
|
package/out/sdk/build-soil.d.ts
CHANGED
|
@@ -3,116 +3,110 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Builds the sealed `soil.db` polygon layer from NRCS soil survey areas.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* into a temporary table because memory has to stay flat in row count. A polygon layer's touches
|
|
12
|
-
* outnumber its features, and Iowa is 99 survey areas.
|
|
13
|
-
*
|
|
14
|
-
* ABSENCE IS NO ROW, IN EVERY TABLE. Land outside a published survey area gets no `layer_coverage` row and
|
|
15
|
-
* no summary row — never a zero, never an empty histogram. Inside a published area the coverage row says
|
|
16
|
-
* `designated` at completeness 1.0, because NRCS declares its own mapping complete for those areas at its
|
|
17
|
-
* own scale; a coverage cell reached ONLY by `NOTCOM` and access-denied polygons gets no row either,
|
|
18
|
-
* because the polygon exists and the soil mapping behind it does not.
|
|
19
|
-
*
|
|
20
|
-
* A COVERAGE ROW LICENSES ONLY THAT THE AUTHORITY MAPPED HERE. The reading is the class distribution, and
|
|
21
|
-
* a cell that is 100% `unrated_share` is `designated`-complete and carries no capability reading
|
|
22
|
-
* whatsoever. That pairing is not a corner case: 17.1% of national components carry no capability rating,
|
|
23
|
-
* and for the irrigated rating the figure is 85.1%.
|
|
24
|
-
*
|
|
25
|
-
* THE AREA CROSS-CHECK USES THE AUTHORITY'S OWN PUBLISHED FIGURE. `legend.areaacres` is what NRCS states
|
|
26
|
-
* the survey area covers — 378,800 acres for `IA153`, which is 1,532.9 km² against the 1,532.5 km² an
|
|
27
|
-
* independent projected measurement of the same shapefile reports. Comparing the spherical ring sum
|
|
28
|
-
* against it catches a hole read as an exterior ring, whose absence is silent: such a polygon is
|
|
29
|
-
* well-formed and simply answers "inside" for ground the authority did not map.
|
|
8
|
+
* The builder streams cell touches into a temporary SQL table so that memory stays flat as the row
|
|
9
|
+
* count grows. Absent data has no row in any table. Land outside a survey area and coverage cells that
|
|
10
|
+
* only `notcom` or access-denied polygons reach, get no coverage row.
|
|
30
11
|
*/
|
|
31
12
|
import { type AreaAgreementReading } from "@mailwoman/core/layers";
|
|
32
13
|
import { type ParsedGeometry } from "@mailwoman/spatial";
|
|
14
|
+
import type { PathBuilderLike } from "path-ts";
|
|
33
15
|
import type { SoilFeatureSource } from "#sdk/ingest";
|
|
34
|
-
import type { SoilChunkResult } from "#sdk/ingest
|
|
16
|
+
import type { SoilChunkResult } from "#sdk/ingest/chunk";
|
|
35
17
|
import type { SurveyAreaAttributes } from "#sdk/survey-area";
|
|
36
18
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
19
|
+
* The schema version of the domain tables.
|
|
20
|
+
*
|
|
21
|
+
* It changes when a column changes meaning.
|
|
22
|
+
* An added column that readers can ignore does not change it.
|
|
39
23
|
*/
|
|
40
24
|
export declare const SOIL_SCHEMA_VERSION = 1;
|
|
41
25
|
/**
|
|
42
|
-
*
|
|
26
|
+
* The number of delineation ids per chunk process.
|
|
43
27
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* on this build the bound costs one process per area — which is what makes an area's failure nameable.
|
|
28
|
+
* A single process over a large polygon layer fails after several hundred thousand
|
|
29
|
+
* features because the h3 wasm heap fragments.
|
|
30
|
+
* This size stays well below that limit.
|
|
48
31
|
*/
|
|
49
32
|
export declare const DEFAULT_CHUNK_SIZE = 100000;
|
|
50
33
|
/**
|
|
51
|
-
* One survey area
|
|
34
|
+
* One survey area ready to build, with its geometry and tabular attributes.
|
|
52
35
|
*/
|
|
53
36
|
export interface SurveyAreaInput {
|
|
54
37
|
attributes: SurveyAreaAttributes;
|
|
55
38
|
/**
|
|
56
|
-
* The map-unit polygon shapefile.
|
|
39
|
+
* The path of the map-unit polygon shapefile.
|
|
57
40
|
*/
|
|
58
41
|
shapefilePath?: string;
|
|
59
42
|
/**
|
|
60
|
-
* The survey area's
|
|
43
|
+
* The survey area's outline.
|
|
61
44
|
*/
|
|
62
45
|
outline: ParsedGeometry;
|
|
63
46
|
/**
|
|
64
|
-
* An in-process feature source
|
|
65
|
-
*
|
|
47
|
+
* An in-process feature source, used by fixtures.
|
|
48
|
+
*
|
|
49
|
+
* The batched path builds one of these per chunk, so both paths share one implementation.
|
|
66
50
|
*/
|
|
67
51
|
source?: SoilFeatureSource;
|
|
68
52
|
/**
|
|
69
|
-
* The delineation count the shapefile declares, when the caller has already read it.
|
|
53
|
+
* The delineation count that the shapefile declares, when the caller has already read it.
|
|
70
54
|
*/
|
|
71
55
|
declaredFeatureCount?: number;
|
|
72
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Options for {@link buildSoilDatabase}.
|
|
59
|
+
*/
|
|
73
60
|
export interface BuildSoilOptions {
|
|
74
61
|
/**
|
|
75
|
-
* The survey areas to build, in
|
|
62
|
+
* The survey areas to build, in ingest order.
|
|
76
63
|
*/
|
|
77
64
|
areas: ReadonlyArray<SurveyAreaInput>;
|
|
78
65
|
/**
|
|
79
|
-
* The region the layer name
|
|
66
|
+
* The region code in the layer name, such as `ia`.
|
|
80
67
|
*/
|
|
81
68
|
region: string;
|
|
82
69
|
/**
|
|
83
|
-
*
|
|
70
|
+
* The path of the sealed artifact.
|
|
71
|
+
*
|
|
72
|
+
* The build writes a temporary file beside it and then swaps it in.
|
|
84
73
|
*/
|
|
85
|
-
out:
|
|
74
|
+
out: PathBuilderLike;
|
|
86
75
|
/**
|
|
87
|
-
* The refresh
|
|
76
|
+
* The survey refresh date, written to `layer_manifest.version` and `source_vintage`.
|
|
88
77
|
*/
|
|
89
78
|
sourceVintage: string;
|
|
90
79
|
buildCmd: string;
|
|
91
80
|
buildSHA: string;
|
|
92
81
|
/**
|
|
93
|
-
* ISO-8601, supplied by the caller
|
|
94
|
-
* makes two builds of the same inputs differ.
|
|
82
|
+
* The ISO-8601 creation time, supplied by the caller so that two builds of the same inputs are identical.
|
|
95
83
|
*/
|
|
96
84
|
createdAt: string;
|
|
97
85
|
/**
|
|
98
|
-
* The resolution the cell index and the reduction
|
|
86
|
+
* The H3 resolution of the cell index and the reduction.
|
|
99
87
|
*/
|
|
100
88
|
indexResolution: number;
|
|
101
89
|
/**
|
|
102
|
-
* The resolution `layer_coverage` rows
|
|
90
|
+
* The H3 resolution of the `layer_coverage` rows.
|
|
91
|
+
* It must be coarser than the index resolution.
|
|
103
92
|
*/
|
|
104
93
|
coverageResolution: number;
|
|
105
94
|
/**
|
|
106
|
-
*
|
|
95
|
+
* The number of delineation ids per chunk process.
|
|
96
|
+
* See {@link DEFAULT_CHUNK_SIZE}.
|
|
107
97
|
*/
|
|
108
98
|
chunkSize?: number;
|
|
109
99
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
100
|
+
* Whether to run the ingest in this process instead of in chunk processes.
|
|
101
|
+
*
|
|
102
|
+
* Only fixtures use it, because they have no shapefile for a child process to open.
|
|
112
103
|
*/
|
|
113
104
|
inProcess?: boolean;
|
|
114
105
|
onProgress?: (message: string) => void;
|
|
115
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* The counts and measurements that {@link buildSoilDatabase} reports.
|
|
109
|
+
*/
|
|
116
110
|
export interface BuildSoilResult {
|
|
117
111
|
out: string;
|
|
118
112
|
region: string;
|
|
@@ -125,28 +119,30 @@ export interface BuildSoilResult {
|
|
|
125
119
|
wholeCellRows: number;
|
|
126
120
|
partialCellRows: number;
|
|
127
121
|
/**
|
|
128
|
-
* `partialCellRows / (wholeCellRows + partialCellRows)` over the
|
|
129
|
-
*
|
|
122
|
+
* The value of `partialCellRows / (wholeCellRows + partialCellRows)` over the stored index rows.
|
|
123
|
+
*
|
|
124
|
+
* Whole cells are compacted, so this differs from the partial share used to choose the resolution.
|
|
130
125
|
*/
|
|
131
126
|
storedPartialShare: number;
|
|
132
127
|
capabilityCells: number;
|
|
133
128
|
/**
|
|
134
|
-
*
|
|
129
|
+
* The number of cells reduced with the sampling lattice instead of the whole-cell fast path.
|
|
135
130
|
*/
|
|
136
131
|
sampledCells: number;
|
|
137
132
|
/**
|
|
138
|
-
*
|
|
139
|
-
* out of a separate harness.
|
|
133
|
+
* The number of cells whose top class covers less than half the cell.
|
|
140
134
|
*/
|
|
141
135
|
topClassUnderHalfCells: number;
|
|
142
136
|
topClassUnderHalfShare: number;
|
|
143
137
|
/**
|
|
144
|
-
*
|
|
138
|
+
* The number of cells that the survey mapped but did not rate.
|
|
145
139
|
*/
|
|
146
140
|
classlessCells: number;
|
|
147
141
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
142
|
+
* The number of indexed cells that no lattice point landed in.
|
|
143
|
+
*
|
|
144
|
+
* These cells are dropped.
|
|
145
|
+
* A large count means the lattice is too coarse for the geometry.
|
|
150
146
|
*/
|
|
151
147
|
unsampledCells: number;
|
|
152
148
|
meanDelineationsPerCell: number;
|
|
@@ -154,28 +150,30 @@ export interface BuildSoilResult {
|
|
|
154
150
|
storedResolutions: number[];
|
|
155
151
|
coverageCells: number;
|
|
156
152
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
153
|
+
* The number of coverage cells inside a survey-area outline that no mapped delineation reached.
|
|
154
|
+
*
|
|
155
|
+
* SSURGO covers every part of a published area, so a large count means the outline
|
|
156
|
+
* and the delineations disagree.
|
|
160
157
|
*/
|
|
161
158
|
coverageCellsWithoutMapping: number;
|
|
162
159
|
/**
|
|
163
|
-
* The area
|
|
164
|
-
*
|
|
160
|
+
* The ring-area totals in square kilometers, compared with the published acreage.
|
|
161
|
+
*
|
|
162
|
+
* Its `known` count is the number of survey areas that publish an acreage.
|
|
165
163
|
*/
|
|
166
164
|
area: AreaAgreementReading;
|
|
167
165
|
sizeBytes: number;
|
|
168
166
|
}
|
|
169
167
|
/**
|
|
170
|
-
*
|
|
168
|
+
* Builds the soil layer.
|
|
171
169
|
*
|
|
172
|
-
* @throws {Error}
|
|
173
|
-
*
|
|
174
|
-
*
|
|
170
|
+
* @throws {Error} When the classifier rejects a delineation, when a streamed count
|
|
171
|
+
* differs from the shapefile's declared count, when the area total differs from the
|
|
172
|
+
* published acreage, or when the outlines contain no interior coverage cell.
|
|
175
173
|
*/
|
|
176
174
|
export declare function buildSoilDatabase(options: BuildSoilOptions): Promise<BuildSoilResult>;
|
|
177
175
|
/**
|
|
178
|
-
*
|
|
176
|
+
* The combined result of every ingest chunk.
|
|
179
177
|
*/
|
|
180
178
|
interface StreamResult {
|
|
181
179
|
delineations: number;
|
|
@@ -187,10 +185,9 @@ interface StreamResult {
|
|
|
187
185
|
allExteriorM2: number;
|
|
188
186
|
}
|
|
189
187
|
/**
|
|
190
|
-
*
|
|
188
|
+
* Sums the results of the ingest chunks.
|
|
191
189
|
*
|
|
192
|
-
*
|
|
193
|
-
* reach, and getting it wrong produces a well-formed artifact that under-reports how many delineations a cell holds.
|
|
190
|
+
* It is exported for a unit test because fixture builds do not exercise the batched path.
|
|
194
191
|
*/
|
|
195
192
|
export declare function aggregateChunks(chunks: ReadonlyArray<SoilChunkResult>): StreamResult;
|
|
196
193
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-soil.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"build-soil.d.ts","sourceRoot":"","sources":["../../sdk/build-soil.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAQN,KAAK,oBAAoB,EAEzB,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAMN,KAAK,cAAc,EACnB,MAAM,oBAAoB,CAAA;AAI3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,OAAO,KAAK,EAAE,iBAAiB,E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