@mailwoman/soil 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +118 -116
  2. package/lib/index.ts +66 -98
  3. package/lib/paths.ts +24 -0
  4. package/lib/schema.ts +188 -120
  5. package/lib/vocabulary.ts +40 -107
  6. package/out/index.d.ts +52 -70
  7. package/out/index.d.ts.map +1 -1
  8. package/out/index.js +24 -72
  9. package/out/index.js.map +1 -1
  10. package/out/paths.d.ts +19 -0
  11. package/out/paths.d.ts.map +1 -0
  12. package/out/paths.js +21 -0
  13. package/out/paths.js.map +1 -0
  14. package/out/schema.d.ts +187 -119
  15. package/out/schema.d.ts.map +1 -1
  16. package/out/schema.js +31 -31
  17. package/out/schema.js.map +1 -1
  18. package/out/sdk/acquire.d.ts +15 -24
  19. package/out/sdk/acquire.d.ts.map +1 -1
  20. package/out/sdk/acquire.js +6 -21
  21. package/out/sdk/acquire.js.map +1 -1
  22. package/out/sdk/build-soil.d.ts +67 -70
  23. package/out/sdk/build-soil.d.ts.map +1 -1
  24. package/out/sdk/build-soil.js +64 -94
  25. package/out/sdk/build-soil.js.map +1 -1
  26. package/out/sdk/cell-tiers.d.ts +7 -19
  27. package/out/sdk/cell-tiers.d.ts.map +1 -1
  28. package/out/sdk/cell-tiers.js +19 -38
  29. package/out/sdk/cell-tiers.js.map +1 -1
  30. package/out/sdk/cells.d.ts +15 -41
  31. package/out/sdk/cells.d.ts.map +1 -1
  32. package/out/sdk/cells.js +11 -38
  33. package/out/sdk/cells.js.map +1 -1
  34. package/out/sdk/client.d.ts +23 -48
  35. package/out/sdk/client.d.ts.map +1 -1
  36. package/out/sdk/client.js +19 -63
  37. package/out/sdk/client.js.map +1 -1
  38. package/out/sdk/download.d.ts +24 -47
  39. package/out/sdk/download.d.ts.map +1 -1
  40. package/out/sdk/download.js +14 -54
  41. package/out/sdk/download.js.map +1 -1
  42. package/out/sdk/ingest/chunk.d.ts +29 -25
  43. package/out/sdk/ingest/chunk.d.ts.map +1 -1
  44. package/out/sdk/ingest/chunk.js +18 -16
  45. package/out/sdk/ingest/chunk.js.map +1 -1
  46. package/out/sdk/ingest/worker.d.ts +9 -0
  47. package/out/sdk/ingest/worker.d.ts.map +1 -0
  48. package/out/{scripts/ingest-chunk.js → sdk/ingest/worker.js} +11 -10
  49. package/out/sdk/ingest/worker.js.map +1 -0
  50. package/out/sdk/ingest.d.ts +120 -0
  51. package/out/sdk/ingest.d.ts.map +1 -0
  52. package/out/sdk/ingest.js +127 -0
  53. package/out/sdk/ingest.js.map +1 -0
  54. package/out/sdk/measure-resolutions.d.ts +6 -17
  55. package/out/sdk/measure-resolutions.d.ts.map +1 -1
  56. package/out/sdk/measure-resolutions.js +4 -16
  57. package/out/sdk/measure-resolutions.js.map +1 -1
  58. package/out/sdk/reduce.d.ts +33 -59
  59. package/out/sdk/reduce.d.ts.map +1 -1
  60. package/out/sdk/reduce.js +47 -78
  61. package/out/sdk/reduce.js.map +1 -1
  62. package/out/sdk/survey-area.d.ts +16 -48
  63. package/out/sdk/survey-area.d.ts.map +1 -1
  64. package/out/sdk/survey-area.js +33 -77
  65. package/out/sdk/survey-area.js.map +1 -1
  66. package/out/sdk/tabular.d.ts +32 -31
  67. package/out/sdk/tabular.d.ts.map +1 -1
  68. package/out/sdk/tabular.js +57 -49
  69. package/out/sdk/tabular.js.map +1 -1
  70. package/out/sdk/test-kit.d.ts +57 -0
  71. package/out/sdk/test-kit.d.ts.map +1 -0
  72. package/out/{test-kit.js → sdk/test-kit.js} +18 -39
  73. package/out/sdk/test-kit.js.map +1 -0
  74. package/out/sdk/verify.d.ts +15 -51
  75. package/out/sdk/verify.d.ts.map +1 -1
  76. package/out/sdk/verify.js +19 -77
  77. package/out/sdk/verify.js.map +1 -1
  78. package/out/vocabulary.d.ts +37 -103
  79. package/out/vocabulary.d.ts.map +1 -1
  80. package/out/vocabulary.js +34 -107
  81. package/out/vocabulary.js.map +1 -1
  82. package/package.json +36 -190
  83. package/{lib/sdk → sdk}/acquire.ts +18 -28
  84. package/{lib/sdk → sdk}/build-soil.ts +113 -127
  85. package/{lib/sdk → sdk}/cell-tiers.ts +20 -39
  86. package/{lib/sdk → sdk}/cells.ts +17 -43
  87. package/sdk/client.ts +147 -0
  88. package/sdk/download.ts +131 -0
  89. package/{lib/sdk → sdk}/ingest/chunk.ts +35 -27
  90. package/{lib/scripts/ingest-chunk.ts → sdk/ingest/worker.ts} +10 -9
  91. package/sdk/ingest.ts +253 -0
  92. package/{lib/sdk → sdk}/measure-resolutions.ts +6 -17
  93. package/sdk/reduce.ts +344 -0
  94. package/{lib/sdk → sdk}/survey-area.ts +39 -83
  95. package/{lib/sdk → sdk}/tabular.ts +61 -52
  96. package/{lib → sdk}/test-kit.ts +19 -41
  97. package/{lib/sdk → sdk}/verify.ts +29 -85
  98. package/lib/sdk/client.ts +0 -184
  99. package/lib/sdk/download.ts +0 -161
  100. package/lib/sdk/index.ts +0 -20
  101. package/lib/sdk/ingest/index.ts +0 -278
  102. package/lib/sdk/reduce.ts +0 -375
  103. package/out/scripts/ingest-chunk.d.ts +0 -11
  104. package/out/scripts/ingest-chunk.d.ts.map +0 -1
  105. package/out/scripts/ingest-chunk.js.map +0 -1
  106. package/out/sdk/index.d.ts +0 -20
  107. package/out/sdk/index.d.ts.map +0 -1
  108. package/out/sdk/index.js +0 -20
  109. package/out/sdk/index.js.map +0 -1
  110. package/out/sdk/ingest/index.d.ts +0 -132
  111. package/out/sdk/ingest/index.d.ts.map +0 -1
  112. package/out/sdk/ingest/index.js +0 -170
  113. package/out/sdk/ingest/index.js.map +0 -1
  114. package/out/test-kit.d.ts +0 -79
  115. package/out/test-kit.d.ts.map +0 -1
  116. package/out/test-kit.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
package/out/sdk/index.js DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- * @file The acquisition + build surface for the NRCS SSURGO soil-capability layer. The READER is the
6
- * package root.
7
- */
8
- export * from "#sdk/acquire";
9
- export * from "#sdk/build-soil";
10
- export * from "#sdk/cell-tiers";
11
- export * from "#sdk/cells";
12
- export * from "#sdk/client";
13
- export * from "#sdk/download";
14
- export * from "#sdk/ingest/index";
15
- export * from "#sdk/measure-resolutions";
16
- export * from "#sdk/reduce";
17
- export * from "#sdk/survey-area";
18
- export * from "#sdk/tabular";
19
- export * from "#sdk/verify";
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA"}
@@ -1,132 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Read a survey area's published shapefiles as a stream of WGS84 delineations, through ogr2ogr.
7
- *
8
- * OGR IS BUILD TOOLING, NEVER A SERVE DEPENDENCY (SCOPE invariant 6). It converts the authority's geometry
9
- * into the structure the runtime probes, and nothing downstream of this module knows GDAL exists.
10
- *
11
- * THE SOURCE IS ALREADY IN WGS84, AND CHECKING IT IS STILL THE CHECK. Each `.prj` is an ESRI WKT reading
12
- * `GEOGCS["GCS_WGS_1984",…]`, which GDAL resolves to EPSG:4326 — so no reprojection is needed before H3.
13
- * The authority code is asserted anyway before a single feature is read, and the reprojected stream is
14
- * asserted against the layer's own declared extent, which is the check that catches a coordinate-order
15
- * mistake the projection check cannot see.
16
- *
17
- * THE DATUM GUARD RUNS EVEN THOUGH THE ANSWER IS THE IDENTITY, AND THAT IS THE POINT. PROJ substitutes a
18
- * ballpark datum shift SILENTLY when the accurate grid is missing — measured on the flood layer at 3.4 m
19
- * over an entire country, visible only as eight disagreements out of 59 against the authority's own
20
- * service. For an EPSG:4326 source `projinfo` answers `Null geographic offset from WGS 84 to WGS 84, 0 m,
21
- * World.` and the guard passes in one process. Skipping it on the reasoning that this source needs no
22
- * shift is how the guard comes to be missing on the day a source arrives that does.
23
- *
24
- * THE ID IS THE SHAPEFILE'S OWN FID, AND IT HAS TO BE, because SSURGO publishes no per-delineation key:
25
- * `MUKEY` names the MAP UNIT and one map unit has many delineations — `IA153` holds 17,966 delineations
26
- * across 152 map units. So `area_id` is `<areasymbol>:<fid>`, which is stable across runs and is what makes
27
- * a bounded chunk name the same features every time.
28
- */
29
- import { type MultiPolygonRings } from "@mailwoman/spatial";
30
- /**
31
- * The shapefile holding a survey area's map-unit polygons — the delineations this layer stores.
32
- */
33
- export declare function mapUnitShapefile(spatialDirectory: string, areaSymbol: string): string;
34
- /**
35
- * The shapefile holding a survey area's own OUTLINE. The footprint comes from HERE and never from the union of the
36
- * rated polygons — `NOTCOM` and access-denied map units are inside the footprint and carry no rating, so a footprint
37
- * derived from the rated set would report them as unmapped when the authority has declared exactly what they are.
38
- */
39
- export declare function surveyAreaShapefile(spatialDirectory: string, areaSymbol: string): string;
40
- /**
41
- * One map-unit delineation, reprojected to WGS84.
42
- */
43
- export interface SoilDelineation {
44
- /**
45
- * `<areasymbol>:<fid>`.
46
- */
47
- areaID: string;
48
- mukey: string;
49
- areasymbol: string;
50
- polygons: MultiPolygonRings;
51
- }
52
- /**
53
- * What a shapefile says about itself, read before any feature is.
54
- */
55
- export interface SoilSourceIdentity {
56
- epsg: number;
57
- featureCount: number;
58
- layer: string;
59
- /**
60
- * The layer's own declared extent, `[minLon, minLat, maxLon, maxLat]`.
61
- */
62
- bbox: readonly [number, number, number, number];
63
- }
64
- export interface SoilIngestOptions {
65
- shapefilePath: string;
66
- /**
67
- * Layer inside it. Defaults to the shapefile's base name, which is what the ESRI driver reports.
68
- */
69
- layer?: string;
70
- /**
71
- * The EPSG code the source must declare.
72
- */
73
- expectEPSG?: number;
74
- /**
75
- * Read only the shapefile's own FIDs in `[fidFrom, fidTo]`, inclusive — what makes a bounded chunk possible.
76
- */
77
- fidFrom?: number;
78
- fidTo?: number;
79
- /**
80
- * Stop after this many features. The fixture and smoke rungs use it; a full build does not set it.
81
- */
82
- limit?: number;
83
- }
84
- /**
85
- * Read what the shapefile declares about itself, and refuse a projection this ingest was not written for.
86
- *
87
- * @throws {Error} When the layer is missing, declares no EPSG authority code, declares one other than `expectEPSG`, or
88
- * reports no feature count.
89
- */
90
- export declare function readSoilSourceIdentity(options: SoilIngestOptions): Promise<SoilSourceIdentity>;
91
- /**
92
- * Stream the map-unit delineations as WGS84 features.
93
- *
94
- * Every feature is checked against the declared extent as it passes. A swapped coordinate order survives a projection
95
- * check — both axes are still numbers in a plausible range — and shows up here immediately.
96
- *
97
- * @throws {Error} When ogr2ogr fails, when a feature carries no geometry or no `MUKEY`, or when a vertex falls outside
98
- * the declared extent.
99
- */
100
- export declare function readSoilDelineations(options: SoilIngestOptions & {
101
- bbox: readonly [number, number, number, number];
102
- }): AsyncGenerator<SoilDelineation>;
103
- /**
104
- * Where a build's delineations come from, and what the source declares about itself.
105
- *
106
- * The builder takes ONE of these rather than a path, which is what makes the fixture rung possible: hand-built geometry
107
- * with no network and no GDAL still exercises the whole database half — the domain check, the cell classification, the
108
- * reduction, the coverage rows, the manifest and the seal.
109
- */
110
- export interface SoilFeatureSource {
111
- areaSymbol: string;
112
- /**
113
- * What the source says it holds. The build compares its own streamed total against this, so a short read throws
114
- * instead of building a smaller county.
115
- */
116
- declaredFeatureCount: number;
117
- layer: string;
118
- epsg: number;
119
- /**
120
- * A description of where these delineations came from, for the receipt.
121
- */
122
- origin: string;
123
- delineations: () => AsyncIterable<SoilDelineation>;
124
- }
125
- /**
126
- * One survey area's map-unit shapefile as a feature source — identity read up front, features streamed on demand.
127
- */
128
- export declare function createShapefileFeatureSource(options: SoilIngestOptions & {
129
- areaSymbol: string;
130
- declaredFeatureCount?: number;
131
- }): Promise<SoilFeatureSource>;
132
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/sdk/ingest/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAiD,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAsB1G;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAErF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAExF;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,iBAAiB,CAAA;CAC3B;AAED;;GAEG;AAC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,GAChF,OAAO,CAAC,iBAAiB,CAAC,CAiB5B"}
@@ -1,170 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Read a survey area's published shapefiles as a stream of WGS84 delineations, through ogr2ogr.
7
- *
8
- * OGR IS BUILD TOOLING, NEVER A SERVE DEPENDENCY (SCOPE invariant 6). It converts the authority's geometry
9
- * into the structure the runtime probes, and nothing downstream of this module knows GDAL exists.
10
- *
11
- * THE SOURCE IS ALREADY IN WGS84, AND CHECKING IT IS STILL THE CHECK. Each `.prj` is an ESRI WKT reading
12
- * `GEOGCS["GCS_WGS_1984",…]`, which GDAL resolves to EPSG:4326 — so no reprojection is needed before H3.
13
- * The authority code is asserted anyway before a single feature is read, and the reprojected stream is
14
- * asserted against the layer's own declared extent, which is the check that catches a coordinate-order
15
- * mistake the projection check cannot see.
16
- *
17
- * THE DATUM GUARD RUNS EVEN THOUGH THE ANSWER IS THE IDENTITY, AND THAT IS THE POINT. PROJ substitutes a
18
- * ballpark datum shift SILENTLY when the accurate grid is missing — measured on the flood layer at 3.4 m
19
- * over an entire country, visible only as eight disagreements out of 59 against the authority's own
20
- * service. For an EPSG:4326 source `projinfo` answers `Null geographic offset from WGS 84 to WGS 84, 0 m,
21
- * World.` and the guard passes in one process. Skipping it on the reasoning that this source needs no
22
- * shift is how the guard comes to be missing on the day a source arrives that does.
23
- *
24
- * THE ID IS THE SHAPEFILE'S OWN FID, AND IT HAS TO BE, because SSURGO publishes no per-delineation key:
25
- * `MUKEY` names the MAP UNIT and one map unit has many delineations — `IA153` holds 17,966 delineations
26
- * across 152 map units. So `area_id` is `<areasymbol>:<fid>`, which is stable across runs and is what makes
27
- * a bounded chunk name the same features every time.
28
- */
29
- import { declaredFeatureCount } from "@mailwoman/core/layers";
30
- import { assertRingsInsideExtent, requireArealPolygons } from "@mailwoman/spatial";
31
- import { readOGRLayerIdentity } from "@mailwoman/spatial/tools/ogr";
32
- import { ogr2ogrGeoJSONSeq } from "@mailwoman/spatial/tools/ogr-stream";
33
- import { basename, join } from "path-ts";
34
- import { SSURGO_SOURCE_EPSG } from "#vocabulary";
35
- /**
36
- * Coordinate decimals ogr2ogr writes into the stream. Nine is well past the source's own precision — the metadata
37
- * states compilation to base maps meeting National Map Accuracy Standards at 1 inch = 1,000 feet — and is chosen so the
38
- * round trip contributes nothing measurable to the area cross-check.
39
- */
40
- const COORDINATE_PRECISION = 9;
41
- /**
42
- * How far outside the layer's declared extent a vertex may fall before the ingest refuses.
43
- *
44
- * A tenth of a degree is about 11 km — small enough that an unprojected or axis-swapped read, which lands whole
45
- * hemispheres away, still fails, and loose enough that a rounded declared extent is not brittle.
46
- */
47
- const BBOX_MARGIN_DEGREES = 0.1;
48
- /**
49
- * The shapefile holding a survey area's map-unit polygons — the delineations this layer stores.
50
- */
51
- export function mapUnitShapefile(spatialDirectory, areaSymbol) {
52
- return join(spatialDirectory, `soilmu_a_${areaSymbol.toLowerCase()}.shp`);
53
- }
54
- /**
55
- * The shapefile holding a survey area's own OUTLINE. The footprint comes from HERE and never from the union of the
56
- * rated polygons — `NOTCOM` and access-denied map units are inside the footprint and carry no rating, so a footprint
57
- * derived from the rated set would report them as unmapped when the authority has declared exactly what they are.
58
- */
59
- export function surveyAreaShapefile(spatialDirectory, areaSymbol) {
60
- return join(spatialDirectory, `soilsa_a_${areaSymbol.toLowerCase()}.shp`);
61
- }
62
- /**
63
- * Read what the shapefile declares about itself, and refuse a projection this ingest was not written for.
64
- *
65
- * @throws {Error} When the layer is missing, declares no EPSG authority code, declares one other than `expectEPSG`, or
66
- * reports no feature count.
67
- */
68
- export async function readSoilSourceIdentity(options) {
69
- const identity = await readOGRLayerIdentity({
70
- path: options.shapefilePath,
71
- layer: options.layer ?? basename(options.shapefilePath, ".shp"),
72
- expectEPSG: options.expectEPSG ?? SSURGO_SOURCE_EPSG,
73
- context: "soil ingest",
74
- requireExtent: true,
75
- messages: {
76
- noAuthorityCode: "the projection cannot be checked, and reading one datum's coordinates as another's is silent",
77
- epsgMismatch: "SSURGO publishes geographic WGS84, so a different code is a product change rather than a variation to absorb",
78
- },
79
- });
80
- return { epsg: identity.epsg, featureCount: identity.featureCount, layer: identity.layer, bbox: identity.extent };
81
- }
82
- /**
83
- * The ingest's `SELECT`, with the FID range applied when one is asked for.
84
- */
85
- function delineationSelectSQL(layer, options) {
86
- const select = `SELECT FID AS fid, MUKEY AS mukey, AREASYMBOL AS areasymbol FROM "${layer}"`;
87
- const bounds = [];
88
- if (options.fidFrom !== undefined) {
89
- bounds.push(`FID >= ${options.fidFrom}`);
90
- }
91
- if (options.fidTo !== undefined) {
92
- bounds.push(`FID <= ${options.fidTo}`);
93
- }
94
- return bounds.length ? `${select} WHERE ${bounds.join(" AND ")}` : select;
95
- }
96
- /**
97
- * Stream the map-unit delineations as WGS84 features.
98
- *
99
- * Every feature is checked against the declared extent as it passes. A swapped coordinate order survives a projection
100
- * check — both axes are still numbers in a plausible range — and shows up here immediately.
101
- *
102
- * @throws {Error} When ogr2ogr fails, when a feature carries no geometry or no `MUKEY`, or when a vertex falls outside
103
- * the declared extent.
104
- */
105
- export async function* readSoilDelineations(options) {
106
- const layer = options.layer ?? basename(options.shapefilePath, ".shp");
107
- const [minLon, minLat, maxLon, maxLat] = options.bbox;
108
- const args = [
109
- "-f",
110
- "GeoJSONSeq",
111
- "/vsistdout/",
112
- // The OUTPUT projection. `expectEPSG` is the assertion `readSoilSourceIdentity` makes about the SOURCE and is not
113
- // the same thing: the consumer reads WGS84, whatever the shapefile declares.
114
- "-t_srs",
115
- "EPSG:4326",
116
- "-lco",
117
- `COORDINATE_PRECISION=${COORDINATE_PRECISION}`,
118
- ...(options.limit === undefined ? [] : ["-limit", String(options.limit)]),
119
- "-sql",
120
- delineationSelectSQL(layer, options),
121
- options.shapefilePath,
122
- ];
123
- for await (const raw of ogr2ogrGeoJSONSeq(args, "soil ingest")) {
124
- yield toDelineation(raw, { minLon, minLat, maxLon, maxLat });
125
- }
126
- }
127
- /**
128
- * Validate one raw GeoJSON feature and narrow it. Split out so the generator body stays a loop.
129
- */
130
- function toDelineation(raw, extent) {
131
- const { properties, geometry } = raw;
132
- if (!geometry) {
133
- throw new Error(`soil ingest: delineation ${properties.fid} carries no geometry`);
134
- }
135
- if (properties.mukey === null || properties.mukey === "") {
136
- throw new Error(`soil ingest: delineation ${properties.fid} carries no MUKEY — a delineation with no map unit joins to nothing and would read downstream as unmapped ground`);
137
- }
138
- if (!properties.areasymbol) {
139
- throw new Error(`soil ingest: delineation ${properties.fid} carries no AREASYMBOL`);
140
- }
141
- const polygons = requireArealPolygons(geometry, `delineation ${properties.fid}`, "soil ingest");
142
- assertRingsInsideExtent(polygons, `delineation ${properties.fid}`, extent, BBOX_MARGIN_DEGREES, "soil ingest");
143
- return {
144
- areaID: `${properties.areasymbol}:${properties.fid}`,
145
- mukey: String(properties.mukey),
146
- areasymbol: properties.areasymbol,
147
- polygons,
148
- };
149
- }
150
- /**
151
- * One survey area's map-unit shapefile as a feature source — identity read up front, features streamed on demand.
152
- */
153
- export async function createShapefileFeatureSource(options) {
154
- const identity = await readSoilSourceIdentity(options);
155
- return {
156
- areaSymbol: options.areaSymbol,
157
- // A RANGE's own count is supplied by the caller, because `ogrinfo` reports the layer's total and nothing narrower.
158
- // The whole-file total is still checked: the builder sums what its chunks streamed and compares that.
159
- declaredFeatureCount: declaredFeatureCount({
160
- declared: options.declaredFeatureCount,
161
- limit: options.limit,
162
- layerCount: identity.featureCount,
163
- }),
164
- layer: identity.layer,
165
- epsg: identity.epsg,
166
- origin: options.shapefilePath,
167
- delineations: () => readSoilDelineations({ ...options, bbox: identity.bbox }),
168
- };
169
- }
170
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/sdk/ingest/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,oBAAoB,E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AAI,UAAU,CAAC,GAAG,EAAE;QACpD,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;QAC/B,UAAU,EAAE,UAAU,CAAC,UAAU;QACjC,QAAQ;KACR,CAAA;AACF,CAAC;AAyBD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CACjD,OAAkF;IAElF,MAAM,QAAQ,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,CAAA;IAEtD,OAAO;QACN,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,mHAAmH;QACnH,sGAAsG;QACtG,oBAAoB,EAAE,oBAAoB,CAAC;YAC1C,QAAQ,EAAE,OAAO,CAAC,oBAAoB;YACtC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,UAAU,EAAE,QAAQ,CAAC,YAAY;SACjC,CAAC;QACF,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,MAAM,EAAE,OAAO,CAAC,aAAa;QAC7B,YAAY,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;KAC7E,CAAA;AACF,CAAC"}
package/out/test-kit.d.ts DELETED
@@ -1,79 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Hand-built survey areas for the fixture rung: geometry, attributes and an outline, with no network and
7
- * no GDAL in the loop.
8
- *
9
- * A FIXTURE RUNG THAT COULD ONLY RUN THROUGH ogr2ogr WOULD TEST THE CONVERSION ON THE MACHINES THAT HAVE
10
- * IT AND NOTHING AT ALL ON THE ONES THAT DO NOT. What these fixtures exercise is the whole database half —
11
- * the declared-domain check, the cell classification, the area-weighted reduction, the four absence
12
- * shares, the coverage rows, the manifest and the seal.
13
- *
14
- * THE ABSENCE CASES ARE THE POINT, AND IOWA HAS NONE OF THEM. Every Iowa survey area is fully digitized,
15
- * so `NOTCOM`, `NOTPUB` and access-denied map units never appear in the live build — which means the only
16
- * place `nodata_share` can be exercised is here. The same is true of a component whose rating is NULL for
17
- * the not-rateable reason and of a class-8 rating: both exist in Iowa but sparsely, and a fixture pins the
18
- * behaviour rather than hoping a county contains one.
19
- */
20
- import type { SoilComponentTable, SoilMapUnitTable } from "#schema";
21
- import type { SoilDelineation, SoilFeatureSource } from "#sdk/ingest/index";
22
- import type { SurveyAreaAttributes } from "#sdk/survey-area";
23
- /**
24
- * Re-exported so a fixture in another workspace builds its rings the same way this one does.
25
- */
26
- /**
27
- * Where the fixture geometry sits — central Iowa, so the cells it produces are the ones a real build would use.
28
- */
29
- export declare const FIXTURE_ORIGIN: {
30
- lat: number;
31
- lon: number;
32
- };
33
- /**
34
- * Degrees per fixture square side. About 1.6 km at this latitude — several resolution-9 cells across, so a fixture
35
- * square has both an interior and a fringe.
36
- */
37
- export declare const FIXTURE_SIDE = 0.015;
38
- /**
39
- * The fixture map units. Each one exists to exercise exactly one reading.
40
- */
41
- export declare function fixtureMapUnits(areaSymbol?: string): SoilMapUnitTable[];
42
- /**
43
- * The fixture components. `mu-mixed` is 45/35/20 across three classes, which is the case a winner-class schema would
44
- * report as "class 2" and this one reports as a mixture.
45
- */
46
- export declare function fixtureComponents(): SoilComponentTable[];
47
- /**
48
- * The declared domains a fixture build validates and stores, matching what the real `msdomdet.txt` ships.
49
- */
50
- export declare function fixtureDomains(): SurveyAreaAttributes["domains"];
51
- /**
52
- * The fixture delineations: a mixed square, a class-8 square, a water square, an unrated square, and a `NOTCOM` square,
53
- * laid out left to right so each occupies its own ground.
54
- */
55
- export declare function fixtureDelineations(areaSymbol?: string): SoilDelineation[];
56
- /**
57
- * The outline covering every fixture delineation, with margin — the survey area's own footprint.
58
- *
59
- * The margin is nearly a degree because the coverage test is CONSERVATIVE: `interiorCoverageCellSet` keeps only cells
60
- * lying wholly inside the outline, and a resolution-6 cell is about 36 km across. An outline the size of the fixture
61
- * squares yields zero interior cells and the build refuses — correctly, since an artifact with no coverage rows answers
62
- * unknown everywhere while reporting success.
63
- */
64
- export declare function fixtureOutline(margin?: number): {
65
- type: "Polygon";
66
- coordinates: number[][][];
67
- };
68
- /**
69
- * A feature source over hand-built delineations.
70
- */
71
- export declare function fixtureSource(delineations: SoilDelineation[], areaSymbol?: string): SoilFeatureSource;
72
- /**
73
- * One fixture survey area's attributes.
74
- *
75
- * `areaAcres` is left NULL on purpose: the area cross-check compares against what the AUTHORITY publishes, and a
76
- * fixture that invented an acreage would be checking this package's arithmetic against itself.
77
- */
78
- export declare function fixtureAttributes(areaSymbol?: string): SurveyAreaAttributes;
79
- //# sourceMappingURL=test-kit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-kit.d.ts","sourceRoot":"","sources":["../lib/test-kit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;IAAK,GAAG;IAAQ,GAAG;CAAS,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAQ,CAAA;AAEjC;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,SAAU,GAAG,gBAAgB,EAAE,CAoExE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,kBAAkB,EAAE,CAaxD;AAwBD;;GAEG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAAC,SAAS,CAAC,CAiBhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,SAAU,GAAG,eAAe,EAAE,CAU3E;AAED;;;;;;;GAOG;AACH,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