@mailwoman/soil 10.2.2 → 10.4.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 +24 -22
- package/lib/schema.ts +3 -3
- package/out/schema.d.ts +3 -3
- package/out/sdk/cells.d.ts +1 -1
- package/out/sdk/tabular.d.ts +1 -1
- package/package.json +5 -5
- package/sdk/cells.ts +1 -1
- package/sdk/tabular.ts +1 -1
package/README.md
CHANGED
|
@@ -40,12 +40,12 @@ The layer never represents an absence with a small number. A consumer can tell a
|
|
|
40
40
|
| there is no survey here at all | **no `layer_coverage` row, and no summary row** |
|
|
41
41
|
|
|
42
42
|
Class 8 is a determination and is a class share like any other. A merge with the absence readings
|
|
43
|
-
produces a well-formed wrong answer, and 67,547 national components
|
|
43
|
+
produces a well-formed wrong answer, and 67,547 national components have class 8. The irrigated rating shows
|
|
44
44
|
the same problem at a larger scale. `irrcapcl` is NULL on 85.1% of national components because it is
|
|
45
45
|
populated only where irrigation is a considered use, so the layer stores it and never reduces it.
|
|
46
46
|
|
|
47
|
-
`other_share`
|
|
48
|
-
see how much was folded away without inferring it from a gap. `mapped_share`
|
|
47
|
+
`other_share` holds the truncated minority tail, so the five shares always sum to 1, and a reader can
|
|
48
|
+
see how much was folded away without inferring it from a gap. `mapped_share` records how much of the cell
|
|
49
49
|
any delineation covers. Without it, the unmapped remainder of a cell at a survey-area edge would silently
|
|
50
50
|
shrink every class share.
|
|
51
51
|
|
|
@@ -68,12 +68,12 @@ complete.** Flood polygons are large relative to their cells, so most cells fall
|
|
|
68
68
|
saves almost no space. At resolution 9, 369 whole cells compact to 315, a 14.6% reduction, while the flood
|
|
69
69
|
layer's interiors collapse by orders of magnitude. At resolution 7 there are zero whole cells to collapse.
|
|
70
70
|
|
|
71
|
-
For that reason this layer
|
|
71
|
+
For that reason this layer stores the reduced `soil_capability_cell` **alongside** the index instead of
|
|
72
72
|
relying on the index the way the flood layer can. The unsimplified geometry is still stored,
|
|
73
73
|
and the reduction weights by it, but probes are answered from the reduced table.
|
|
74
74
|
|
|
75
75
|
**The two numbers move in opposite directions, and only one of them distinguishes the candidates.** The
|
|
76
|
-
`partial` share is 87–100% at every candidate, so it cannot select a resolution here
|
|
76
|
+
`partial` share is 87–100% at every candidate, so it cannot select a resolution here. That inability is itself
|
|
77
77
|
a finding. The mixture number can select one, and the choice rests on it.
|
|
78
78
|
|
|
79
79
|
**Resolution 9 is the choice.** `poi.db` keys its rows at resolution 9, so a reader that already holds
|
|
@@ -84,7 +84,7 @@ against 2.7% at resolution 9. Resolution 11 was excluded before measuring, becau
|
|
|
84
84
|
`IA153`'s delineations smaller than a cell at roughly 49× the resolution-9 cell count.
|
|
85
85
|
|
|
86
86
|
For comparison, NRCS's own map-unit-grain `niccdcdpct` reads below half on 3.3% of national map units.
|
|
87
|
-
Aggregation to a resolution-9 cell multiplies that roughly ninefold
|
|
87
|
+
Aggregation to a resolution-9 cell multiplies that roughly ninefold. That factor quantifies the cost of the cell
|
|
88
88
|
grain.
|
|
89
89
|
|
|
90
90
|
## Acquisition
|
|
@@ -103,36 +103,38 @@ The code handles three measured behaviors:
|
|
|
103
103
|
2. **The download host answers `HEAD` with 405 and ignores `Range`.** A request with `Range: bytes=0-0`
|
|
104
104
|
returned HTTP 200 and transferred the whole 27,598,377 bytes. Freshness comes from
|
|
105
105
|
`sacatalog.saverest`, which the archive's filename also embeds. A wrong date returns HTTP **400** (and never 404).
|
|
106
|
-
3. **The tabular export
|
|
106
|
+
3. **The tabular export contains embedded newlines.** `sacatlog.txt` holds 594 newline bytes and exactly
|
|
107
107
|
one record, because `fgdcmetadata` is a 43,251-character XML document. `mstabcol.txt`, the column
|
|
108
108
|
dictionary itself, holds 913 newlines and 865 records. The reader is quote-aware throughout.
|
|
109
109
|
|
|
110
110
|
**The archive ships its own schema and its own vocabulary.** `mstab.txt` maps a logical table to the file
|
|
111
111
|
that holds it (`component` → `comp.txt`, which cannot be guessed). `mstabcol.txt` gives every column's
|
|
112
|
-
position. `msdomdet.txt`
|
|
112
|
+
position. `msdomdet.txt` lists each `Choice` column's declared members **with NRCS's own prose
|
|
113
113
|
definition**: capability classes 1 through 8, subclasses `c`/`e`/`s`/`w`, the 28 conditional farmland
|
|
114
114
|
classifications, and the six component kinds. The layer reads its domain from the file it ingested instead
|
|
115
115
|
of transcribing it, stores it in `soil_vocabulary`, and throws on a value outside it.
|
|
116
116
|
|
|
117
117
|
## License, and where the grant comes from
|
|
118
118
|
|
|
119
|
-
data.gov's entry
|
|
119
|
+
data.gov's entry links `usa.gov/publicdomain/label/1.0/`, which redirects to a page that declines to
|
|
120
120
|
make a blanket grant and tells the reader to check with the agency. The strongest available agency
|
|
121
|
-
statement is **the FGDC metadata that NRCS ships inside every archive**, and its use constraints
|
|
121
|
+
statement is **the FGDC metadata that NRCS ships inside every archive**, and its use constraints field holds this sentence:
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
```text
|
|
124
|
+
This is public information and may be interpreted by organizations, agencies, units of government, or
|
|
125
|
+
others based on needs; however, they are responsible for the appropriate application.
|
|
126
|
+
```
|
|
125
127
|
|
|
126
128
|
The build asserts that the sentence is present **per survey area**. If an area's use constraints no longer
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
contain it, the license has changed, and a build that accepted the change would ship an artifact under terms
|
|
130
|
+
that no reviewer checked. The acknowledgement that the same metadata requests is stored in
|
|
129
131
|
`layer_manifest.attribution`: _U.S. Department of Agriculture, Natural Resources Conservation Service._
|
|
130
132
|
|
|
131
133
|
## Two dates, and they are not the same fact
|
|
132
134
|
|
|
133
135
|
`sacatalog.saverest` is the refresh date. NRCS runs one coordinated Annual Soils Refresh each October 1.
|
|
134
136
|
The catalogue grouped by year returns 2016: 1, 2025: 3,323, 2026: 56, so a region's areas share a
|
|
135
|
-
vintage. **The field survey underneath is far older.** `IA153`
|
|
137
|
+
vintage. **The field survey underneath is far older.** `IA153` has a 2025-09-09 refresh over a
|
|
136
138
|
_Soil Survey of Polk County, Iowa_ published in **1960** at 1:15,840, and the dataset's own
|
|
137
139
|
time-period-of-content ends at the refresh. A consumer that reads the refresh date as the survey date is
|
|
138
140
|
wrong by sixty-five years.
|
|
@@ -150,18 +152,18 @@ and never
|
|
|
150
152
|
|
|
151
153
|
> this land can (or cannot) be farmed.
|
|
152
154
|
|
|
153
|
-
The metadata NRCS ships
|
|
155
|
+
The metadata NRCS ships rules the second reading is wrong. It states that the data "do not eliminate the need for
|
|
154
156
|
onsite sampling, testing, and detailed study of specific sites for intensive uses. Thus, these data and
|
|
155
|
-
their interpretations are intended for planning purposes only." Every reading
|
|
157
|
+
their interpretations are intended for planning purposes only." Every reading is subject to the product's own
|
|
156
158
|
limits for that reason.
|
|
157
159
|
|
|
158
160
|
**The farmland vocabulary is conditional, and two of its categories mean different things in different
|
|
159
|
-
states.** 24 of its 28 declared values
|
|
161
|
+
states.** 24 of its 28 declared values contain an "if", such as `Prime farmland if drained` and `Prime
|
|
160
162
|
farmland if irrigated and reclaimed of excess salts and sodium`. The layer therefore stores the string
|
|
161
163
|
whole, because a boolean `arable` column would be this layer's invention. 7 CFR 657.5 defines prime and
|
|
162
164
|
unique farmland nationally, while §657.5(c) and (d) assign statewide and local importance to state and
|
|
163
165
|
local agencies. `Farmland of statewide importance` in Iowa and in Georgia are therefore different claims.
|
|
164
|
-
`soil_map_unit.farmland_scope`
|
|
166
|
+
`soil_map_unit.farmland_scope` stores that distinction into the artifact.
|
|
165
167
|
|
|
166
168
|
## Build
|
|
167
169
|
|
|
@@ -192,7 +194,7 @@ vertex. A point a centimeter from a long edge can be meters from every vertex, a
|
|
|
192
194
|
near-miss measured 1.58 m to vertices and 0.009 m to edges.
|
|
193
195
|
|
|
194
196
|
The negative half samples points in every neighboring state, two of them close to the Iowa border, and
|
|
195
|
-
requires `unknown` with no coverage row. A low-capability reading fails the check.
|
|
197
|
+
requires `unknown` with no coverage row. A low-capability reading fails the check. A check with only the positive half would pass
|
|
196
198
|
on an artifact that answered class 8 for the whole planet.
|
|
197
199
|
|
|
198
200
|
## The observation
|
|
@@ -216,8 +218,8 @@ that a geocode without the layer is byte-identical to one with it, apart from th
|
|
|
216
218
|
tooling. Whoever builds it will face a reversed meaning of zero in the source's own encoding. The
|
|
217
219
|
derived Crop Frequency Layer's value domain runs from `"1"` (planted once in 18 years) through `"18"`
|
|
218
220
|
(planted every year), then **`"255"` means planted zero times**, while **`"0"` is No Data**. A reader
|
|
219
|
-
that takes 0 as "never planted" reads _we have no data here_ as _no crop was ever grown here_
|
|
220
|
-
the opposite of the truth. This vocabulary uses no numeric sentinel for either state and should not
|
|
221
|
+
that takes 0 as "never planted" reads _we have no data here_ as _no crop was ever grown here_. That reading
|
|
222
|
+
is the opposite of the truth. This vocabulary uses no numeric sentinel for either state and should not
|
|
221
223
|
start.
|
|
222
224
|
- **The layer computes no suitability score.** It repeats what an authority states, in the authority's
|
|
223
225
|
vocabulary, with the authority's dates. The consumer converts that value into a number.
|
package/lib/schema.ts
CHANGED
|
@@ -67,7 +67,7 @@ export interface SoilMapUnitAreaTable {
|
|
|
67
67
|
* SSURGO publishes no per-delineation key.
|
|
68
68
|
* `mukey` identifies the map unit.
|
|
69
69
|
*
|
|
70
|
-
*
|
|
70
|
+
* A map unit can have more than one delineation.
|
|
71
71
|
* The ordinal distinguishes each delineation row.
|
|
72
72
|
*
|
|
73
73
|
* Text allows the source to publish a non-numeric ID without a schema change.
|
|
@@ -145,7 +145,7 @@ export interface SoilMapUnitTable {
|
|
|
145
145
|
*/
|
|
146
146
|
niccdcd: string | null
|
|
147
147
|
/**
|
|
148
|
-
* The share that class
|
|
148
|
+
* The share that class covers.
|
|
149
149
|
*
|
|
150
150
|
* The pair is the pattern this layer's cell reduction reproduces at cell grain,
|
|
151
151
|
* so carrying both makes the two comparable.
|
|
@@ -280,7 +280,7 @@ export interface SoilCapabilityCellTable {
|
|
|
280
280
|
*/
|
|
281
281
|
weighting: string
|
|
282
282
|
/**
|
|
283
|
-
*
|
|
283
|
+
* The count of delineations that reached this cell.
|
|
284
284
|
*
|
|
285
285
|
* Supplies the denominator behind each share above.
|
|
286
286
|
* It also distinguishes a single-delineation cell from a crowded cell.
|
package/out/schema.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export interface SoilMapUnitAreaTable {
|
|
|
58
58
|
* SSURGO publishes no per-delineation key.
|
|
59
59
|
* `mukey` identifies the map unit.
|
|
60
60
|
*
|
|
61
|
-
*
|
|
61
|
+
* A map unit can have more than one delineation.
|
|
62
62
|
* The ordinal distinguishes each delineation row.
|
|
63
63
|
*
|
|
64
64
|
* Text allows the source to publish a non-numeric ID without a schema change.
|
|
@@ -134,7 +134,7 @@ export interface SoilMapUnitTable {
|
|
|
134
134
|
*/
|
|
135
135
|
niccdcd: string | null;
|
|
136
136
|
/**
|
|
137
|
-
* The share that class
|
|
137
|
+
* The share that class covers.
|
|
138
138
|
*
|
|
139
139
|
* The pair is the pattern this layer's cell reduction reproduces at cell grain,
|
|
140
140
|
* so carrying both makes the two comparable.
|
|
@@ -267,7 +267,7 @@ export interface SoilCapabilityCellTable {
|
|
|
267
267
|
*/
|
|
268
268
|
weighting: string;
|
|
269
269
|
/**
|
|
270
|
-
*
|
|
270
|
+
* The count of delineations that reached this cell.
|
|
271
271
|
*
|
|
272
272
|
* Supplies the denominator behind each share above.
|
|
273
273
|
* It also distinguishes a single-delineation cell from a crowded cell.
|
package/out/sdk/cells.d.ts
CHANGED
package/out/sdk/tabular.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/soil",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.4.0",
|
|
4
4
|
"description": "USDA NRCS SSURGO soil capability — acquisition, build, and the soil.db layer reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"farmland",
|
|
@@ -107,13 +107,13 @@
|
|
|
107
107
|
"test": "vitest run"
|
|
108
108
|
},
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@mailwoman/core": "10.
|
|
111
|
-
"@mailwoman/spatial": "10.
|
|
112
|
-
"@mailwoman/sqlite": "10.
|
|
110
|
+
"@mailwoman/core": "10.4.0",
|
|
111
|
+
"@mailwoman/spatial": "10.4.0",
|
|
112
|
+
"@mailwoman/sqlite": "10.4.0",
|
|
113
113
|
"h3-js": "^4.5.0",
|
|
114
114
|
"kysely": "^0.29.6",
|
|
115
115
|
"path-ts": "^2.5.0",
|
|
116
|
-
"spliterator": "^9.2.
|
|
116
|
+
"spliterator": "^9.2.1"
|
|
117
117
|
},
|
|
118
118
|
"engines": {
|
|
119
119
|
"node": ">=24.18.0"
|
package/sdk/cells.ts
CHANGED
package/sdk/tabular.ts
CHANGED