-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
1275 lines (1134 loc) · 38.6 KB
/
index.ts
File metadata and controls
1275 lines (1134 loc) · 38.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Type definitions for BRO/XML parser
*/
/**
* Namespace mapping (prefix -> URI)
*/
export type Namespaces = Record<string, string>;
/**
* Metadata about the parsed document
*
* Contains schema version information and any warnings
* encountered during parsing.
*/
export interface ParseMeta {
/**
* Schema version detected in the document (e.g., "1.1", "2.0")
*/
schemaVersion: string;
/**
* Full namespace URI of the schema
*/
schemaNamespace: string;
/**
* Data type detected (CPT, BHR-GT, BHR-G)
*/
dataType: "CPT" | "BHR-GT" | "BHR-G";
/**
* Warnings encountered during parsing
*
* Non-fatal issues like:
* - Parsing with older/newer minor version than supported
* - Optional fields with unexpected formats
*/
warnings: Array<string>;
}
/**
* XML adapter interface for cross-runtime compatibility
*/
export interface XMLAdapter {
parseXML(xmlText: string): Document;
evaluateXPath(
doc: Document | Node,
query: string,
namespaceResolver: (prefix: string | null) => string | null,
): Node | null;
evaluateXPathAll(
doc: Document | Node,
query: string,
namespaceResolver: (prefix: string | null) => string | null,
): Array<Node>;
}
/**
* Context passed to resolver functions
*/
export interface ResolverContext {
node: Node;
element: Node;
namespaces: Namespaces;
adapter: XMLAdapter;
}
/**
* Resolver function type
*/
export type ResolverFunction = (value: string | null, context: ResolverContext) => unknown;
/**
* Schema field definition
*/
export interface SchemaField {
xpath: string;
resolver?: ResolverFunction;
attribute?: string;
required?: boolean;
}
/**
* Schema definition (field name -> field config)
*/
export type Schema = Record<string, SchemaField>;
/**
* BRO quality regime
*
* IMBRO: Strict regime for new data (all mandatory fields required)
* IMBRO/A: Relaxed regime for historical/legacy data (allows missing fields)
*/
export type QualityRegime = "IMBRO" | "IMBRO/A";
/**
* Geographic location with coordinates and EPSG code
*/
export interface Location {
x: number;
y: number;
epsg: string;
}
/**
* Layer of material removed before CPT was performed (e.g. asphalt, gravel fill)
*
* Found in additionalInvestigation. Directly affects depth interpretation.
*/
export interface RemovedLayer {
sequenceNumber: number;
upperBoundary: number;
lowerBoundary: number;
description: string | null;
}
/**
* CPT measurement row (dynamic fields based on parameters)
*/
export interface CPTMeasurement {
// Always present
penetrationLength: number;
depth?: number;
// Core measurements
elapsedTime?: number;
coneResistance: number | null;
correctedConeResistance?: number | null;
netConeResistance?: number | null;
localFriction?: number | null;
frictionRatio?: number | null;
// Pore pressure
porePressureU1?: number | null;
porePressureU2?: number | null;
porePressureU3?: number | null;
poreRatio?: number | null;
// Inclination
inclinationX?: number | null;
inclinationY?: number | null;
inclinationEW?: number | null;
inclinationNS?: number | null;
inclinationResultant?: number | null;
// Magnetic field
magneticFieldStrengthX?: number | null;
magneticFieldStrengthY?: number | null;
magneticFieldStrengthZ?: number | null;
magneticFieldStrengthTotal?: number | null;
magneticInclination?: number | null;
magneticDeclination?: number | null;
// Other
electricalConductivity?: number | null;
temperature?: number | null;
}
/**
* Single measurement row in a dissipation test (pore pressure decay over time)
*/
export interface DissipationMeasurement {
elapsedTime: number;
coneResistance: number | null;
porePressureU1: number | null;
porePressureU2: number | null;
porePressureU3: number | null;
}
/**
* Dissipation test performed at a specific depth
*
* During a CPT, the cone can be paused at a given depth to measure
* pore pressure decay over time. A CPT can contain multiple dissipation tests.
*/
export interface DissipationTest {
penetrationLength: number;
phenomenonTime: Date | null;
measurements: Array<DissipationMeasurement>;
}
/**
* Complete CPT data (metadata + measurements)
*/
export interface CPTData {
/**
* Metadata about the parsed document (schema version, warnings)
*/
meta: ParseMeta;
// Core identification
broId: string | null;
/**
* User-defined identifier (not parsed from XML)
*
* Useful for tracking data that doesn't have a broId yet,
* such as during data collection or before BRO registration.
*
* @example
* ```typescript
* const cpt = parser.parseCPT(xmlString);
* cpt.alias = "Site A - Test 1";
* ```
*/
alias?: string;
/**
* BRO quality regime
*
* - IMBRO: Strict regime (all mandatory fields required)
* - IMBRO/A: Relaxed regime for historical data (allows missing fields)
*/
qualityRegime: QualityRegime | null;
researchReportDate: Date | null;
// Location
deliveredLocation: Location | null;
standardizedLocation: Location | null;
// Location provenance
/** Date horizontal position was determined */
horizontalPositioningDate: Date | null;
/** Method used to determine horizontal position (e.g., "onbekend", "GNSS") */
horizontalPositioningMethod: string | null;
// Vertical position
deliveredVerticalPositionOffset: number | null;
deliveredVerticalPositionDatum: string | null;
deliveredVerticalPositionReferencePoint: string | null;
/** Date vertical position was determined */
verticalPositioningDate: Date | null;
/** Method used to determine vertical position (e.g., "onbekend", "waterpassingKlasse2") */
verticalPositioningMethod: string | null;
// Survey context
/** Delivery context (e.g., "publiekeTaak", "archiefoverdracht") */
deliveryContext: string | null;
/** Survey purpose (e.g., "waterkering", "onbekend") */
surveyPurpose: string | null;
/** Whether additional investigation was performed alongside the CPT */
additionalInvestigationPerformed: boolean | null;
// Test metadata
cptStandard: string | null;
/** CPT method used (e.g., "elektrisch", "mechanisch") */
cptMethod: string | null;
/** Stop criterion for the test */
stopCriterion: string | null;
/** Azimuth orientation of the sensor (degrees from north) */
sensorAzimuth: number | null;
dissipationtestPerformed: boolean | null;
qualityClass: number | null;
predrilledDepth: number | null;
finalDepth: number | null;
groundwaterLevel: number | null;
// Additional investigation
/** Date of additional investigation (e.g. groundwater level measurement) */
investigationDate: Date | null;
/** Site conditions at time of investigation */
conditions: string | null;
/** Description of surface at CPT location */
surfaceDescription: string | null;
/** Layers removed before CPT (e.g. asphalt, gravel fill) - affects depth interpretation */
removedLayers: Array<RemovedLayer>;
// Processing flags
/** Date of final processing */
finalProcessingDate: Date | null;
/** Whether signal processing was performed */
signalProcessingPerformed: boolean | null;
/** Whether interruption processing was performed */
interruptionProcessingPerformed: boolean | null;
/** Whether expert correction was performed */
expertCorrectionPerformed: boolean | null;
// Equipment specifications
cptDescription: string | null;
cptType: string | null;
coneSurfaceArea: number | null;
coneDiameter: number | null;
coneSurfaceQuotient: number | null;
coneToFrictionSleeveDistance: number | null;
coneToFrictionSleeveSurfaceArea: number | null;
coneToFrictionSleeveSurfaceQuotient: number | null;
// Zero-load measurements (before/after calibration)
zlmConeResistanceBefore: number | null;
zlmConeResistanceAfter: number | null;
zlmInclinationEwBefore: number | null;
zlmInclinationEwAfter: number | null;
zlmInclinationNsBefore: number | null;
zlmInclinationNsAfter: number | null;
zlmInclinationResultantBefore: number | null;
zlmInclinationResultantAfter: number | null;
zlmLocalFrictionBefore: number | null;
zlmLocalFrictionAfter: number | null;
zlmPorePressureU1Before: number | null;
zlmPorePressureU2Before: number | null;
zlmPorePressureU3Before: number | null;
zlmPorePressureU1After: number | null;
zlmPorePressureU2After: number | null;
zlmPorePressureU3After: number | null;
/** Electrical conductivity before test (mS/m) - zero-load calibration */
zlmElectricalConductivityBefore: number | null;
/** Electrical conductivity after test (mS/m) - zero-load calibration */
zlmElectricalConductivityAfter: number | null;
// Measurement data
data: Array<CPTMeasurement>;
// Dissipation tests (pore pressure decay at specific depths)
dissipationTests: Array<DissipationTest>;
// Administrative history
registrationHistory: RegistrationHistory | null;
}
/**
* Grain shape properties for sand/gravel fractions
*/
export interface Grainshape {
/** Size fraction this shape applies to (e.g., "zand", "grind") */
sizeFraction: string | null;
/** Angularity of grains (e.g., "hoekig", "subhoekig", "afgerond") */
angularity: string | null;
/** Sphericity of grains (e.g., "bol", "plat", "langwerpig") */
sphericity: string | null;
}
/**
* BHR-GT (Borehole Research Geotechnical) layer data
*
* Contains all fields from the BRO BHR-GT schema for a single soil layer.
*/
export interface BHRGTLayer {
// Depth boundaries
upperBoundary: number;
lowerBoundary: number;
// Boundary determination method (how the boundary was positioned)
upperBoundaryDetermination?: string | null;
lowerBoundaryDetermination?: string | null;
// Layer properties
/** Whether the layer is anthropogenic (man-made) */
anthropogenic?: boolean | null;
// Soil classification
geotechnicalSoilName: string;
// Soil properties
/** Tertiary soil constituent (e.g., "schelpMateriaal", "plantenresten") */
tertiaryConstituent?: string | null;
/** Soil color code */
color?: string;
/** Dispersed inhomogeneity presence */
dispersedInhomogeneity?: boolean | null;
/** Organic matter content classification */
organicMatterContentClass?: string | null;
/** Carbonate content classification */
carbonateContentClass?: string | null;
/** Sand median grain size classification */
sandMedianClass?: string | null;
/** Grain shape properties (for sand/gravel) */
grainshape?: Grainshape;
// Layer structure properties
/** Whether the layer boundary is slanted */
slant?: boolean | null;
/** Whether the layer is bedded/stratified */
bedded?: boolean | null;
/** Whether the internal structure is intact (undisturbed) */
internalStructureIntact?: boolean | null;
/** Whether the soil is mixed */
mixed?: boolean | null;
/** Whether the soil has mottled appearance */
mottled?: boolean | null;
// Fine-grained soil properties
/** Consistency of fine-grained soils (e.g., "slap", "stevig", "vast") */
fineSoilConsistency?: string | null;
// Organic soil properties
/** Consistency of organic soils */
organicSoilConsistency?: string | null;
/** Texture of organic soils (e.g., "vezeligGrof", "vezeligFijn") */
organicSoilTexture?: string | null;
/** Tensile strength of peat */
peatTensileStrength?: string | null;
}
/**
* Complete Bore data (metadata + layers)
*
* Note: BHRGTData represents BHR-GT-BMB (Boormonsterbeschrijving - visual/textural description)
* For laboratory analysis data, see the optional `analysis` field (BHR-GT-BMA)
*/
export interface BHRGTData {
/**
* Metadata about the parsed document (schema version, warnings)
*/
meta: ParseMeta;
// Core identification
broId: string | null;
/**
* User-defined identifier (not parsed from XML)
*
* Useful for tracking data that doesn't have a broId yet,
* such as during data collection or before BRO registration.
*
* @example
* ```typescript
* const bore = parser.parseBHRGT(xmlString);
* bore.alias = "Borehole 7 - North Field";
* ```
*/
alias?: string;
/**
* BRO quality regime
*
* - IMBRO: Strict regime (all mandatory fields required)
* - IMBRO/A: Relaxed regime for historical data (allows missing fields)
*/
qualityRegime: QualityRegime | null;
researchReportDate: Date | null;
// Location
deliveredLocation: Location | null;
standardizedLocation: Location | null;
// Vertical position
deliveredVerticalPositionOffset: number | null;
deliveredVerticalPositionDatum: string | null;
deliveredVerticalPositionReferencePoint: string | null;
// Bore metadata
descriptionProcedure: string | null;
groundwaterLevel: number | null;
boreRockReached: boolean | null;
finalBoreDepth: number | null;
finalSampleDepth: number | null;
boreHoleCompleted: boolean | null;
// Boring execution details
/** Start date of the boring operation */
boringStartDate: Date | null;
/** End date of the boring operation */
boringEndDate: Date | null;
/** Boring procedure standard used (e.g., "EN1997d2v2007") */
boringProcedure: string | null;
/** Boring technique used (e.g., "gestoken", "mechanischGestoken") */
boringTechnique: string | null;
/** Whether the trajectory was excavated */
trajectoryExcavated: boolean | null;
/** Whether the subsurface is contaminated */
subsurfaceContaminated: boolean | null;
/** Stop criterion for boring */
stopCriterion: string | null;
// Sampler details
/** Type of sampler used */
samplerType: string | null;
/** Sampling procedure standard */
samplingProcedure: string | null;
/** Sampling method used */
samplingMethod: string | null;
/** Sampling quality assessment */
samplingQuality: string | null;
/** Whether the sample was orientated */
orientatedSampled: boolean | null;
// Sample container
/** Sample container diameter in mm */
sampleContainerDiameter: number | null;
/** Sample container length in mm */
sampleContainerLength: number | null;
// Sampler equipment details
/** Piston presence in sampler */
pistonPresent: boolean | null;
/** Core catcher presence */
coreCatcherPresent: boolean | null;
/** Stocking used in sampling */
stockingUsed: boolean | null;
/** Lubrication fluid used */
lubricationFluidUsed: boolean | null;
/** Right-angled cutting shoe */
rightAngledCuttingShoe: boolean | null;
/** Cutting shoe inside diameter in mm */
cuttingShoeInsideDiameter: number | null;
/** Cutting shoe outside diameter in mm */
cuttingShoeOutsideDiameter: number | null;
/** Taper angle of cutting shoe */
taperAngle: number | null;
// Description metadata
/** Whether the borehole log was checked */
boreholeLogChecked: boolean | null;
/** Description quality assessment */
descriptionQuality: string | null;
/** Description location (field/lab) */
descriptionLocation: string | null;
/** Date of description report */
descriptionReportDate: Date | null;
/** Described material type */
describedMaterial: string | null;
/** Whether sampling was continuous */
continuouslySampled: boolean | null;
/** Sample moistness during description */
sampleMoistness: string | null;
// Visual description data (BHR-GT-BMB)
data: Array<BHRGTLayer>;
// Laboratory analysis data (BHR-GT-BMA) - optional
analysis?: BoreholeSampleAnalysis;
// Boring interval details
/** Array of bored intervals with technique and diameter */
boredIntervals: Array<BoredInterval>;
/** Array of sampled intervals with method and quality */
sampledIntervals: Array<SampledInterval>;
/** Array of completed/backfilled intervals */
completedIntervals: Array<CompletedInterval>;
/** Array of intervals not described (with reason) */
notDescribedIntervals: Array<NotDescribedInterval>;
// Administrative history
/** BRO registration history */
registrationHistory: RegistrationHistory | null;
/** Report history with events */
reportHistory: ReportHistory | null;
// Additional top-level metadata
/** Delivery context (e.g., "publiekeTaak") */
deliveryContext: string | null;
/** Survey purpose (e.g., "bouwwerk") */
surveyPurpose: string | null;
/** Discipline (e.g., "geotechniek") */
discipline: string | null;
/** Survey procedure standard (e.g., "EN1997d2v2007") */
surveyProcedure: string | null;
/** Whether site characteristics were determined */
siteCharacteristicDetermined: boolean | null;
}
/**
* BHR-G (Geological Borehole) layer data
*
* Contains all fields from the BRO BHR-G schema for a single soil layer.
*/
export interface BHRGLayer {
// Depth boundaries
upperBoundary: number;
lowerBoundary: number;
// Boundary determination method (how the boundary was positioned)
upperBoundaryDetermination?: string | null;
lowerBoundaryDetermination?: string | null;
// Soil classification (NEN5104 standard)
soilNameNEN5104: string;
// Optional properties
color?: string;
/** Whether the layer is anthropogenic (man-made) - uses string codes in BHR-G (ja/nee/onbekend) */
anthropogenic?: string | null;
/** Whether the layer is rooted - uses string codes in BHR-G (ja/nee/onbekend) */
rooted?: string | null;
organicMatterContentClassNEN5104?: string | null;
gravelContentClass?: string | null;
carbonateContentClass?: string | null;
sandMedianClass?: string | null;
}
/**
* Complete BHR-G (Geological Borehole) data (metadata + layers)
*/
export interface BHRGData {
/**
* Metadata about the parsed document (schema version, warnings)
*/
meta: ParseMeta;
// Core identification
broId: string | null;
/**
* User-defined identifier (not parsed from XML)
*/
alias?: string;
/**
* BRO quality regime
*
* - IMBRO: Strict regime (all mandatory fields required)
* - IMBRO/A: Relaxed regime for historical data (allows missing fields)
*/
qualityRegime: QualityRegime | null;
researchReportDate: Date | null;
// Location
deliveredLocation: Location | null;
standardizedLocation: Location | null;
// Vertical position
deliveredVerticalPositionOffset: number | null;
deliveredVerticalPositionDatum: string | null;
deliveredVerticalPositionReferencePoint: string | null;
// Bore metadata
descriptionProcedure: string | null;
boreRockReached: boolean | null;
finalBoreDepth: number | null;
finalSampleDepth: number | null;
boreHoleCompleted: string | null; // Note: BHR-G uses string values like "onbekend"
// Boring execution details
/** Start date of the boring operation */
boringStartDate: Date | null;
/** End date of the boring operation */
boringEndDate: Date | null;
/** Boring procedure standard used */
boringProcedure: string | null;
/** Boring technique used */
boringTechnique: string | null;
/** Whether the trajectory was excavated */
trajectoryExcavated: boolean | null;
/** Whether the subsurface is contaminated */
subsurfaceContaminated: boolean | null;
/** Stop criterion for boring */
stopCriterion: string | null;
// Sampling details
/** Sampling procedure standard */
samplingProcedure: string | null;
/** Sampling method used */
samplingMethod: string | null;
/** Sampling quality assessment */
samplingQuality: string | null;
// Description metadata
/** Description quality assessment */
descriptionQuality: string | null;
/** Described samples quality */
describedSamplesQuality: string | null;
/** Description location (field/lab) */
descriptionLocation: string | null;
/** Date of description report */
descriptionReportDate: Date | null;
/** Described material type */
describedMaterial: string | null;
/** Whether sampling was continuous */
continuouslySampled: boolean | null;
/** Sample moistness during description */
sampleMoistness: string | null;
data: Array<BHRGLayer>;
// Boring interval details
/** Array of bored intervals with technique and diameter */
boredIntervals: Array<BoredInterval>;
/** Array of sampled intervals with method and quality */
sampledIntervals: Array<SampledInterval>;
// Administrative history
/** BRO registration history */
registrationHistory: RegistrationHistory | null;
/** Report history with events */
reportHistory: ReportHistory | null;
// Additional top-level metadata
/** Delivery context (e.g., "archiefoverdracht") */
deliveryContext: string | null;
/** Survey purpose */
surveyPurpose: string | null;
/** Discipline (e.g., "geologie") */
discipline: string | null;
/** Survey procedure standard */
surveyProcedure: string | null;
/** NITG code (legacy identifier) */
nitgCode: string | null;
}
/**
* Bored interval - records boring technique and diameter at specific depth ranges
*/
export interface BoredInterval {
beginDepth: number;
endDepth: number;
boringTechnique: string | null;
boredDiameter: number | null;
}
/**
* Sampler equipment details within a sampled interval
*/
export interface SamplerDetails {
samplerType: string | null;
sampleContainerDiameter: number | null;
sampleContainerLength: number | null;
cuttingShoeInsideDiameter: number | null;
cuttingShoeOutsideDiameter: number | null;
stockingUsed: boolean | null;
rightAngledCuttingShoe: boolean | null;
taperAngle: number | null;
lubricationFluidUsed: boolean | null;
coreCatcherPresent: boolean | null;
pistonPresent: boolean | null;
}
/**
* Sampled interval - records sampling method and quality at specific depth ranges
*/
export interface SampledInterval {
beginDepth: number;
endDepth: number;
preTreatment: string | null;
samplingMethod: string | null;
samplingQuality: string | null;
orientatedSampled: boolean | null;
sampler?: SamplerDetails;
}
/**
* Completed interval - records how the borehole was completed/backfilled
*/
export interface CompletedInterval {
beginDepth: number;
endDepth: number;
permanentCasingPresent: boolean | null;
backfillMaterial: string | null;
backfillMaterialWashed: boolean | null;
backfillMaterialCertified: boolean | null;
}
/**
* Not described interval - records depth ranges that were not described and why
*/
export interface NotDescribedInterval {
beginDepth: number;
endDepth: number;
noDescriptionReason: string | null;
}
/**
* Intermediate event in report history
*/
export interface IntermediateEvent {
eventName: string | null;
eventDate: Date | null;
}
/**
* Registration history - BRO administrative registration information
*/
export interface RegistrationHistory {
objectRegistrationTime: Date | null;
registrationStatus: string | null;
registrationCompletionTime: Date | null;
corrected: boolean | null;
underReview: boolean | null;
deregistered: boolean | null;
reregistered: boolean | null;
}
/**
* Report history - records when and how data was reported
*/
export interface ReportHistory {
reportStartDate: Date | null;
reportEndDate: Date | null;
intermediateEvents: Array<IntermediateEvent>;
}
/**
* BHR-GT-BMA (Borehole Sample Analysis) - Laboratory Determinations
*/
/**
* Water content determination result
*/
export interface WaterContentDetermination {
determinationProcedure: string | null;
determinationMethod: string | null;
sampleMoistness: string | null;
removedMaterial: string | null;
waterContent: number | null; // percentage
dryingTemperature: string | null;
dryingPeriod: string | null;
saltCorrectionMethod: string | null;
}
/**
* Volumetric mass density (bulk density) determination result
*/
export interface VolumetricMassDensityDetermination {
determinationProcedure: string | null;
determinationMethod: string | null;
sampleMoistness: string | null;
volumetricMassDensity: number | null; // g/cm³
}
/**
* Organic matter content determination result
*/
export interface OrganicMatterContentDetermination {
determinationProcedure: string | null;
determinationMethod: string | null;
removedMaterial: string | null;
organicMatterContent: number | null; // percentage
}
/**
* Carbonate content determination result
*/
export interface CarbonateContentDetermination {
determinationProcedure: string | null;
determinationMethod: string | null;
removedMaterial: string | null;
carbonateContent: number | null; // percentage
}
/**
* Volumetric mass density of solids determination result
*/
export interface VolumetricMassDensityOfSolidsDetermination {
determinationProcedure: string | null;
determinationMethod: string | null;
liquidUsed: string | null;
volumetricMassDensityOfSolids: number | null; // g/cm³
}
/**
* Particle size distribution determination result
* Contains detailed grain size fractions
*/
export interface ParticleSizeDistributionDetermination {
determinationProcedure: string | null;
determinationMethod: string | null;
fractionDistribution: string | null;
dispersionMethod: string | null;
removedMaterial: string | null;
equivalentMassDeterminationMethod: string | null;
equivalentMass: number | null; // g/cm³
// Basic distribution
fractionSmaller63um: number | null; // percentage
fractionLarger63um: number | null; // percentage
// Detailed distribution < 63μm (7 fractions)
fraction0to2um?: number | null;
fraction2to4um?: number | null;
fraction4to8um?: number | null;
fraction8to16um?: number | null;
fraction16to32um?: number | null;
fraction32to50um?: number | null;
fraction50to63um?: number | null;
// Standard distribution > 63μm (16 fractions)
fraction63to90um?: number | null;
fraction90to125um?: number | null;
fraction125to180um?: number | null;
fraction180to250um?: number | null;
fraction250to355um?: number | null;
fraction355to500um?: number | null;
fraction500to710um?: number | null;
fraction710to1000um?: number | null;
fraction1000to1400um?: number | null;
fraction1400umto2mm?: number | null;
fraction2to4mm?: number | null;
fraction4to8mm?: number | null;
fraction8to16mm?: number | null;
// eslint-disable-next-line @typescript-eslint/naming-convention
fraction16to31_5mm?: number | null;
// eslint-disable-next-line @typescript-eslint/naming-convention
fraction31_5to63mm?: number | null;
fractionLarger63mm?: number | null;
}
/**
* Plasticity data point for Atterberg limits test
* Used to construct the plasticity curve (Casagrande)
*/
export interface PlasticityAtSpecificWaterContent {
waterContent: number; // percentage
numberOfFalls: number; // integer - Casagrande cup test
}
/**
* Consistency limits determination (Atterberg limits)
* Used to determine soil plasticity characteristics
*/
export interface ConsistencyLimitsDetermination {
determinationProcedure: string | null;
determinationMethod: string | null;
fractionLarger500um: number | null; // percentage
usedMedium: string | null;
performanceIrregularity: string | null;
// Calculated limits
liquidLimit: number | null; // percentage (LL)
plasticLimit: number | null; // percentage (PL)
plasticityIndex: number | null; // percentage (PI = LL - PL)
// Plasticity curve data points (for Casagrande chart)
plasticityAtSpecificWaterContent: Array<PlasticityAtSpecificWaterContent>;
}
/**
* Height measurement at specific time during settlement test
* Used to construct compression/consolidation curves
*/
export interface HeightAtSpecificTime {
time: number; // seconds
height: number; // mm
}
/**
* Single loading step in settlement characteristics test
* Represents one stress increment in oedometer/consolidation test
*/
export interface SettlementDeterminationStep {
stepNumber: number;
wetPerformed: boolean | null;
swellObserved: boolean | null;
strainPoint24hours: number | null; // percentage
stepType: string | null; // belastingstap, ontlastingstap
verticalStress: number | null; // kPa
heightChangeDuringSettlement: Array<HeightAtSpecificTime>;
}
/**
* Settlement characteristics determination (oedometer/consolidation test)
* Used to determine soil compressibility and consolidation behavior
*/
export interface SettlementCharacteristicsDetermination {
determinationProcedure: string | null;
determinationMethod: string | null;
ringDiameter: number | null; // mm
sampleMoistness: string | null;
filterPaperUsed: boolean | null;
temperature: number | null; // Celsius
wallFrictionCorrectionMethod: string | null;
apparatusDeformationApplied: boolean | null;
bearingFrictionCorrectionApplied: boolean | null;
irregularResult: boolean | null;
determinationSteps: Array<SettlementDeterminationStep>;
}
/**
* Permeability at specific density measurement
*/
export interface SaturatedPermeabilityAtSpecificDensity {
dryVolumetricMassDensity: number | null; // g/cm³
saturatedPermeability: number | null; // m/s
}
/**
* Saturated permeability determination (hydraulic conductivity)
* Used to determine water flow characteristics through soil
*/
export interface SaturatedPermeabilityDetermination {
determinationProcedure: string | null;
determinationMethod: string | null; // constantHead, fallingHead
specimenMade: boolean | null;
saturatedWithCO2: boolean | null;
verticallyDetermined: boolean | null;
currentDownwards: boolean | null;
usedMedium: string | null;
waterDegassed: boolean | null;
temperature: number | null; // Celsius
maximumGradient: number | null; // cm/cm
saturatedPermeabilityAtSpecificDensity: Array<SaturatedPermeabilityAtSpecificDensity>;
}
/**
* Membrane correction data for triaxial test
* Corrects for membrane stiffness effects during testing
*/
export interface MembraneCorrection {
correctionMethod: string | null;
thickness: number | null; // mm
stiffnessClass: string | null; // e.g., "1700kPa"
}
/**
* Drainage strip correction data for triaxial test
* Corrects for drainage strip effects during testing
*/
export interface DrainageStripCorrection {