@welldot/core 0.1.0 → 0.2.2
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 +144 -52
- package/dist/index.cjs +878 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4948 -107
- package/dist/index.d.ts +4948 -107
- package/dist/index.js +836 -29
- package/dist/index.js.map +1 -1
- package/docs/profiles/.gitkeep +0 -0
- package/docs/reference/fgdc-textures.md +380 -0
- package/docs/schema/v1/.gitkeep +0 -0
- package/docs/schema/v2/profiles/.gitkeep +0 -0
- package/docs/schema/v2/well.schema.json +949 -0
- package/{well-specifications.md → docs/spec/v1/well-format.md} +160 -95
- package/docs/spec/v2/format-reference.md +534 -0
- package/docs/spec/v2/interoperability.md +177 -0
- package/docs/spec/v2/object-schemas.md +657 -0
- package/docs/spec/v2/overview.md +85 -0
- package/package.json +16 -12
package/dist/index.js
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
// src/validators/well.validators.ts
|
|
2
|
+
import { createDefu } from "defu";
|
|
2
3
|
import { z } from "zod";
|
|
4
|
+
var mergeWell = createDefu((obj, key, value) => {
|
|
5
|
+
if (Array.isArray(value)) {
|
|
6
|
+
obj[key] = value;
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
var RFC3339_WITH_OFFSET = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;
|
|
11
|
+
var rfc3339 = () => z.string().regex(RFC3339_WITH_OFFSET, "datetime must be RFC 3339 with UTC offset");
|
|
12
|
+
var WellIdSchema = z.object({
|
|
13
|
+
authority: z.string(),
|
|
14
|
+
id: z.string(),
|
|
15
|
+
primary: z.boolean().optional()
|
|
16
|
+
});
|
|
17
|
+
var LocationPropertiesSchema = z.object({
|
|
18
|
+
elevation_datum: z.string().optional(),
|
|
19
|
+
crs: z.string().optional(),
|
|
20
|
+
lat_precision: z.number().optional(),
|
|
21
|
+
lng_precision: z.number().optional(),
|
|
22
|
+
elevation_precision: z.number().optional(),
|
|
23
|
+
original_crs: z.string().optional()
|
|
24
|
+
});
|
|
25
|
+
var LocationSchema = z.object({
|
|
26
|
+
lat: z.number(),
|
|
27
|
+
lng: z.number(),
|
|
28
|
+
elevation: z.number().optional(),
|
|
29
|
+
properties: LocationPropertiesSchema.optional()
|
|
30
|
+
});
|
|
3
31
|
var BoreHoleSchema = z.object({
|
|
4
32
|
from: z.number(),
|
|
5
33
|
to: z.number(),
|
|
@@ -24,7 +52,7 @@ var WellScreenSchema = z.object({
|
|
|
24
52
|
to: z.number(),
|
|
25
53
|
type: z.string(),
|
|
26
54
|
diameter: z.number(),
|
|
27
|
-
|
|
55
|
+
screen_slot: z.number()
|
|
28
56
|
});
|
|
29
57
|
var HoleFillSchema = z.object({
|
|
30
58
|
from: z.number(),
|
|
@@ -44,12 +72,16 @@ var CementPadSchema = z.object({
|
|
|
44
72
|
thickness: z.number(),
|
|
45
73
|
length: z.number()
|
|
46
74
|
});
|
|
75
|
+
var TextureSchema = z.object({
|
|
76
|
+
code: z.union([z.string(), z.number()]),
|
|
77
|
+
vocabulary: z.string().optional()
|
|
78
|
+
});
|
|
47
79
|
var LithologySchema = z.object({
|
|
48
80
|
from: z.number(),
|
|
49
81
|
to: z.number(),
|
|
50
82
|
description: z.string(),
|
|
51
83
|
color: z.string(),
|
|
52
|
-
|
|
84
|
+
texture: TextureSchema,
|
|
53
85
|
geologic_unit: z.string(),
|
|
54
86
|
aquifer_unit: z.string()
|
|
55
87
|
});
|
|
@@ -59,7 +91,8 @@ var FractureSchema = z.object({
|
|
|
59
91
|
description: z.string(),
|
|
60
92
|
swarm: z.boolean(),
|
|
61
93
|
azimuth: z.number(),
|
|
62
|
-
dip: z.number()
|
|
94
|
+
dip: z.number(),
|
|
95
|
+
depth_precision: z.number().optional()
|
|
63
96
|
});
|
|
64
97
|
var CaveSchema = z.object({
|
|
65
98
|
from: z.number(),
|
|
@@ -67,35 +100,242 @@ var CaveSchema = z.object({
|
|
|
67
100
|
water_intake: z.boolean(),
|
|
68
101
|
description: z.string()
|
|
69
102
|
});
|
|
103
|
+
var LevelReadingSchema = z.object({
|
|
104
|
+
elapsed: z.number(),
|
|
105
|
+
depth: z.number(),
|
|
106
|
+
depth_precision: z.number().optional(),
|
|
107
|
+
pressure: z.number().optional()
|
|
108
|
+
});
|
|
109
|
+
var RecoveryPhaseSchema = z.object({
|
|
110
|
+
readings: z.array(LevelReadingSchema)
|
|
111
|
+
});
|
|
112
|
+
var PumpingStepSchema = z.object({
|
|
113
|
+
rate: z.number(),
|
|
114
|
+
rate_precision: z.number().optional(),
|
|
115
|
+
duration: z.number().optional(),
|
|
116
|
+
readings: z.array(LevelReadingSchema).optional()
|
|
117
|
+
});
|
|
118
|
+
var HydrodynamicEventBaseSchema = z.object({
|
|
119
|
+
id: z.string(),
|
|
120
|
+
type: z.string(),
|
|
121
|
+
datetime: rfc3339(),
|
|
122
|
+
sequence: z.number().int().optional(),
|
|
123
|
+
operator: z.string().optional(),
|
|
124
|
+
equipment: z.string().optional(),
|
|
125
|
+
notes: z.string().optional()
|
|
126
|
+
});
|
|
127
|
+
var SpotMeasurementEventSchema = HydrodynamicEventBaseSchema.extend({
|
|
128
|
+
type: z.literal("spot_measurement"),
|
|
129
|
+
static_level: z.number(),
|
|
130
|
+
static_level_precision: z.number().optional(),
|
|
131
|
+
measurement_method: z.string().optional(),
|
|
132
|
+
steps: z.array(PumpingStepSchema).max(1).optional(),
|
|
133
|
+
recovery: RecoveryPhaseSchema.optional()
|
|
134
|
+
});
|
|
135
|
+
var ConstantRateEventSchema = HydrodynamicEventBaseSchema.extend({
|
|
136
|
+
type: z.literal("constant_rate"),
|
|
137
|
+
static_level: z.number().optional(),
|
|
138
|
+
static_level_precision: z.number().optional(),
|
|
139
|
+
steps: z.tuple([PumpingStepSchema]).optional(),
|
|
140
|
+
recovery: RecoveryPhaseSchema.optional()
|
|
141
|
+
});
|
|
142
|
+
var StepDrawdownEventSchema = HydrodynamicEventBaseSchema.extend({
|
|
143
|
+
type: z.literal("step_drawdown"),
|
|
144
|
+
static_level: z.number().optional(),
|
|
145
|
+
static_level_precision: z.number().optional(),
|
|
146
|
+
steps: z.array(PumpingStepSchema),
|
|
147
|
+
recovery: RecoveryPhaseSchema.optional()
|
|
148
|
+
});
|
|
149
|
+
var AirliftEventSchema = HydrodynamicEventBaseSchema.extend({
|
|
150
|
+
type: z.literal("airlift"),
|
|
151
|
+
steps: z.array(PumpingStepSchema),
|
|
152
|
+
recovery: RecoveryPhaseSchema.optional()
|
|
153
|
+
});
|
|
154
|
+
var RecoveryOnlyEventSchema = HydrodynamicEventBaseSchema.extend({
|
|
155
|
+
type: z.literal("recovery_only"),
|
|
156
|
+
pumping_rate: z.number().optional(),
|
|
157
|
+
pumping_duration: z.number().optional(),
|
|
158
|
+
recovery: RecoveryPhaseSchema
|
|
159
|
+
});
|
|
160
|
+
var HydrodynamicEventSchema = z.discriminatedUnion("type", [
|
|
161
|
+
SpotMeasurementEventSchema,
|
|
162
|
+
ConstantRateEventSchema,
|
|
163
|
+
StepDrawdownEventSchema,
|
|
164
|
+
AirliftEventSchema,
|
|
165
|
+
RecoveryOnlyEventSchema
|
|
166
|
+
]).or(HydrodynamicEventBaseSchema.passthrough());
|
|
167
|
+
var AttachmentSchema = z.object({
|
|
168
|
+
id: z.string(),
|
|
169
|
+
uri: z.string().url(),
|
|
170
|
+
media_type: z.string(),
|
|
171
|
+
filename: z.string().optional(),
|
|
172
|
+
description: z.string().optional(),
|
|
173
|
+
sha256: z.string().optional()
|
|
174
|
+
});
|
|
175
|
+
var HistoryLogEntrySchema = z.object({
|
|
176
|
+
id: z.string(),
|
|
177
|
+
datetime: rfc3339(),
|
|
178
|
+
updated_at: rfc3339().optional(),
|
|
179
|
+
category: z.string(),
|
|
180
|
+
description: z.string(),
|
|
181
|
+
author: z.string().optional(),
|
|
182
|
+
severity: z.string().optional(),
|
|
183
|
+
attachments: z.array(AttachmentSchema).optional()
|
|
184
|
+
});
|
|
185
|
+
var AquiferAnalysisSchema = z.object({
|
|
186
|
+
id: z.string(),
|
|
187
|
+
datetime: rfc3339(),
|
|
188
|
+
analyst: z.string().optional(),
|
|
189
|
+
source_event_ids: z.array(z.string()),
|
|
190
|
+
method: z.string().optional(),
|
|
191
|
+
static_level: z.number().optional(),
|
|
192
|
+
static_level_precision: z.number().optional(),
|
|
193
|
+
static_level_source_id: z.string().optional(),
|
|
194
|
+
dynamic_level: z.number().optional(),
|
|
195
|
+
dynamic_level_precision: z.number().optional(),
|
|
196
|
+
flow_rate: z.number().optional(),
|
|
197
|
+
flow_rate_precision: z.number().optional(),
|
|
198
|
+
max_flow_rate: z.number().optional(),
|
|
199
|
+
max_flow_rate_precision: z.number().optional(),
|
|
200
|
+
max_flow_rate_basis: z.string().optional(),
|
|
201
|
+
specific_capacity: z.number().optional(),
|
|
202
|
+
transmissivity: z.number().optional(),
|
|
203
|
+
storativity: z.number().nullable().optional(),
|
|
204
|
+
hydraulic_conductivity: z.number().optional(),
|
|
205
|
+
aquifer_thickness: z.number().optional(),
|
|
206
|
+
jacob_b: z.number().optional(),
|
|
207
|
+
jacob_c: z.number().optional(),
|
|
208
|
+
well_efficiency_pct: z.number().optional(),
|
|
209
|
+
notes: z.string().optional()
|
|
210
|
+
});
|
|
70
211
|
var WellSchema = z.object({
|
|
212
|
+
version: z.number().int(),
|
|
213
|
+
"@context": z.union([z.string(), z.array(z.unknown()), z.record(z.unknown())]).optional(),
|
|
214
|
+
well_id: z.array(WellIdSchema).optional(),
|
|
215
|
+
location: LocationSchema.optional(),
|
|
216
|
+
profiles: z.array(
|
|
217
|
+
z.string().url().refine((u) => u.startsWith("https://"), {
|
|
218
|
+
message: "profiles must be HTTPS URLs"
|
|
219
|
+
})
|
|
220
|
+
).optional(),
|
|
71
221
|
well_type: z.string().optional(),
|
|
72
222
|
name: z.string().optional(),
|
|
73
223
|
well_driller: z.string().optional(),
|
|
74
|
-
construction_date: z.string().optional(),
|
|
224
|
+
construction_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "construction_date must be YYYY-MM-DD").optional(),
|
|
225
|
+
obs: z.string().optional(),
|
|
75
226
|
lat: z.number().optional(),
|
|
76
227
|
lng: z.number().optional(),
|
|
77
228
|
elevation: z.number().optional(),
|
|
78
|
-
|
|
229
|
+
well_depth: z.number().optional(),
|
|
79
230
|
bore_hole: z.array(BoreHoleSchema),
|
|
80
231
|
well_case: z.array(WellCaseSchema),
|
|
81
232
|
reduction: z.array(ReductionSchema),
|
|
82
233
|
well_screen: z.array(WellScreenSchema),
|
|
83
234
|
surface_case: z.array(SurfaceCaseSchema),
|
|
84
235
|
hole_fill: z.array(HoleFillSchema),
|
|
85
|
-
cement_pad: CementPadSchema,
|
|
236
|
+
cement_pad: CementPadSchema.optional(),
|
|
86
237
|
lithology: z.array(LithologySchema),
|
|
87
238
|
fractures: z.array(FractureSchema),
|
|
88
|
-
caves: z.array(CaveSchema)
|
|
89
|
-
|
|
239
|
+
caves: z.array(CaveSchema),
|
|
240
|
+
hydrodynamic_events: z.array(HydrodynamicEventSchema).optional(),
|
|
241
|
+
aquifer_analysis: z.array(AquiferAnalysisSchema).optional(),
|
|
242
|
+
history_logs: z.array(HistoryLogEntrySchema).optional()
|
|
243
|
+
}).passthrough();
|
|
244
|
+
function normalizeV1Fields(raw) {
|
|
245
|
+
const out = { ...raw };
|
|
246
|
+
out.version = 2;
|
|
247
|
+
if ("bole_hole" in out && !("bore_hole" in out)) {
|
|
248
|
+
out.bore_hole = out.bole_hole;
|
|
249
|
+
delete out.bole_hole;
|
|
250
|
+
}
|
|
251
|
+
if (!("location" in out)) {
|
|
252
|
+
const lat = out.lat;
|
|
253
|
+
const lng = out.lng;
|
|
254
|
+
const elevation = out.elevation;
|
|
255
|
+
if (lat !== void 0 && lng !== void 0) {
|
|
256
|
+
out.location = {
|
|
257
|
+
lat,
|
|
258
|
+
lng,
|
|
259
|
+
...elevation !== void 0 && { elevation }
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
for (const key of [
|
|
264
|
+
"bore_hole",
|
|
265
|
+
"well_case",
|
|
266
|
+
"well_screen",
|
|
267
|
+
"surface_case",
|
|
268
|
+
"hole_fill"
|
|
269
|
+
]) {
|
|
270
|
+
const items = out[key];
|
|
271
|
+
if (Array.isArray(items)) {
|
|
272
|
+
const hasDiamPol = items.some(
|
|
273
|
+
(item) => "diam_pol" in item
|
|
274
|
+
);
|
|
275
|
+
if (hasDiamPol) {
|
|
276
|
+
out[key] = items.map((item) => {
|
|
277
|
+
const { diam_pol, ...rest } = item;
|
|
278
|
+
return { ...rest, diameter: (diam_pol || 0) * 25.4 };
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (Array.isArray(out.lithology)) {
|
|
284
|
+
out.lithology = out.lithology.map((item) => {
|
|
285
|
+
if ("fgdc_texture" in item && !("texture" in item)) {
|
|
286
|
+
const { fgdc_texture, ...rest } = item;
|
|
287
|
+
return { ...rest, texture: { code: fgdc_texture, vocabulary: "fgdc" } };
|
|
288
|
+
}
|
|
289
|
+
return item;
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
if (Array.isArray(out.well_screen)) {
|
|
293
|
+
out.well_screen = out.well_screen.map(
|
|
294
|
+
(item) => {
|
|
295
|
+
if ("screen_slot_mm" in item && !("screen_slot" in item)) {
|
|
296
|
+
const { screen_slot_mm, ...rest } = item;
|
|
297
|
+
return { ...rest, screen_slot: screen_slot_mm };
|
|
298
|
+
}
|
|
299
|
+
return item;
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
return out;
|
|
304
|
+
}
|
|
90
305
|
function parseWell(json) {
|
|
91
306
|
const raw = JSON.parse(json);
|
|
92
|
-
|
|
307
|
+
const version = raw.version;
|
|
308
|
+
if (version !== void 0 && typeof version === "number") {
|
|
309
|
+
if (version !== 1 && version !== 2) {
|
|
310
|
+
throw new Error(`Unsupported .well format version: ${version}`);
|
|
311
|
+
}
|
|
312
|
+
if (version === 1) {
|
|
313
|
+
const normalized = normalizeV1Fields(raw);
|
|
314
|
+
return mergeWell(
|
|
315
|
+
WellSchema.parse(normalized),
|
|
316
|
+
normalized
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
} else if (version !== void 0) {
|
|
320
|
+
throw new Error(`Unsupported .well format version: ${String(version)}`);
|
|
321
|
+
} else {
|
|
322
|
+
raw.version = 2;
|
|
323
|
+
}
|
|
324
|
+
return mergeWell(WellSchema.parse(raw), raw);
|
|
93
325
|
}
|
|
94
326
|
|
|
95
327
|
// src/utils/well.utils.ts
|
|
96
|
-
var WELL_FORMAT_VERSION =
|
|
328
|
+
var WELL_FORMAT_VERSION = 2;
|
|
97
329
|
var INCHES_TO_MM = 25.4;
|
|
330
|
+
var SECTION_KEYS = [
|
|
331
|
+
"general",
|
|
332
|
+
"constructive",
|
|
333
|
+
"geology",
|
|
334
|
+
"hydrodynamic",
|
|
335
|
+
"history"
|
|
336
|
+
];
|
|
98
337
|
var EMPTY_WELL = {
|
|
338
|
+
version: 2,
|
|
99
339
|
bore_hole: [],
|
|
100
340
|
well_case: [],
|
|
101
341
|
reduction: [],
|
|
@@ -110,11 +350,56 @@ var EMPTY_WELL = {
|
|
|
110
350
|
function createEmptyWell() {
|
|
111
351
|
return JSON.parse(JSON.stringify(EMPTY_WELL));
|
|
112
352
|
}
|
|
353
|
+
function calculatedWellDepth(well) {
|
|
354
|
+
const lastTo = (items) => items.length ? items[items.length - 1].to : 0;
|
|
355
|
+
return Math.max(
|
|
356
|
+
0,
|
|
357
|
+
lastTo(well.bore_hole),
|
|
358
|
+
lastTo(well.hole_fill),
|
|
359
|
+
lastTo(well.reduction),
|
|
360
|
+
lastTo(well.surface_case),
|
|
361
|
+
lastTo(well.well_case),
|
|
362
|
+
lastTo(well.well_screen)
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
function withCalculatedWellDepth(well) {
|
|
366
|
+
if (well.well_depth != null) return well;
|
|
367
|
+
const calculated = calculatedWellDepth(well);
|
|
368
|
+
return calculated > 0 ? { ...well, well_depth: calculated } : well;
|
|
369
|
+
}
|
|
113
370
|
function normalizeLithology(items) {
|
|
114
|
-
return items.map((item) =>
|
|
371
|
+
return items.map((item) => {
|
|
372
|
+
const base = { aquifer_unit: "", ...item };
|
|
373
|
+
if ("fgdc_texture" in base && !("texture" in base)) {
|
|
374
|
+
const { fgdc_texture, ...rest } = base;
|
|
375
|
+
return {
|
|
376
|
+
...rest,
|
|
377
|
+
texture: { code: fgdc_texture, vocabulary: "fgdc" }
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
return base;
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
function normalizeWellScreens(items) {
|
|
384
|
+
return items.map((item) => {
|
|
385
|
+
if ("screen_slot_mm" in item && !("screen_slot" in item)) {
|
|
386
|
+
const { screen_slot_mm, ...rest } = item;
|
|
387
|
+
return {
|
|
388
|
+
...rest,
|
|
389
|
+
screen_slot: screen_slot_mm
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
return item;
|
|
393
|
+
});
|
|
115
394
|
}
|
|
116
395
|
function decodeV1Well(raw) {
|
|
117
|
-
|
|
396
|
+
const lat = raw.lat;
|
|
397
|
+
const lng = raw.lng;
|
|
398
|
+
const elevation = raw.elevation;
|
|
399
|
+
const hasCoords = lat !== void 0 || lng !== void 0 || elevation !== void 0;
|
|
400
|
+
const location = hasCoords && lat !== void 0 && lng !== void 0 ? { lat, lng, ...elevation !== void 0 && { elevation } } : void 0;
|
|
401
|
+
const rawScreens = raw.well_screen ?? [];
|
|
402
|
+
const decoded = {
|
|
118
403
|
...createEmptyWell(),
|
|
119
404
|
...raw.well_type !== void 0 && { well_type: raw.well_type },
|
|
120
405
|
...raw.name !== void 0 && { name: raw.name },
|
|
@@ -124,14 +409,15 @@ function decodeV1Well(raw) {
|
|
|
124
409
|
...raw.construction_date !== void 0 && {
|
|
125
410
|
construction_date: raw.construction_date
|
|
126
411
|
},
|
|
127
|
-
...
|
|
128
|
-
...
|
|
129
|
-
...
|
|
412
|
+
...lat !== void 0 && { lat },
|
|
413
|
+
...lng !== void 0 && { lng },
|
|
414
|
+
...elevation !== void 0 && { elevation },
|
|
415
|
+
...location !== void 0 && { location },
|
|
130
416
|
...raw.obs !== void 0 && { obs: raw.obs },
|
|
131
417
|
bore_hole: raw.bore_hole ?? [],
|
|
132
418
|
well_case: raw.well_case ?? [],
|
|
133
419
|
reduction: raw.reduction ?? [],
|
|
134
|
-
well_screen:
|
|
420
|
+
well_screen: normalizeWellScreens(rawScreens),
|
|
135
421
|
surface_case: raw.surface_case ?? [],
|
|
136
422
|
hole_fill: raw.hole_fill ?? [],
|
|
137
423
|
...raw.cement_pad ? { cement_pad: raw.cement_pad } : {},
|
|
@@ -139,6 +425,58 @@ function decodeV1Well(raw) {
|
|
|
139
425
|
fractures: raw.fractures ?? [],
|
|
140
426
|
caves: raw.caves ?? []
|
|
141
427
|
};
|
|
428
|
+
return mergeWell(decoded, raw);
|
|
429
|
+
}
|
|
430
|
+
function decodeV2Well(raw) {
|
|
431
|
+
const rawScreens = raw.well_screen ?? [];
|
|
432
|
+
const decoded = {
|
|
433
|
+
...createEmptyWell(),
|
|
434
|
+
...raw.version !== void 0 && { version: raw.version },
|
|
435
|
+
...raw["@context"] !== void 0 && {
|
|
436
|
+
"@context": raw["@context"]
|
|
437
|
+
},
|
|
438
|
+
...raw.well_id !== void 0 && {
|
|
439
|
+
well_id: raw.well_id
|
|
440
|
+
},
|
|
441
|
+
...raw.location !== void 0 && {
|
|
442
|
+
location: raw.location
|
|
443
|
+
},
|
|
444
|
+
...raw.profiles !== void 0 && {
|
|
445
|
+
profiles: raw.profiles
|
|
446
|
+
},
|
|
447
|
+
...raw.well_type !== void 0 && { well_type: raw.well_type },
|
|
448
|
+
...raw.name !== void 0 && { name: raw.name },
|
|
449
|
+
...raw.well_driller !== void 0 && {
|
|
450
|
+
well_driller: raw.well_driller
|
|
451
|
+
},
|
|
452
|
+
...raw.construction_date !== void 0 && {
|
|
453
|
+
construction_date: raw.construction_date
|
|
454
|
+
},
|
|
455
|
+
...raw.obs !== void 0 && { obs: raw.obs },
|
|
456
|
+
...raw.well_depth !== void 0 && {
|
|
457
|
+
well_depth: raw.well_depth
|
|
458
|
+
},
|
|
459
|
+
bore_hole: raw.bore_hole ?? [],
|
|
460
|
+
well_case: raw.well_case ?? [],
|
|
461
|
+
reduction: raw.reduction ?? [],
|
|
462
|
+
well_screen: normalizeWellScreens(rawScreens),
|
|
463
|
+
surface_case: raw.surface_case ?? [],
|
|
464
|
+
hole_fill: raw.hole_fill ?? [],
|
|
465
|
+
...raw.cement_pad ? { cement_pad: raw.cement_pad } : {},
|
|
466
|
+
lithology: normalizeLithology(raw.lithology ?? []),
|
|
467
|
+
fractures: raw.fractures ?? [],
|
|
468
|
+
caves: raw.caves ?? [],
|
|
469
|
+
...raw.hydrodynamic_events !== void 0 && {
|
|
470
|
+
hydrodynamic_events: raw.hydrodynamic_events
|
|
471
|
+
},
|
|
472
|
+
...raw.aquifer_analysis !== void 0 && {
|
|
473
|
+
aquifer_analysis: raw.aquifer_analysis
|
|
474
|
+
},
|
|
475
|
+
...raw.history_logs !== void 0 && {
|
|
476
|
+
history_logs: raw.history_logs
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
return mergeWell(decoded, raw);
|
|
142
480
|
}
|
|
143
481
|
function convertLegacyDiameters(items) {
|
|
144
482
|
if (!items?.length) return items ?? [];
|
|
@@ -150,6 +488,9 @@ function convertLegacyDiameters(items) {
|
|
|
150
488
|
}
|
|
151
489
|
function normalizeConstructive(src) {
|
|
152
490
|
const boreHoleData = src.bole_hole ?? src.bore_hole ?? [];
|
|
491
|
+
const rawScreens = convertLegacyDiameters(
|
|
492
|
+
src.well_screen ?? []
|
|
493
|
+
);
|
|
153
494
|
return {
|
|
154
495
|
bore_hole: convertLegacyDiameters(boreHoleData),
|
|
155
496
|
hole_fill: convertLegacyDiameters(
|
|
@@ -161,9 +502,7 @@ function normalizeConstructive(src) {
|
|
|
161
502
|
well_case: convertLegacyDiameters(
|
|
162
503
|
src.well_case ?? []
|
|
163
504
|
),
|
|
164
|
-
well_screen:
|
|
165
|
-
src.well_screen ?? []
|
|
166
|
-
),
|
|
505
|
+
well_screen: normalizeWellScreens(rawScreens),
|
|
167
506
|
reduction: src.reduction ?? [],
|
|
168
507
|
...src.cement_pad ? { cement_pad: src.cement_pad } : {}
|
|
169
508
|
};
|
|
@@ -179,16 +518,18 @@ function normalizeGeologic(raw) {
|
|
|
179
518
|
function serializeWell(well) {
|
|
180
519
|
const payload = {
|
|
181
520
|
version: WELL_FORMAT_VERSION,
|
|
521
|
+
...well["@context"] !== void 0 && { "@context": well["@context"] },
|
|
522
|
+
...well.well_id !== void 0 && { well_id: well.well_id },
|
|
523
|
+
...well.location !== void 0 && { location: well.location },
|
|
524
|
+
...well.profiles !== void 0 && { profiles: well.profiles },
|
|
182
525
|
...well.well_type !== void 0 && { well_type: well.well_type },
|
|
183
526
|
...well.name !== void 0 && { name: well.name },
|
|
184
527
|
...well.well_driller !== void 0 && { well_driller: well.well_driller },
|
|
185
528
|
...well.construction_date !== void 0 && {
|
|
186
529
|
construction_date: well.construction_date
|
|
187
530
|
},
|
|
188
|
-
...well.lat !== void 0 && { lat: well.lat },
|
|
189
|
-
...well.lng !== void 0 && { lng: well.lng },
|
|
190
|
-
...well.elevation !== void 0 && { elevation: well.elevation },
|
|
191
531
|
...well.obs !== void 0 && { obs: well.obs },
|
|
532
|
+
...well.well_depth !== void 0 && { well_depth: well.well_depth },
|
|
192
533
|
bore_hole: well.bore_hole,
|
|
193
534
|
well_case: well.well_case,
|
|
194
535
|
reduction: well.reduction,
|
|
@@ -198,7 +539,14 @@ function serializeWell(well) {
|
|
|
198
539
|
...well.cement_pad && { cement_pad: well.cement_pad },
|
|
199
540
|
lithology: well.lithology,
|
|
200
541
|
fractures: well.fractures,
|
|
201
|
-
caves: well.caves
|
|
542
|
+
caves: well.caves,
|
|
543
|
+
...well.hydrodynamic_events !== void 0 && {
|
|
544
|
+
hydrodynamic_events: well.hydrodynamic_events
|
|
545
|
+
},
|
|
546
|
+
...well.aquifer_analysis !== void 0 && {
|
|
547
|
+
aquifer_analysis: well.aquifer_analysis
|
|
548
|
+
},
|
|
549
|
+
...well.history_logs !== void 0 && { history_logs: well.history_logs }
|
|
202
550
|
};
|
|
203
551
|
return JSON.stringify(payload);
|
|
204
552
|
}
|
|
@@ -208,6 +556,44 @@ function isWellEmpty(well) {
|
|
|
208
556
|
if (raw.constructive || raw.geologic) return false;
|
|
209
557
|
return well.lithology?.length === 0 && well.fractures?.length === 0 && well.caves?.length === 0 && well.bore_hole?.length === 0 && well.hole_fill?.length === 0 && well.well_case?.length === 0 && well.well_screen?.length === 0;
|
|
210
558
|
}
|
|
559
|
+
function redactWell(well, visibility) {
|
|
560
|
+
const redacted = { ...well };
|
|
561
|
+
if (!visibility.general) {
|
|
562
|
+
delete redacted.well_id;
|
|
563
|
+
delete redacted.location;
|
|
564
|
+
delete redacted.well_type;
|
|
565
|
+
delete redacted.name;
|
|
566
|
+
delete redacted.well_driller;
|
|
567
|
+
delete redacted.construction_date;
|
|
568
|
+
delete redacted.obs;
|
|
569
|
+
delete redacted.lat;
|
|
570
|
+
delete redacted.lng;
|
|
571
|
+
delete redacted.elevation;
|
|
572
|
+
}
|
|
573
|
+
if (!visibility.constructive) {
|
|
574
|
+
redacted.bore_hole = [];
|
|
575
|
+
redacted.well_case = [];
|
|
576
|
+
redacted.reduction = [];
|
|
577
|
+
redacted.well_screen = [];
|
|
578
|
+
redacted.surface_case = [];
|
|
579
|
+
redacted.hole_fill = [];
|
|
580
|
+
delete redacted.cement_pad;
|
|
581
|
+
delete redacted.well_depth;
|
|
582
|
+
}
|
|
583
|
+
if (!visibility.geology) {
|
|
584
|
+
redacted.lithology = [];
|
|
585
|
+
redacted.fractures = [];
|
|
586
|
+
redacted.caves = [];
|
|
587
|
+
}
|
|
588
|
+
if (!visibility.hydrodynamic) {
|
|
589
|
+
redacted.hydrodynamic_events = [];
|
|
590
|
+
redacted.aquifer_analysis = [];
|
|
591
|
+
}
|
|
592
|
+
if (!visibility.history) {
|
|
593
|
+
redacted.history_logs = [];
|
|
594
|
+
}
|
|
595
|
+
return redacted;
|
|
596
|
+
}
|
|
211
597
|
function deserializeWell(jsonString) {
|
|
212
598
|
let raw;
|
|
213
599
|
try {
|
|
@@ -219,9 +605,9 @@ function deserializeWell(jsonString) {
|
|
|
219
605
|
throw new Error("Invalid profile format");
|
|
220
606
|
}
|
|
221
607
|
if (typeof raw.version === "number") {
|
|
222
|
-
if (raw.version
|
|
223
|
-
|
|
224
|
-
|
|
608
|
+
if (raw.version === 2) return withCalculatedWellDepth(decodeV2Well(raw));
|
|
609
|
+
if (raw.version === 1) return withCalculatedWellDepth(decodeV1Well(raw));
|
|
610
|
+
throw new Error(`Unsupported .well format version: ${raw.version}`);
|
|
225
611
|
}
|
|
226
612
|
if (isWellEmpty(raw)) return null;
|
|
227
613
|
const constructiveSource = raw.constructive ?? raw;
|
|
@@ -239,31 +625,452 @@ function deserializeWell(jsonString) {
|
|
|
239
625
|
...raw.elevation !== void 0 && { elevation: raw.elevation },
|
|
240
626
|
...raw.obs !== void 0 && { obs: raw.obs }
|
|
241
627
|
};
|
|
242
|
-
return {
|
|
628
|
+
return withCalculatedWellDepth({
|
|
243
629
|
...createEmptyWell(),
|
|
244
630
|
...metadata,
|
|
245
631
|
...normalizeConstructive(constructiveSource),
|
|
246
632
|
...normalizeGeologic(raw)
|
|
247
|
-
};
|
|
633
|
+
});
|
|
248
634
|
}
|
|
249
635
|
var profileToWell = serializeWell;
|
|
250
636
|
var checkIfProfileIsEmpty = isWellEmpty;
|
|
251
637
|
var convertProfileFromJSON = deserializeWell;
|
|
638
|
+
|
|
639
|
+
// src/utils/fgdc.textures.ts
|
|
640
|
+
var FGDC_TEXTURES_OPTIONS = [
|
|
641
|
+
// --- Surficial Patterns (Series 100) ---
|
|
642
|
+
{ code: 101, label: "Unconsolidated material", pending: true },
|
|
643
|
+
{ code: 102, label: "Alluvium", pending: true },
|
|
644
|
+
{ code: 103, label: "Terrace deposit", pending: true },
|
|
645
|
+
{ code: 104, label: "Floodplain deposit", pending: true },
|
|
646
|
+
{ code: 105, label: "Fan or pediment deposit", pending: true },
|
|
647
|
+
{ code: 106, label: "Eolian sand", pending: true },
|
|
648
|
+
{ code: 107, label: "Silt or loess", pending: true },
|
|
649
|
+
{ code: 108, label: "Clay deposit", pending: true },
|
|
650
|
+
{ code: 109, label: "Colluvium", pending: true },
|
|
651
|
+
{ code: 110, label: "Gravel deposit", pending: true },
|
|
652
|
+
{ code: 111, label: "Residual deposit", pending: true },
|
|
653
|
+
{ code: 112, label: "Playa deposit", pending: true },
|
|
654
|
+
{ code: 113, label: "Lacustrine deposit", pending: true },
|
|
655
|
+
{ code: 114, label: "Marine deposit", pending: true },
|
|
656
|
+
{ code: 115, label: "Beach or bar deposit", pending: true },
|
|
657
|
+
{ code: 116, label: "Organic deposit or peat", pending: true },
|
|
658
|
+
{ code: 117, label: "Swamp or marsh deposit", pending: true },
|
|
659
|
+
{ code: 118, label: "Soil", pending: true },
|
|
660
|
+
{ code: 119, label: "Fill or artificial deposit", pending: true },
|
|
661
|
+
{ code: 120, label: "Surficial pattern 120" },
|
|
662
|
+
{ code: 121, label: "Surficial pattern 121", pending: true },
|
|
663
|
+
{ code: 122, label: "Surficial pattern 122", pending: true },
|
|
664
|
+
{ code: 123, label: "Surficial pattern 123" },
|
|
665
|
+
{ code: 124, label: "Surficial pattern 124", pending: true },
|
|
666
|
+
{ code: 125, label: "Surficial pattern 125", pending: true },
|
|
667
|
+
{ code: 126, label: "Surficial pattern 126", pending: true },
|
|
668
|
+
{ code: 127, label: "Surficial pattern 127", pending: true },
|
|
669
|
+
{ code: 128, label: "Surficial pattern 128", pending: true },
|
|
670
|
+
{ code: 129, label: "Surficial pattern 129", pending: true },
|
|
671
|
+
{ code: 130, label: "Surficial pattern 130", pending: true },
|
|
672
|
+
{ code: 131, label: "Surficial pattern 131", pending: true },
|
|
673
|
+
{ code: 132, label: "Surficial pattern 132" },
|
|
674
|
+
{ code: 133, label: "Surficial pattern 133", pending: true },
|
|
675
|
+
{ code: 134, label: "Surficial pattern 134", pending: true },
|
|
676
|
+
{ code: 135, label: "Surficial pattern 135", pending: true },
|
|
677
|
+
{ code: 136, label: "Surficial pattern 136", pending: true },
|
|
678
|
+
{ code: 137, label: "Surficial pattern 137", pending: true },
|
|
679
|
+
// --- Sedimentary Patterns (Series 200) ---
|
|
680
|
+
{ code: 201, label: "Sedimentary pattern 201", pending: true },
|
|
681
|
+
{ code: 202, label: "Sedimentary pattern 202", pending: true },
|
|
682
|
+
{ code: 203, label: "Sedimentary pattern 203", pending: true },
|
|
683
|
+
{ code: 204, label: "Sedimentary pattern 204", pending: true },
|
|
684
|
+
{ code: 205, label: "Sedimentary pattern 205", pending: true },
|
|
685
|
+
{ code: 206, label: "Sedimentary pattern 206", pending: true },
|
|
686
|
+
{ code: 207, label: "Sedimentary pattern 207", pending: true },
|
|
687
|
+
{ code: 208, label: "Sedimentary pattern 208", pending: true },
|
|
688
|
+
{ code: 209, label: "Sedimentary pattern 209", pending: true },
|
|
689
|
+
{ code: 210, label: "Sedimentary pattern 210", pending: true },
|
|
690
|
+
{ code: 211, label: "Sedimentary pattern 211", pending: true },
|
|
691
|
+
{ code: 212, label: "Sedimentary pattern 212", pending: true },
|
|
692
|
+
{ code: 213, label: "Sedimentary pattern 213", pending: true },
|
|
693
|
+
{ code: 214, label: "Sedimentary pattern 214", pending: true },
|
|
694
|
+
{ code: 215, label: "Sedimentary pattern 215", pending: true },
|
|
695
|
+
{ code: 216, label: "Sedimentary pattern 216", pending: true },
|
|
696
|
+
{ code: 217, label: "Sedimentary pattern 217", pending: true },
|
|
697
|
+
{ code: 218, label: "Sedimentary pattern 218", pending: true },
|
|
698
|
+
{ code: 219, label: "Sedimentary pattern 219", pending: true },
|
|
699
|
+
{ code: 220, label: "Sedimentary pattern 220", pending: true },
|
|
700
|
+
{ code: 221, label: "Sedimentary pattern 221", pending: true },
|
|
701
|
+
{ code: 222, label: "Sedimentary pattern 222", pending: true },
|
|
702
|
+
{ code: 223, label: "Sedimentary pattern 223", pending: true },
|
|
703
|
+
{ code: 224, label: "Sedimentary pattern 224", pending: true },
|
|
704
|
+
{ code: 225, label: "Sedimentary pattern 225", pending: true },
|
|
705
|
+
{ code: 226, label: "Sedimentary pattern 226", pending: true },
|
|
706
|
+
{ code: 227, label: "Sedimentary pattern 227", pending: true },
|
|
707
|
+
{ code: 228, label: "Sedimentary pattern 228", pending: true },
|
|
708
|
+
{ code: 229, label: "Sedimentary pattern 229", pending: true },
|
|
709
|
+
{ code: 230, label: "Sedimentary pattern 230", pending: true },
|
|
710
|
+
{ code: 231, label: "Sedimentary pattern 231", pending: true },
|
|
711
|
+
{ code: 232, label: "Sedimentary pattern 232", pending: true },
|
|
712
|
+
{ code: 233, label: "Sedimentary pattern 233", pending: true },
|
|
713
|
+
// --- Igneous Patterns (Series 300) ---
|
|
714
|
+
{ code: 301, label: "Igneous pattern 301", pending: true },
|
|
715
|
+
{ code: 302, label: "Igneous pattern 302", pending: true },
|
|
716
|
+
{ code: 303, label: "Igneous pattern 303", pending: true },
|
|
717
|
+
{ code: 304, label: "Igneous pattern 304", pending: true },
|
|
718
|
+
{ code: 305, label: "Igneous pattern 305", pending: true },
|
|
719
|
+
{ code: 306, label: "Igneous pattern 306", pending: true },
|
|
720
|
+
{ code: 307, label: "Igneous pattern 307", pending: true },
|
|
721
|
+
{ code: 308, label: "Igneous pattern 308", pending: true },
|
|
722
|
+
{ code: 309, label: "Igneous pattern 309", pending: true },
|
|
723
|
+
{ code: 310, label: "Igneous pattern 310", pending: true },
|
|
724
|
+
{ code: 311, label: "Igneous pattern 311", pending: true },
|
|
725
|
+
{ code: 312, label: "Igneous pattern 312", pending: true },
|
|
726
|
+
{ code: 313, label: "Igneous pattern 313", pending: true },
|
|
727
|
+
{ code: 314, label: "Igneous pattern 314", pending: true },
|
|
728
|
+
{ code: 315, label: "Igneous pattern 315", pending: true },
|
|
729
|
+
{ code: 316, label: "Igneous pattern 316", pending: true },
|
|
730
|
+
{ code: 317, label: "Igneous pattern 317", pending: true },
|
|
731
|
+
{ code: 318, label: "Igneous pattern 318", pending: true },
|
|
732
|
+
{ code: 319, label: "Igneous pattern 319", pending: true },
|
|
733
|
+
{ code: 320, label: "Igneous pattern 320", pending: true },
|
|
734
|
+
{ code: 321, label: "Igneous pattern 321", pending: true },
|
|
735
|
+
{ code: 322, label: "Igneous pattern 322", pending: true },
|
|
736
|
+
{ code: 323, label: "Igneous pattern 323", pending: true },
|
|
737
|
+
{ code: 324, label: "Igneous pattern 324", pending: true },
|
|
738
|
+
{ code: 325, label: "Igneous pattern 325", pending: true },
|
|
739
|
+
{ code: 326, label: "Igneous pattern 326", pending: true },
|
|
740
|
+
{ code: 327, label: "Igneous pattern 327", pending: true },
|
|
741
|
+
{ code: 328, label: "Igneous pattern 328", pending: true },
|
|
742
|
+
{ code: 329, label: "Igneous pattern 329", pending: true },
|
|
743
|
+
{ code: 330, label: "Igneous pattern 330", pending: true },
|
|
744
|
+
{ code: 331, label: "Igneous pattern 331", pending: true },
|
|
745
|
+
// --- Miscellaneous and Metamorphic Patterns (Series 400) ---
|
|
746
|
+
{ code: 401, label: "Miscellaneous pattern 401", pending: true },
|
|
747
|
+
{ code: 402, label: "Miscellaneous pattern 402", pending: true },
|
|
748
|
+
{ code: 403, label: "Miscellaneous pattern 403", pending: true },
|
|
749
|
+
{ code: 404, label: "Miscellaneous pattern 404", pending: true },
|
|
750
|
+
{ code: 405, label: "Miscellaneous pattern 405", pending: true },
|
|
751
|
+
{ code: 406, label: "Miscellaneous pattern 406", pending: true },
|
|
752
|
+
{ code: 407, label: "Miscellaneous pattern 407", pending: true },
|
|
753
|
+
{ code: 408, label: "Miscellaneous pattern 408", pending: true },
|
|
754
|
+
{ code: 409, label: "Miscellaneous pattern 409", pending: true },
|
|
755
|
+
{ code: 410, label: "Miscellaneous pattern 410", pending: true },
|
|
756
|
+
{ code: 411, label: "Miscellaneous pattern 411", pending: true },
|
|
757
|
+
{ code: 412, label: "Miscellaneous pattern 412", pending: true },
|
|
758
|
+
{ code: 413, label: "Miscellaneous pattern 413", pending: true },
|
|
759
|
+
{ code: 414, label: "Miscellaneous pattern 414", pending: true },
|
|
760
|
+
{ code: 415, label: "Miscellaneous pattern 415", pending: true },
|
|
761
|
+
{ code: 416, label: "Miscellaneous pattern 416", pending: true },
|
|
762
|
+
{ code: 417, label: "Miscellaneous pattern 417", pending: true },
|
|
763
|
+
{ code: 418, label: "Miscellaneous pattern 418", pending: true },
|
|
764
|
+
{ code: 419, label: "Miscellaneous pattern 419", pending: true },
|
|
765
|
+
{ code: 420, label: "Miscellaneous pattern 420", pending: true },
|
|
766
|
+
{ code: 421, label: "Miscellaneous pattern 421", pending: true },
|
|
767
|
+
{ code: 422, label: "Miscellaneous pattern 422", pending: true },
|
|
768
|
+
{ code: 423, label: "Miscellaneous pattern 423", pending: true },
|
|
769
|
+
{ code: 424, label: "Miscellaneous pattern 424", pending: true },
|
|
770
|
+
{ code: 425, label: "Miscellaneous pattern 425", pending: true },
|
|
771
|
+
{ code: 426, label: "Miscellaneous pattern 426", pending: true },
|
|
772
|
+
{ code: 427, label: "Miscellaneous pattern 427", pending: true },
|
|
773
|
+
{ code: 428, label: "Miscellaneous pattern 428", pending: true },
|
|
774
|
+
{ code: 429, label: "Miscellaneous pattern 429", pending: true },
|
|
775
|
+
{ code: 430, label: "Miscellaneous pattern 430", pending: true },
|
|
776
|
+
{ code: 431, label: "Miscellaneous pattern 431", pending: true },
|
|
777
|
+
{ code: 432, label: "Miscellaneous pattern 432", pending: true },
|
|
778
|
+
{ code: 433, label: "Miscellaneous pattern 433", pending: true },
|
|
779
|
+
{ code: 434, label: "Miscellaneous pattern 434", pending: true },
|
|
780
|
+
{ code: 435, label: "Miscellaneous pattern 435", pending: true },
|
|
781
|
+
{ code: 436, label: "Miscellaneous pattern 436", pending: true },
|
|
782
|
+
// --- Glacial Patterns (Series 500) ---
|
|
783
|
+
{ code: 521, label: "Glacial pattern 521", pending: true },
|
|
784
|
+
{ code: 522, label: "Glacial pattern 522", pending: true },
|
|
785
|
+
{ code: 523, label: "Glacial pattern 523", pending: true },
|
|
786
|
+
{ code: 524, label: "Glacial pattern 524", pending: true },
|
|
787
|
+
{ code: 530, label: "Glacial pattern 530", pending: true },
|
|
788
|
+
{ code: 531, label: "Glacial pattern 531", pending: true },
|
|
789
|
+
{ code: 532, label: "Glacial pattern 532", pending: true },
|
|
790
|
+
{ code: 533, label: "Glacial pattern 533", pending: true },
|
|
791
|
+
{ code: 534, label: "Glacial pattern 534", pending: true },
|
|
792
|
+
{ code: 535, label: "Glacial pattern 535", pending: true },
|
|
793
|
+
{ code: 536, label: "Glacial pattern 536", pending: true },
|
|
794
|
+
{ code: 537, label: "Glacial pattern 537", pending: true },
|
|
795
|
+
{ code: 538, label: "Glacial pattern 538", pending: true },
|
|
796
|
+
{ code: 580, label: "Glacial pattern 580", pending: true },
|
|
797
|
+
{ code: 581, label: "Glacial pattern 581", pending: true },
|
|
798
|
+
{ code: 582, label: "Glacial pattern 582", pending: true },
|
|
799
|
+
{ code: 583, label: "Glacial pattern 583", pending: true },
|
|
800
|
+
{ code: 584, label: "Glacial pattern 584", pending: true },
|
|
801
|
+
{ code: 585, label: "Glacial pattern 585", pending: true },
|
|
802
|
+
{ code: 586, label: "Glacial pattern 586", pending: true },
|
|
803
|
+
{ code: 587, label: "Glacial pattern 587", pending: true },
|
|
804
|
+
{ code: 588, label: "Glacial pattern 588", pending: true },
|
|
805
|
+
{ code: 589, label: "Glacial pattern 589", pending: true },
|
|
806
|
+
{ code: 591, label: "Periglacial pattern 591", pending: true },
|
|
807
|
+
{ code: 592, label: "Periglacial pattern 592", pending: true },
|
|
808
|
+
{ code: 593, label: "Periglacial pattern 593", pending: true },
|
|
809
|
+
{ code: 594, label: "Periglacial pattern 594", pending: true },
|
|
810
|
+
{ code: 595, label: "Periglacial pattern 595", pending: true },
|
|
811
|
+
// --- Sedimentary Lithology Patterns (Series 600) ---
|
|
812
|
+
{ code: 601, label: "Gravel or conglomerate (1st option)" },
|
|
813
|
+
{ code: 602, label: "Gravel or conglomerate (2nd option)" },
|
|
814
|
+
{ code: 603, label: "Crossbedded gravel or conglomerate" },
|
|
815
|
+
{ code: 605, label: "Breccia (1st option)" },
|
|
816
|
+
{ code: 606, label: "Breccia (2nd option)" },
|
|
817
|
+
{ code: 607, label: "Massive sand or sandstone" },
|
|
818
|
+
{ code: 608, label: "Bedded sand or sandstone" },
|
|
819
|
+
{ code: 609, label: "Crossbedded sand or sandstone (1st option)" },
|
|
820
|
+
{ code: 610, label: "Crossbedded sand or sandstone (2nd option)" },
|
|
821
|
+
{ code: 611, label: "Ripple-bedded sand or sandstone" },
|
|
822
|
+
{ code: 612, label: "Argillaceous or shaly sandstone" },
|
|
823
|
+
{ code: 613, label: "Calcareous sandstone" },
|
|
824
|
+
{ code: 614, label: "Dolomitic sandstone" },
|
|
825
|
+
{ code: 616, label: "Silt, siltstone, or shaly silt" },
|
|
826
|
+
{ code: 617, label: "Calcareous siltstone" },
|
|
827
|
+
{ code: 618, label: "Dolomitic siltstone" },
|
|
828
|
+
{ code: 619, label: "Sandy or silty shale" },
|
|
829
|
+
{ code: 620, label: "Clay or clay shale" },
|
|
830
|
+
{ code: 621, label: "Cherty shale" },
|
|
831
|
+
{ code: 622, label: "Dolomitic shale" },
|
|
832
|
+
{ code: 623, label: "Calcareous shale or marl" },
|
|
833
|
+
{ code: 624, label: "Carbonaceous shale" },
|
|
834
|
+
{ code: 625, label: "Oil shale" },
|
|
835
|
+
{ code: 626, label: "Chalk" },
|
|
836
|
+
{ code: 627, label: "Limestone" },
|
|
837
|
+
{ code: 628, label: "Clastic limestone" },
|
|
838
|
+
{ code: 629, label: "Fossiliferous clastic limestone" },
|
|
839
|
+
{ code: 630, label: "Nodular or irregularly bedded limestone" },
|
|
840
|
+
{
|
|
841
|
+
code: 631,
|
|
842
|
+
label: "Limestone, irregular (burrow?) fillings of saccharoidal dolomite"
|
|
843
|
+
},
|
|
844
|
+
{ code: 632, label: "Crossbedded limestone" },
|
|
845
|
+
{ code: 633, label: "Cherty crossbedded limestone" },
|
|
846
|
+
{ code: 634, label: "Cherty and sandy crossbedded clastic limestone" },
|
|
847
|
+
{ code: 635, label: "Oolitic limestone" },
|
|
848
|
+
{ code: 636, label: "Sandy limestone" },
|
|
849
|
+
{ code: 637, label: "Silty limestone" },
|
|
850
|
+
{ code: 638, label: "Argillaceous or shaly limestone" },
|
|
851
|
+
{ code: 639, label: "Cherty limestone (1st option)" },
|
|
852
|
+
{ code: 640, label: "Cherty limestone (2nd option)" },
|
|
853
|
+
{ code: 641, label: "Dolomitic limestone, limy dolostone, or limy dolomite" },
|
|
854
|
+
{ code: 642, label: "Dolostone or dolomite" },
|
|
855
|
+
{ code: 643, label: "Crossbedded dolostone or dolomite" },
|
|
856
|
+
{ code: 644, label: "Oolitic dolostone or dolomite" },
|
|
857
|
+
{ code: 645, label: "Sandy dolostone or dolomite" },
|
|
858
|
+
{ code: 646, label: "Silty dolostone or dolomite" },
|
|
859
|
+
{ code: 647, label: "Argillaceous or shaly dolostone or dolomite" },
|
|
860
|
+
{ code: 648, label: "Cherty dolostone or dolomite" },
|
|
861
|
+
{ code: 649, label: "Bedded chert (1st option)" },
|
|
862
|
+
{ code: 650, label: "Bedded chert (2nd option)" },
|
|
863
|
+
{ code: 651, label: "Fossiliferous bedded chert" },
|
|
864
|
+
{ code: 652, label: "Fossiliferous rock" },
|
|
865
|
+
{ code: 653, label: "Diatomaceous rock" },
|
|
866
|
+
{ code: 654, label: "Subgraywacke" },
|
|
867
|
+
{ code: 655, label: "Crossbedded subgraywacke" },
|
|
868
|
+
{ code: 656, label: "Ripple-bedded subgraywacke" },
|
|
869
|
+
{ code: 657, label: "Peat" },
|
|
870
|
+
{ code: 658, label: "Coal" },
|
|
871
|
+
{ code: 659, label: "Bony coal or impure coal" },
|
|
872
|
+
{ code: 660, label: "Underclay" },
|
|
873
|
+
{ code: 661, label: "Flint clay" },
|
|
874
|
+
{ code: 662, label: "Bentonite" },
|
|
875
|
+
{ code: 663, label: "Glauconite" },
|
|
876
|
+
{ code: 664, label: "Limonite" },
|
|
877
|
+
{ code: 665, label: "Siderite" },
|
|
878
|
+
{ code: 666, label: "Phosphatic-nodular rock" },
|
|
879
|
+
{ code: 667, label: "Gypsum" },
|
|
880
|
+
{ code: 668, label: "Salt" },
|
|
881
|
+
{ code: 669, label: "Interbedded sandstone and siltstone" },
|
|
882
|
+
{ code: 670, label: "Interbedded sandstone and shale" },
|
|
883
|
+
{ code: 671, label: "Interbedded ripple-bedded sandstone and shale" },
|
|
884
|
+
{
|
|
885
|
+
code: 672,
|
|
886
|
+
label: "Interbedded shale and silty limestone (shale dominant)"
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
code: 673,
|
|
890
|
+
label: "Interbedded shale and limestone, shale dominant (1st option)"
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
code: 674,
|
|
894
|
+
label: "Interbedded shale and limestone, shale dominant (2nd option)"
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
code: 675,
|
|
898
|
+
label: "Interbedded calcareous shale and limestone (shale dominant)"
|
|
899
|
+
},
|
|
900
|
+
{ code: 676, label: "Interbedded silty limestone and shale" },
|
|
901
|
+
{ code: 677, label: "Interbedded limestone and shale (1st option)" },
|
|
902
|
+
{ code: 678, label: "Interbedded limestone and shale (2nd option)" },
|
|
903
|
+
{ code: 679, label: "Interbedded limestone and shale (limestone dominant)" },
|
|
904
|
+
{ code: 680, label: "Interbedded limestone and calcareous shale" },
|
|
905
|
+
{ code: 681, label: "Till or diamicton (1st option)" },
|
|
906
|
+
{ code: 682, label: "Till or diamicton (2nd option)" },
|
|
907
|
+
{ code: 683, label: "Till or diamicton (3rd option)" },
|
|
908
|
+
{ code: 684, label: "Loess (1st option)" },
|
|
909
|
+
{ code: 685, label: "Loess (2nd option)" },
|
|
910
|
+
{ code: 686, label: "Loess (3rd option)" },
|
|
911
|
+
// --- Metamorphic Lithology Patterns (Series 700) ---
|
|
912
|
+
{ code: 701, label: "Metamorphism" },
|
|
913
|
+
{ code: 702, label: "Quartzite" },
|
|
914
|
+
{ code: 703, label: "Slate" },
|
|
915
|
+
{ code: 704, label: "Schistose or gneissoid granite" },
|
|
916
|
+
{ code: 705, label: "Schist" },
|
|
917
|
+
{ code: 706, label: "Contorted schist" },
|
|
918
|
+
{ code: 707, label: "Schist and gneiss" },
|
|
919
|
+
{ code: 708, label: "Gneiss" },
|
|
920
|
+
{ code: 709, label: "Contorted gneiss" },
|
|
921
|
+
{ code: 710, label: "Soapstone, talc, or serpentinite" },
|
|
922
|
+
// --- Igneous and Vein-Matter Lithology Patterns (Series 700 continued) ---
|
|
923
|
+
{ code: 711, label: "Tuffaceous rock" },
|
|
924
|
+
{ code: 712, label: "Crystal tuff" },
|
|
925
|
+
{ code: 713, label: "Devitrified tuff" },
|
|
926
|
+
{ code: 714, label: "Volcanic breccia and tuff" },
|
|
927
|
+
{ code: 715, label: "Volcanic breccia or agglomerate" },
|
|
928
|
+
{ code: 716, label: "Zeolitic rock" },
|
|
929
|
+
{ code: 717, label: "Basaltic flows" },
|
|
930
|
+
{ code: 718, label: "Granite (1st option)" },
|
|
931
|
+
{ code: 719, label: "Granite (2nd option)" },
|
|
932
|
+
{ code: 720, label: "Banded igneous rock" },
|
|
933
|
+
{ code: 721, label: "Igneous rock (1st option)" },
|
|
934
|
+
{ code: 722, label: "Igneous rock (2nd option)" },
|
|
935
|
+
{ code: 723, label: "Igneous rock (3rd option)" },
|
|
936
|
+
{ code: 724, label: "Igneous rock (4th option)" },
|
|
937
|
+
{ code: 725, label: "Igneous rock (5th option)" },
|
|
938
|
+
{ code: 726, label: "Igneous rock (6th option)" },
|
|
939
|
+
{ code: 727, label: "Igneous rock (7th option)" },
|
|
940
|
+
{ code: 728, label: "Igneous rock (8th option)" },
|
|
941
|
+
{ code: 729, label: "Porphyritic rock (1st option)" },
|
|
942
|
+
{ code: 730, label: "Porphyritic rock (2nd option)" },
|
|
943
|
+
{ code: 731, label: "Vitrophyre" },
|
|
944
|
+
{ code: 732, label: "Quartz" },
|
|
945
|
+
{ code: 733, label: "Ore" }
|
|
946
|
+
];
|
|
947
|
+
|
|
948
|
+
// src/utils/units.ts
|
|
949
|
+
var FEET_PER_METER = 3.280839895;
|
|
950
|
+
var METERS_PER_FOOT = 0.3048;
|
|
951
|
+
var MM_PER_INCH = 25.4;
|
|
952
|
+
var M3H_TO_LS = 1 / 3.6;
|
|
953
|
+
var M3H_TO_USGPM = 4.402867361;
|
|
954
|
+
var M2S_TO_M2D = 86400;
|
|
955
|
+
var PSI_PER_KPA = 0.145037738;
|
|
956
|
+
var SLOT_MM = 0.0254;
|
|
957
|
+
function metersToFeet(m) {
|
|
958
|
+
return m * FEET_PER_METER;
|
|
959
|
+
}
|
|
960
|
+
function feetToMeters(ft) {
|
|
961
|
+
return ft * METERS_PER_FOOT;
|
|
962
|
+
}
|
|
963
|
+
function mmToInches(mm) {
|
|
964
|
+
return mm / MM_PER_INCH;
|
|
965
|
+
}
|
|
966
|
+
function inchesToMm(inches) {
|
|
967
|
+
return inches * MM_PER_INCH;
|
|
968
|
+
}
|
|
969
|
+
function cubicMeterPerHourToLitersPerSecond(q) {
|
|
970
|
+
return q * M3H_TO_LS;
|
|
971
|
+
}
|
|
972
|
+
function litersPerSecondToCubicMeterPerHour(q) {
|
|
973
|
+
return q / M3H_TO_LS;
|
|
974
|
+
}
|
|
975
|
+
function cubicMeterPerHourToUsGallonsPerMinute(q) {
|
|
976
|
+
return q * M3H_TO_USGPM;
|
|
977
|
+
}
|
|
978
|
+
function usGallonsPerMinuteToCubicMeterPerHour(q) {
|
|
979
|
+
return q / M3H_TO_USGPM;
|
|
980
|
+
}
|
|
981
|
+
function squareMeterPerSecondToSquareMeterPerDay(t) {
|
|
982
|
+
return t * M2S_TO_M2D;
|
|
983
|
+
}
|
|
984
|
+
function squareMeterPerDayToSquareMeterPerSecond(t) {
|
|
985
|
+
return t / M2S_TO_M2D;
|
|
986
|
+
}
|
|
987
|
+
function decimalDegreesToDms(degrees, axis = "lat") {
|
|
988
|
+
const abs = Math.abs(degrees);
|
|
989
|
+
const d = Math.floor(abs);
|
|
990
|
+
const minFloat = (abs - d) * 60;
|
|
991
|
+
const m = Math.floor(minFloat);
|
|
992
|
+
const s = (minFloat - m) * 60;
|
|
993
|
+
const direction = axis === "lat" ? degrees >= 0 ? "N" : "S" : degrees >= 0 ? "E" : "W";
|
|
994
|
+
return { degrees: d, minutes: m, seconds: s, direction };
|
|
995
|
+
}
|
|
996
|
+
function dmsToDecimalDegrees(dms) {
|
|
997
|
+
const abs = dms.degrees + dms.minutes / 60 + dms.seconds / 3600;
|
|
998
|
+
return dms.direction === "S" || dms.direction === "W" ? -abs : abs;
|
|
999
|
+
}
|
|
1000
|
+
function slotNumberToMm(slotNumber) {
|
|
1001
|
+
return slotNumber * SLOT_MM;
|
|
1002
|
+
}
|
|
1003
|
+
function mmToSlotNumber(mm) {
|
|
1004
|
+
return Math.round(mm / SLOT_MM);
|
|
1005
|
+
}
|
|
1006
|
+
function kilopascalToPsi(kPa) {
|
|
1007
|
+
return kPa * PSI_PER_KPA;
|
|
1008
|
+
}
|
|
1009
|
+
function psiToKilopascal(psi) {
|
|
1010
|
+
return psi / PSI_PER_KPA;
|
|
1011
|
+
}
|
|
1012
|
+
function minutesToHours(min) {
|
|
1013
|
+
return min / 60;
|
|
1014
|
+
}
|
|
1015
|
+
function hoursToMinutes(h) {
|
|
1016
|
+
return h * 60;
|
|
1017
|
+
}
|
|
252
1018
|
export {
|
|
1019
|
+
AirliftEventSchema,
|
|
1020
|
+
AquiferAnalysisSchema,
|
|
1021
|
+
AttachmentSchema,
|
|
253
1022
|
BoreHoleSchema,
|
|
254
1023
|
CaveSchema,
|
|
255
1024
|
CementPadSchema,
|
|
1025
|
+
ConstantRateEventSchema,
|
|
1026
|
+
FGDC_TEXTURES_OPTIONS,
|
|
256
1027
|
FractureSchema,
|
|
1028
|
+
HistoryLogEntrySchema,
|
|
257
1029
|
HoleFillSchema,
|
|
1030
|
+
HydrodynamicEventBaseSchema,
|
|
1031
|
+
HydrodynamicEventSchema,
|
|
1032
|
+
LevelReadingSchema,
|
|
258
1033
|
LithologySchema,
|
|
1034
|
+
LocationPropertiesSchema,
|
|
1035
|
+
LocationSchema,
|
|
1036
|
+
PumpingStepSchema,
|
|
1037
|
+
RecoveryOnlyEventSchema,
|
|
1038
|
+
RecoveryPhaseSchema,
|
|
259
1039
|
ReductionSchema,
|
|
1040
|
+
SECTION_KEYS,
|
|
1041
|
+
SpotMeasurementEventSchema,
|
|
1042
|
+
StepDrawdownEventSchema,
|
|
260
1043
|
SurfaceCaseSchema,
|
|
1044
|
+
TextureSchema,
|
|
261
1045
|
WellCaseSchema,
|
|
1046
|
+
WellIdSchema,
|
|
262
1047
|
WellSchema,
|
|
263
1048
|
WellScreenSchema,
|
|
264
1049
|
checkIfProfileIsEmpty,
|
|
265
1050
|
convertProfileFromJSON,
|
|
1051
|
+
cubicMeterPerHourToLitersPerSecond,
|
|
1052
|
+
cubicMeterPerHourToUsGallonsPerMinute,
|
|
1053
|
+
decimalDegreesToDms,
|
|
1054
|
+
deserializeWell,
|
|
1055
|
+
dmsToDecimalDegrees,
|
|
1056
|
+
feetToMeters,
|
|
1057
|
+
hoursToMinutes,
|
|
1058
|
+
inchesToMm,
|
|
1059
|
+
isWellEmpty,
|
|
1060
|
+
kilopascalToPsi,
|
|
1061
|
+
litersPerSecondToCubicMeterPerHour,
|
|
1062
|
+
metersToFeet,
|
|
1063
|
+
minutesToHours,
|
|
1064
|
+
mmToInches,
|
|
1065
|
+
mmToSlotNumber,
|
|
266
1066
|
parseWell,
|
|
267
|
-
profileToWell
|
|
1067
|
+
profileToWell,
|
|
1068
|
+
psiToKilopascal,
|
|
1069
|
+
redactWell,
|
|
1070
|
+
serializeWell,
|
|
1071
|
+
slotNumberToMm,
|
|
1072
|
+
squareMeterPerDayToSquareMeterPerSecond,
|
|
1073
|
+
squareMeterPerSecondToSquareMeterPerDay,
|
|
1074
|
+
usGallonsPerMinuteToCubicMeterPerHour
|
|
268
1075
|
};
|
|
269
1076
|
//# sourceMappingURL=index.js.map
|