@mailwoman/soil 10.0.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -116
- package/lib/index.ts +88 -113
- package/lib/paths.ts +24 -0
- package/lib/schema.ts +189 -134
- package/lib/vocabulary.ts +40 -107
- package/out/index.d.ts +59 -77
- package/out/index.d.ts.map +1 -1
- package/out/index.js +38 -79
- 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 +183 -132
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js +32 -32
- 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 +6 -21
- 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 +67 -97
- 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 +21 -40
- 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 +24 -49
- package/out/sdk/client.d.ts.map +1 -1
- package/out/sdk/client.js +20 -64
- 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 +15 -55
- package/out/sdk/download.js.map +1 -1
- package/out/sdk/ingest/chunk.d.ts +29 -25
- package/out/sdk/ingest/chunk.d.ts.map +1 -1
- package/out/sdk/ingest/chunk.js +18 -16
- package/out/sdk/ingest/chunk.js.map +1 -1
- 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} +15 -14
- package/out/sdk/ingest/worker.js.map +1 -0
- package/out/sdk/ingest.d.ts +122 -0
- package/out/sdk/ingest.d.ts.map +1 -0
- package/out/sdk/ingest.js +127 -0
- package/out/sdk/ingest.js.map +1 -0
- package/out/sdk/measure-resolutions.d.ts +6 -17
- package/out/sdk/measure-resolutions.d.ts.map +1 -1
- package/out/sdk/measure-resolutions.js +4 -16
- 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 +48 -79
- 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 +35 -79
- 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 +57 -49
- 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 +17 -53
- package/out/sdk/verify.d.ts.map +1 -1
- package/out/sdk/verify.js +27 -85
- 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 +37 -191
- package/{lib/sdk → sdk}/acquire.ts +18 -28
- package/{lib/sdk → sdk}/build-soil.ts +116 -130
- package/{lib/sdk → sdk}/cell-tiers.ts +22 -41
- package/{lib/sdk → sdk}/cells.ts +17 -43
- package/sdk/client.ts +147 -0
- package/sdk/download.ts +131 -0
- package/{lib/sdk → sdk}/ingest/chunk.ts +35 -27
- package/{lib/scripts/ingest-chunk.ts → sdk/ingest/worker.ts} +14 -13
- package/sdk/ingest.ts +255 -0
- package/{lib/sdk → sdk}/measure-resolutions.ts +6 -17
- package/sdk/reduce.ts +344 -0
- package/{lib/sdk → sdk}/survey-area.ts +49 -88
- package/{lib/sdk → sdk}/tabular.ts +61 -52
- package/{lib → sdk}/test-kit.ts +19 -41
- package/sdk/verify.ts +313 -0
- 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/index.ts +0 -278
- package/lib/sdk/reduce.ts +0 -375
- package/lib/sdk/verify.ts +0 -369
- 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/index.d.ts +0 -132
- package/out/sdk/ingest/index.d.ts.map +0 -1
- package/out/sdk/ingest/index.js +0 -170
- package/out/sdk/ingest/index.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/index.js
CHANGED
|
@@ -3,42 +3,9 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* THREE ANSWERS, AND KEEPING THEM APART IS THE WHOLE JOB.
|
|
9
|
-
*
|
|
10
|
-
* 1. `designated` — the survey mapped this location and the cell's class distribution is the answer.
|
|
11
|
-
* 2. `designated_no_rating` — the survey mapped this location and rated nothing there. A cell that is
|
|
12
|
-
* 100% `unrated_share` or `notrateable_share` is `designated`-complete and carries no capability
|
|
13
|
-
* reading whatsoever, and that is not a corner case: 17.1% of national components carry no capability
|
|
14
|
-
* rating.
|
|
15
|
-
* 3. `unknown` — no coverage row. Outside any published survey area, or inside one where the polygon
|
|
16
|
-
* exists and the soil mapping behind it does not.
|
|
17
|
-
*
|
|
18
|
-
* READINGS 2 AND 3 LOOK THE SAME FROM A CLASS CODE AND ARE OPPOSITE ANSWERS FROM THE READER. A layer that
|
|
19
|
-
* could not tell them apart would report unmapped ground as unrated ground, which is one of the four
|
|
20
|
-
* absences this whole layer exists to keep separate.
|
|
21
|
-
*
|
|
22
|
-
* THE ANSWER IS A DISTRIBUTION, AND THE TOP CLASS ALWAYS ARRIVES WITH THE SHARE IT RESTS ON. NRCS's own
|
|
23
|
-
* `muaggatt` ships `niccdcd` beside `niccdcdpct` for exactly this reason, with an observed minimum of 2%.
|
|
24
|
-
* A caller that wants one class may take `topClass`; it cannot take it without also being handed
|
|
25
|
-
* `topClassShare`, because a 2% plurality and an 85% majority are different claims.
|
|
26
|
-
*
|
|
27
|
-
* NEITHER READING IS A STATEMENT ABOUT WHETHER THE LAND CAN BE FARMED. The layer reports what the soil
|
|
28
|
-
* survey assigns to the map unit covering a location, which is a fact about the map. NRCS states that its
|
|
29
|
-
* data "do not eliminate the need for onsite sampling, testing, and detailed study of specific sites for
|
|
30
|
-
* intensive uses" and are "intended for planning purposes only" — so `limits` carries the authority's own
|
|
31
|
-
* exclusions on every answer.
|
|
32
|
-
*
|
|
33
|
-
* THE PROBE IS ONE PRIMARY-KEY READ. The reduction is single-resolution and one row per cell, which is
|
|
34
|
-
* what makes it the spine key: a coordinate becomes a cell, the cell becomes a row, and the geometry tier
|
|
35
|
-
* underneath is never touched at read time. The unsimplified rings are there for a caller that wants to
|
|
36
|
-
* re-derive the claim, not for the probe.
|
|
37
|
-
*
|
|
38
|
-
* THE READER IS SYNCHRONOUS AND USES RAW PREPARED STATEMENTS, matching the resolution ladder's existing
|
|
39
|
-
* shape. The DDL that created these tables IS Kysely — see `schema.ts`.
|
|
6
|
+
* Synchronous reader for `soil.db` that returns the soil survey's capability-class distribution at a coordinate.
|
|
40
7
|
*/
|
|
41
|
-
import { parseJSONStrict } from "@mailwoman/core/json";
|
|
8
|
+
import { parseJSONStrict, stringifyJSON } from "@mailwoman/core/json";
|
|
42
9
|
import { assertCoverageNotEmpty, singleManifestRow, toLayerManifest, } from "@mailwoman/core/layers";
|
|
43
10
|
import { shortCellToInt } from "@mailwoman/spatial";
|
|
44
11
|
import { readCoverageAt } from "@mailwoman/spatial/h3/coverage";
|
|
@@ -47,29 +14,28 @@ import { latLngToCell } from "h3-js";
|
|
|
47
14
|
import { SOIL_LAYER_NAME_PREFIX, SSURGO_PRODUCT_LIMITS } from "#vocabulary";
|
|
48
15
|
export { FarmlandScope, farmlandScope, SSURGO_PRODUCT_LIMITS } from "#vocabulary";
|
|
49
16
|
/**
|
|
50
|
-
*
|
|
17
|
+
* The kinds of answer the layer gives for a coordinate, where `DesignatedNoRating`
|
|
18
|
+
* and `Unknown` must stay apart.
|
|
51
19
|
*/
|
|
52
20
|
export const SoilReadingKind = {
|
|
53
21
|
/**
|
|
54
|
-
* The survey mapped this location and assigns at least one capability class
|
|
22
|
+
* The survey mapped this location and assigns at least one capability class.
|
|
55
23
|
*/
|
|
56
24
|
Designated: "designated",
|
|
57
25
|
/**
|
|
58
|
-
* The survey mapped this location and
|
|
26
|
+
* The survey mapped this location and assigned no rating.
|
|
27
|
+
* Every share is reported as an absence share.
|
|
59
28
|
*/
|
|
60
29
|
DesignatedNoRating: "designated_no_rating",
|
|
61
30
|
/**
|
|
62
|
-
*
|
|
31
|
+
* The layer has no coverage for this location.
|
|
32
|
+
* This does not imply low capability.
|
|
63
33
|
*/
|
|
64
34
|
Unknown: "unknown",
|
|
65
35
|
};
|
|
66
36
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* Everything that would make the reader answer a well-formed wrong thing is refused at CONSTRUCTION rather than at
|
|
70
|
-
* query time: a manifest naming a different product, a coverage table with no rows, a vocabulary with no classes. Each
|
|
71
|
-
* of those would otherwise present as a reader that simply always answers `unknown`, which on a receipt is
|
|
72
|
-
* indistinguishable from a region the authority genuinely has not surveyed.
|
|
37
|
+
* Reads a sealed `soil.db`, throwing at construction on a manifest for a different product,
|
|
38
|
+
* an empty coverage table, an empty class vocabulary, or a missing share weighting.
|
|
73
39
|
*/
|
|
74
40
|
export class SoilCapabilityLookup {
|
|
75
41
|
identity;
|
|
@@ -96,28 +62,33 @@ export class SoilCapabilityLookup {
|
|
|
96
62
|
this.#selectCoverage = this.#database.prepare("SELECT h3_cell, completeness, basis, observed_rows FROM layer_coverage WHERE h3_cell = ?");
|
|
97
63
|
}
|
|
98
64
|
/**
|
|
99
|
-
*
|
|
65
|
+
* Returns what the soil survey assigns at this coordinate.
|
|
100
66
|
*/
|
|
101
67
|
lookup(latitude, longitude) {
|
|
102
68
|
const indexCell = latLngToCell(latitude, longitude, this.identity.indexResolution);
|
|
103
69
|
const coverage = this.#readCoverage(indexCell);
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
// summary, so a summary row without a coverage row would state a determination outside the authority's footprint.
|
|
70
|
+
// Every answer is a per-cell summary, so a cell outside the coverage table
|
|
71
|
+
// is unknown even if a summary row exists.
|
|
107
72
|
if (!coverage) {
|
|
108
73
|
return {
|
|
109
74
|
kind: SoilReadingKind.Unknown,
|
|
75
|
+
distribution: null,
|
|
76
|
+
topClassDefinition: null,
|
|
77
|
+
surveyArea: null,
|
|
78
|
+
coverage: null,
|
|
110
79
|
indexCellIndex: indexCell,
|
|
111
80
|
limits: SSURGO_PRODUCT_LIMITS,
|
|
112
81
|
};
|
|
113
82
|
}
|
|
114
83
|
const row = this.#selectCell.get(shortCellToInt(indexCell));
|
|
115
84
|
if (!row) {
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
// this location may be outside the delineations it covers.
|
|
85
|
+
// At a survey-area edge the coarser coverage cell is covered and this index cell
|
|
86
|
+
// has no delineation, so the location may be outside the survey.
|
|
119
87
|
return {
|
|
120
88
|
kind: SoilReadingKind.Unknown,
|
|
89
|
+
distribution: null,
|
|
90
|
+
topClassDefinition: null,
|
|
91
|
+
surveyArea: null,
|
|
121
92
|
coverage,
|
|
122
93
|
indexCellIndex: indexCell,
|
|
123
94
|
limits: SSURGO_PRODUCT_LIMITS,
|
|
@@ -130,18 +101,18 @@ export class SoilCapabilityLookup {
|
|
|
130
101
|
noDataShare: row.nodata_share,
|
|
131
102
|
otherShare: row.other_share,
|
|
132
103
|
mappedShare: row.mapped_share,
|
|
133
|
-
|
|
134
|
-
|
|
104
|
+
topClass: row.top_class || null,
|
|
105
|
+
topClassShare: row.top_class_share,
|
|
135
106
|
weighting: row.weighting,
|
|
136
107
|
delineations: row.delineations,
|
|
137
108
|
};
|
|
138
109
|
const surveyArea = this.#surveyAreaAt(latitude, longitude);
|
|
139
|
-
const definition = row.top_class ? this.#definitions.get(row.top_class) :
|
|
110
|
+
const definition = (row.top_class ? this.#definitions.get(row.top_class) : null) ?? null;
|
|
140
111
|
return {
|
|
141
112
|
kind: row.top_class ? SoilReadingKind.Designated : SoilReadingKind.DesignatedNoRating,
|
|
142
113
|
distribution,
|
|
143
|
-
|
|
144
|
-
|
|
114
|
+
topClassDefinition: definition || null,
|
|
115
|
+
surveyArea,
|
|
145
116
|
coverage,
|
|
146
117
|
indexCellIndex: indexCell,
|
|
147
118
|
limits: SSURGO_PRODUCT_LIMITS,
|
|
@@ -150,23 +121,15 @@ export class SoilCapabilityLookup {
|
|
|
150
121
|
[Symbol.dispose]() {
|
|
151
122
|
this.#database.destroy();
|
|
152
123
|
}
|
|
153
|
-
/**
|
|
154
|
-
* The coverage row for the index cell's parent at the coverage resolution.
|
|
155
|
-
*/
|
|
156
124
|
#readCoverage(indexCell) {
|
|
157
125
|
return readCoverageAt(this.#selectCoverage, indexCell, this.identity.coverageResolution);
|
|
158
126
|
}
|
|
159
127
|
/**
|
|
160
|
-
*
|
|
128
|
+
* Returns the first survey area whose bounding rectangle contains the coordinate.
|
|
129
|
+
* overlapping rectangles may give the wrong area near a corner.
|
|
161
130
|
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* not depend on it — the cell row is the answer — so a corner ambiguity costs a label rather than a determination.
|
|
165
|
-
*
|
|
166
|
-
* A LINEAR SCAN, WHICH THE PILOT'S 99 SURVEY AREAS MAKE FREE AND A NATIONAL BUILD WOULD NOT. It returns on the first
|
|
167
|
-
* containing rectangle, so the pilot costs a few dozen comparisons per geocode. At the 3,380 survey areas the country
|
|
168
|
-
* holds this wants a bounding-box index; it is left as a scan because a structure sized for a set this build does not
|
|
169
|
-
* hold would be untested at the size it was built for.
|
|
131
|
+
* This affects only the `surveyArea` label.
|
|
132
|
+
* A spatial index would be needed to avoid the linear scan for thousands of areas.
|
|
170
133
|
*/
|
|
171
134
|
#surveyAreaAt(latitude, longitude) {
|
|
172
135
|
for (const [index, bounds] of this.#bounds.entries()) {
|
|
@@ -174,24 +137,20 @@ export class SoilCapabilityLookup {
|
|
|
174
137
|
longitude <= bounds.maxLon &&
|
|
175
138
|
latitude >= bounds.minLat &&
|
|
176
139
|
latitude <= bounds.maxLat) {
|
|
177
|
-
return this.#surveyAreaByBounds[index];
|
|
140
|
+
return this.#surveyAreaByBounds[index] ?? null;
|
|
178
141
|
}
|
|
179
142
|
}
|
|
180
|
-
return
|
|
143
|
+
return null;
|
|
181
144
|
}
|
|
182
145
|
}
|
|
183
|
-
/**
|
|
184
|
-
* Read and check the layer's identity.
|
|
185
|
-
*/
|
|
186
146
|
function readIdentity(database, databasePath) {
|
|
187
147
|
const manifestRows = database.prepare("SELECT * FROM layer_manifest").all();
|
|
188
|
-
// The name
|
|
189
|
-
//
|
|
190
|
-
// vocabulary per artifact, over whichever survey areas were built.
|
|
148
|
+
// The layer name ends with the region the build covers, so the reader checks only the prefix
|
|
149
|
+
// rather than `parseManifestRows`, which compares whole names.
|
|
191
150
|
const row = singleManifestRow(manifestRows, `soil reader: ${databasePath}`);
|
|
192
151
|
const name = String(row.name);
|
|
193
152
|
if (!name.startsWith(SOIL_LAYER_NAME_PREFIX)) {
|
|
194
|
-
throw new Error(`soil reader: ${databasePath} is layer ${
|
|
153
|
+
throw new Error(`soil reader: ${databasePath} is layer ${stringifyJSON(name)}, which is not a ${stringifyJSON(SOIL_LAYER_NAME_PREFIX)} layer — one authority, one product, one rating vocabulary per artifact`);
|
|
195
154
|
}
|
|
196
155
|
const manifest = toLayerManifest(row);
|
|
197
156
|
const spineKeys = manifest.spineKeys;
|
|
@@ -241,7 +200,7 @@ function readIdentity(database, databasePath) {
|
|
|
241
200
|
})),
|
|
242
201
|
classCodes: [...definitions.keys()],
|
|
243
202
|
weighting: { code: weighting.code, description: weighting.definition },
|
|
244
|
-
databasePath,
|
|
203
|
+
databasePath: databasePath.toString(),
|
|
245
204
|
},
|
|
246
205
|
definitions,
|
|
247
206
|
bounds: areaRows.map((area) => ({
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EACN,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,GAGf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAIpC,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE3E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,aA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IAAI,CAAC,kBAAkB;gBACzC,iBAAiB,EAAE,IAAI,CAAC,mBAAmB;gBAC3C,WAAW,EAAE,IAAI,CAAC,YAAY;gBAC9B,YAAY,EAAE,IAAI,CAAC,aAAa;aAChC,CAAC,CAAC;YACH,UAAU,EAAE,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;YACnC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,CAAC,UAAU,EAAE;YACtE,YAAY,EAAE,YAAY,CAAC,QAAQ,EAAE;SACrC;QACD,WAAW;QACX,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC/B,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,MAAM,EAAE,IAAI,CAAC,OAAO;SACpB,CAAC,CAAC;KACH,CAAA;AACF,CAAC"}
|
package/out/paths.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Where the soil layer database and its download caches live under the data root's `db/` group.
|
|
7
|
+
*/
|
|
8
|
+
import type { PathBuilder, PathBuilderLike } from "path-ts";
|
|
9
|
+
/**
|
|
10
|
+
* `<dataRoot>/db/soil`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function soilDatabaseRoot(dataRoot: PathBuilderLike): PathBuilder;
|
|
13
|
+
/**
|
|
14
|
+
* `$MAILWOMAN_DATA_ROOT/db/soil`, read when a path is requested.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link soilDatabaseRoot} for another data root.
|
|
17
|
+
*/
|
|
18
|
+
export declare const soilDatabasePath: PathBuilder;
|
|
19
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../lib/paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE3D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,WAAW,CAEvE;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAA8C,CAAA"}
|
package/out/paths.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Where the soil layer database and its download caches live under the data root's `db/` group.
|
|
7
|
+
*/
|
|
8
|
+
import { databaseRootPath, dataRootPath } from "@mailwoman/core/data-root";
|
|
9
|
+
/**
|
|
10
|
+
* `<dataRoot>/db/soil`.
|
|
11
|
+
*/
|
|
12
|
+
export function soilDatabaseRoot(dataRoot) {
|
|
13
|
+
return databaseRootPath(dataRoot)("soil");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `$MAILWOMAN_DATA_ROOT/db/soil`, read when a path is requested.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link soilDatabaseRoot} for another data root.
|
|
19
|
+
*/
|
|
20
|
+
export const soilDatabasePath = soilDatabaseRoot(dataRootPath());
|
|
21
|
+
//# sourceMappingURL=paths.js.map
|
package/out/paths.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../lib/paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAG1E;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAyB;IACzD,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAgB,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAA"}
|