-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathap_03_database_design.qmd
1898 lines (1637 loc) · 71.2 KB
/
ap_03_database_design.qmd
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
# Data model {#sec-erds}
```{r}
library(dplyr)
library(tibble)
library(gt)
library(gtExtras)
```
The following diagrams demonstrate one way in which the contents of this manual can be structured in a database. The diagrams only deal with the data themselves - security, user management, change tracking and other helper functionalities are left out for clarity. Data tables for samples and laboratory results are also not included. The model is optimised to highlight the relationships between the various data points and contains some structures that support the controlled vocabulary lists, but is not optimised for performance.
## Conceptual model
This overview shows the relationships between each part of the standard.
```{mermaid}
%%| fig-cap: "Overview - conceptual relationships"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
Site ||--|| Location : "has one"
Site ||--|| Landform : "is in one"
Site ||--|| Landscape : "is in one"
Landscape ||--|{ Landform : "comprises at least one"
Site ||--o{ "Recent events" : "may have some"
Site ||--|| "Site surface" : "has one"
"Site surface" ||--|{ "Surface cover" : "has"
"Site surface" ||--o{ Erosion : "may have some"
"Site surface" ||--o{ Deposition : "may have some"
Site ||--|{ Horizon : "has at least one"
Horizon ||--o{ "Peds" : "may contain"
Horizon ||--o{ "Rock Fragments" : "may contain"
Horizon ||--o{ "Other Fragments" : "may contain"
Horizon ||--o{ "Artefacts" : "may contain"
Horizon ||--o{ "Roots" : "may contain"
Horizon ||--o{ "Voids" : "may contain"
Horizon ||--o{ "Pores" : "may contain"
Horizon ||--|{ "Matrix colour" : "has one or more"
Horizon ||--o{ "Colour patterns" : "may have"
Horizon ||--|| "Texture" : "has a"
Horizon ||--|| "Particle size distribution (estimate)" : "has a"
Horizon ||--o{ "Concentrations" : "may have some"
Horizon ||--o{ "Coatings" : "may have some"
Horizon ||--o{ "Pan" : "may be a"
Horizon ||--o{ "Stress Features" : "may have some"
Horizon ||--o{ "Biological features" : "may have some"
Horizon ||--o{ "Consistence tests" : "may have some"
Site ||--o{ "Field tests" : "may have some"
Site ||--|{ "NZ Soil Classification" : "has an"
Horizon ||--|| "Horizon Names" : "have"
Horizon ||--|| "Functional Horizon Names" : "have"
```
## Soil Setting {#sec-erd-setting}
The setting tables store site location (@sec-loc), landscape and landform (@sec-gmph), land cover (@sec-lcov), and land use (@sec-luse).
::: {.content-hidden when-format='docx'}
```{mermaid}
%%| fig-cap: "Setting - Overview"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
site ||--|| location : "has one"
location }|--|{ elevation_measurement_methods : "code comes from"
location }|--|{ gnss_types : "code comes from"
site ||--|| landscape : "has one associated"
landscape }|--|{ provinces : "code comes from"
landscape }|--|{ landscapes : "code comes from"
landscape ||--|{ landform : "contains at least one"
landscape ||--o{ lscape_landuse : "may have some"
lscape_landuse }|--|{ landuse_primary : "code comes from"
lscape_landuse }|--|{ landuse_secondary : "code comes from"
landform }|--|{ landform_types : "code comes from"
landform }|--|{ measurement_types : "code comes from"
landform }|--|{ landform_elements : "code comes from"
landform }|--|{ landform_element_vmods : "code comes from"
landform }|--|{ landform_element_hmods : "code comes from"
landform ||--o{ lform_landuse : "may have some"
landform }|--|{ land_cover_types : "code comes from"
lform_landuse }|--|{ landuse_primary : "code comes from"
lform_landuse }|--|{ landuse_secondary : "code comes from"
lform_landuse }|--|{ landuse_tertiary : "code comes from"
lform_landuse }|--|{ landuse_impact : "code comes from"
```
:::
```{mermaid}
%%| fig-cap: "Setting - Details"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
site ||--|| location : "has one"
location }|--|{ elevation_measurement_methods : "code comes from"
location }|--|{ gnss_types : "code comes from"
site ||--|| landscape : "has one associated"
landscape }|--|{ provinces : "code comes from"
landscape }|--|{ landscapes : "code comes from"
landscape ||--|{ landform : "contains at least one"
landscape ||--o{ lscape_landuse : "may have some"
lscape_landuse }|--|{ landuse_primary : "code comes from"
lscape_landuse }|--|{ landuse_secondary : "code comes from"
landform }|--|{ landform_types : "code comes from"
landform }|--|{ measurement_types : "code comes from"
landform }|--|{ landform_elements : "code comes from"
landform }|--|{ landform_element_vmods : "code comes from"
landform }|--|{ landform_element_hmods : "code comes from"
landform ||--o{ lform_landuse : "may have some"
landform }|--|{ land_cover_types : "code comes from"
lform_landuse }|--|{ landuse_primary : "code comes from"
lform_landuse }|--|{ landuse_secondary : "code comes from"
lform_landuse }|--|{ landuse_tertiary : "code comes from"
lform_landuse }|--|{ landuse_impact : "code comes from"
location {
id id_site PK
geo point_location "Section 3.1.1"
num[-5-3724] amt_elevation_abs_m "Section 3.1.1"
num[0-Inf] amt_error_location_m "Section 3.1.2"
num[0-Inf] amt_error_elevation_m "Section 3.1.2"
cat catu_elevation_method FK "Section 3.1.3"
cat catu_gnss FK "Section 3.1.4"
num[-5-3724] amt_elevation_rel_m "Section 3.2.1"
txt txt_notes_triangulation "Section 3.2.2"
txt txt_location_desc "Section 3.2.3"
%% not defining code tables for these just now %%
cat catu_admin_rc "Section 3.2.4"
cat catu_admin_dc "Section 3.2.4"
}
elevation_measurement_methods {
id id_elevation_method PK
cat catu_elevation_method FK "Table 3.1"
txt txt_elevation_method_name "Table 3.1"
txt txt_elevation_method_desc "Table 3.1"
}
gnss_types {
id id_gnss PK
cat catu_gnss FK "Table 3.2"
txt txt_gnss_name "Table 3.2"
txt txt_gnss_desc "Table 3.2"
}
landscape {
id id_site PK
cat catu_province FK "Section 4.1"
cat catu_landscape FK "Section 4.2.1.4"
%% landscape relief %%
num[0-Inf] amt_lscape_relief_med_m "Section 4.2.1.1"
%% landscape slope %%
num[0-90] amt_lscape_slope_med_d "Section 4.2.1.2"
num[0-Inf] amt_lscape_slope_min_d "Section 4.2.1.2"
num[0-Inf] amt_lscape_slope_max_d "Section 4.2.1.2"
%% not implementing stream channel stuff here %%
}
provinces {
id id_province PK
cat catu_province FK "Table 4.1"
txt txt_province_name "Table 4.1"
txt txt_province_desc "Note 4.1"
}
landscapes {
id id_landscape PK
cat catu_landscape FK "Table 4.2"
txt txt_landscape_name "Table 4.2"
txt txt_landscape_desc "Table 4.2"
}
lscape_landuse {
id id_site PK
id id_landscape PK
id id_lscape_landuse PK
cat catu_lscape_landuse_primary FK "Section 8.2.1"
cat catu_lscape_landuse_secondary FK "Section 8.2.1"
num[0-100] amt_landuse_area_p "Section 8.2.1"
}
landuse_primary {
id id_landuse_primary PK
cat catu_landuse_primary FK "Fig. 8.1"
txt txt_landuse_primary_name "Fig. 8.1"
txt txt_landuse_primary_desc "Fig. 8.1"
}
landuse_secondary {
id id_landuse_primary PK
cat catu_landuse_primary FK "Fig. 8.1"
txt txt_landuse_primary_name "Fig. 8.1"
txt txt_landuse_primary_desc "Fig. 8.1"
}
landform {
id id_site PK
id id_landscape PK
id id_landform PK
cat catu_landform FK "Section 4.3.1"
num[0-100] amt_landform_p "Section 4.1.2.5"
%% can only be true for one landform per site/landscape: %%
bool ind_landform_contains_site
%% (other way is separate tables for site-landform and %%
%% landscape-landforms) %%
cat catu_land_cover FK "Section 8.1"
%% detailed optional stuff: %%
num[0-Inf] amt_landform_relief_m "Section 4.3.2.1"
num[0-90] amt_landform_slope_med_d "Section 4.3.2.2"
num[0-Inf] amt_landform_slope_min_d "Section 4.3.2.2"
num[0-Inf] amt_landform_slope_max_d "Section 4.3.2.2"
num[0-359] val_landform_aspect_med_d "Section 4.3.2.3"
num[0-359] val_landform_aspect_min_d "Section 4.3.2.3"
num[0-359] val_landform_aspect_max_d "Section 4.3.2.3"
cat catu_landform_aspect_rec FK "Section D.13.1"
cat catu_landform_element FK "Section 4.3.2.4"
cat catu_landform_element_vmod FK "Section 4.3.2.4"
cat catu_landform_element_hmod FK "Section 4.3.2.4"
%% extremely optional %%
num[0-Inf] amt_slope_length_m "Section 4.4.1"
num[-90-90] amt_mesoscale_topo_index "Section 4.4.2"
num[-90-90] amt_terrain_shape_index "Section 4.4.3"
}
landform_types {
id id_landform PK
cat catu_landform FK "Table 4.3"
txt txt_landform_name "Table 4.3"
txt txt_landform_desc "Table 4.3"
}
land_cover_types {
id id_land_cover PK
cat catu_land_cover FK "Table 8.1"
txt txt_land_cover_name "Table 8.1"
txt txt_land_cover_desc "Table 8.1"
}
measurement_types {
id id_mtype PK
cat catu_mtype FK
txt txt_mtype_name "Table D.1.1"
txt txt_mtype_desc "Table D.1.1"
}
landform_elements {
id id_landform_element PK
cat catu_landform_element FK "Table 4.4"
txt txt_landform_element_name "Table 4.4"
txt txt_landform_element_desc "Table 4.4"
}
landform_element_vmods {
id id_landform_element_vmod PK
cat catu_landform_element_vmod FK "Table 4.5"
txt txt_landform_element_vmod_name "Table 4.5"
txt txt_landform_element_vmod_desc "Table 4.5"
}
landform_element_hmods {
id id_landform_element_hmod PK
cat catu_landform_element_hmod FK "Table 4.6"
txt txt_landform_element_hmod_name "Table 4.6"
txt txt_landform_element_hmod_desc "Table 4.6"
}
lform_landuse {
id id_site PK
id id_landform PK
id id_lform_landuse PK
cat catu_lform_landuse_primary FK "Section 8.2.2"
cat catu_lform_landuse_secondary FK "Section 8.2.2"
cat catu_lform_landuse_tertiary FK "Section 8.2.2"
amt[0-100] amt_landuse_area_p "Section 8.2.2"
cat cato_landuse_impact "Section 8.2.2"
}
landuse_tertiary {
id id_landuse_tertiary PK
cat catu_landuse_tertiary FK "Fig. 8.1"
txt txt_landuse_tertiary_name "Fig. 8.1"
txt txt_landuse_tertiary_desc "Fig. 8.1"
}
landuse_impact {
id id_landuse_impact PK
cat catu_landuse_impact FK "Table 8.2"
txt txt_landuse_impact_name "Table 8.2"
txt txt_landuse_impact_desc "Table 8.2"
}
```
## Site overview {#sec-erd-siteover}
The site table stores reference data (@sec-ref), except for location.
::: {.content-hidden when-format='docx'}
```{mermaid}
%%| fig-cap: "Site - Overview"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
site ||--|{ disturbances : "has one or more"
disturbances }|--|{ disturbance_types : "code comes from"
disturbances }|--|{ disturbance_ages : "code comes from"
site }|--|{ site_purposes : "code comes from"
site }|--|{ site_selection_methods : "code comes from"
site }|--|{ site_exposure_types : "code comes from"
site }|--|{ site_early_stop_types : "code comes from"
site }|--|{ current_weather : "code comes from"
site }|--|{ recent_rainfall : "code comes from"
```
:::
```{mermaid}
%%| fig-cap: "Site - Details"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
site ||--|{ disturbances : "has one or more"
disturbances }|--|{ disturbance_types : "code comes from"
disturbances }|--|{ disturbance_ages : "code comes from"
site }|--|{ site_purposes : "code comes from"
site }|--|{ site_selection_methods : "code comes from"
site }|--|{ site_exposure_types : "code comes from"
site }|--|{ site_early_stop_types : "code comes from"
site }|--|{ current_weather : "code comes from"
site }|--|{ recent_rainfall : "code comes from"
site {
id id_site PK "Section 10.2.1"
usr usr_author "Section 10.2.2"
dt dt_site "Section 10.2.4"
cat catu_site_purpose FK "Section 10.2.5"
cat catu_site_selection FK "Section 10.2.6"
cat catu_site_exposure FK "Section 10.2.7"
num[0-1000] amt_site_depth_max_cm "Section 10.2.8"
cat catu_early_stop FK "Section 10.2.9"
%% weather at visit %%
cat catu_weather FK "Section 6.3.1"
num[-50-50] val_temperature_c "Section 6.3.1"
cat cato_recent_rain FK "Section 6.3.2"
}
site_purposes {
id id_site_purpose PK
cat catu_site_purpose FK "Table 10.1"
txt txt_site_purpose "Table 10.1"
}
site_selection_methods {
id id_site_selection PK
cat catu_site_selection FK "Table 10.2"
txt txt_site_selection "Table 10.2"
}
site_exposure_types {
id id_site_exposure PK
cat catu_site_exposure FK "Table 10.3"
txt txt_site_exposure_name "Table 10.3"
}
site_early_stop_types {
id id_site_stop PK
cat catu_site_stop FK "Table 10.4"
txt txt_site_stop_name "Table 10.4"
txt txt_site_stop_desc "Table 10.4"
}
disturbances {
id id_site PK
id id_disturbance PK
cat catu_disturbance FK "Section 10.3"
cat catu_disturbance_age FK "Section 10.3"
num[0-Inf] amt_disturbance_age_days "Section 10.3"
}
disturbance_types {
id id_disturbance PK
cat catu_disturbance FK "Table 10.5"
txt txt_disturbance_name "Table 10.5"
txt txt_disturbance_desc "Table 10.5"
}
disturbance_ages {
id id_disturbance_age PK
cat catu_disturbance_age FK "Table 10.6"
txt txt_disturbance_age_name "Table 10.6"
txt txt_disturbance_age_desc "Table 10.6"
}
current_weather {
id id_weather PK
cat catu_weather FK "Table 6.3.1"
txt txt_weather_name "Table 6.3.1"
}
recent_rainfall {
id id_rainfall PK
cat catu_rainfall FK "Table 6.3.2"
txt txt_rainfall_name "Table 6.3.2"
}
```
## Surface {#sec-erd-surface}
The surface table stores slope, aspect, surface cover, surface water, surface cracking, microrelief, erosion and deposition data (@sec-pr-surface). It can also store LUC vegetation code (@sec-veg). This table can optionally extend the site table (@sec-erd-siteover) as it has a 1:1 relationship.
::: {.content-hidden when-format='docx'}
```{mermaid}
%%| fig-cap: "Surface - Overview"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
site_surface }|--|{ slope_methods : "code comes from"
site_surface }|--|{ measurement_types : "code comes from"
site_surface }|--|{ aspect_methods : "code comes from"
site_surface ||--|{ surface_cover : "has"
surface_cover }|--|{ surface_cover_types : "code comes from"
site_surface }|--|{ surface_water_types : "code comes from"
site_surface }|--|{ surface_water_persts : "code comes from"
site_surface }|--|{ surface_crack_types : "code comes from"
site_surface }|--|{ surface_crack_shapes : "code comes from"
site_surface ||--o{ site_erosion : "may have"
site_surface }|--|{ site_microrelief_nat : "code comes from"
site_surface }|--|{ site_microrelief_ant : "code comes from"
site_erosion }|--|{ erosion_types : "code comes from"
site_erosion }|--|{ erosion_severity : "code comes from"
site_erosion }|--|{ erosion_activity : "code comes from"
site_surface ||--o{ site_deposition : "may have"
site_deposition }|--|{ deposition_types : "code comes from"
site_deposition }|--|{ deposition_severity : "code comes from"
site_deposition }|--|{ deposition_activity : "code comes from"
site_surface }|--|{ water_depths : "code comes from"
site_surface }|--|{ luc_vegetation_codes : "code comes from"
```
:::
```{mermaid}
%%| fig-cap: "Surface - Details"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
site_surface }|--|{ slope_methods : "code comes from"
site_surface }|--|{ measurement_types : "code comes from"
site_surface }|--|{ aspect_methods : "code comes from"
site_surface ||--|{ surface_cover : "has"
surface_cover }|--|{ surface_cover_types : "code comes from"
site_surface }|--|{ surface_water_types : "code comes from"
site_surface }|--|{ surface_water_persts : "code comes from"
site_surface }|--|{ surface_crack_types : "code comes from"
site_surface }|--|{ surface_crack_shapes : "code comes from"
site_surface ||--o{ site_erosion : "may have"
site_surface }|--|{ site_microrelief_nat : "code comes from"
site_surface }|--|{ site_microrelief_ant : "code comes from"
site_erosion }|--|{ erosion_types : "code comes from"
site_erosion }|--|{ erosion_severity : "code comes from"
site_erosion }|--|{ erosion_activity : "code comes from"
site_surface ||--o{ site_deposition : "may have"
site_deposition }|--|{ deposition_types : "code comes from"
site_deposition }|--|{ deposition_severity : "code comes from"
site_deposition }|--|{ deposition_activity : "code comes from"
site_surface }|--|{ water_depths : "code comes from"
site_surface }|--|{ luc_vegetation_codes : "code comes from"
site_surface {
id id_site PK "Section 10.2.1"
num[0-90] amt_slope_d "Section 11.1"
cat catu_slope_rec FK "Section D.13.1"
cat catu_slope_method FK "Section 11.1"
num[0-359] amt_aspect_d "Section 11.2"
cat catu_aspect_rec FK "Section D.13.1"
cat catu_aspect_method FK "Section 11.2"
cat catu_surface_water FK "Section 11.4"
cat cato_surface_water_perst FK "Section 11.4"
cat catu_surface_cracks FK "Section 11.5"
cat catu_surface_crack_shp FK "Section 11.5"
cat catu_microrelief_nat FK "Section 11.6.1"
%% optional details %%
num[0-Inf] amt_microrelief_nat_width_cm "Section 11.6.1"
num[0-Inf] amt_microrelief_nat_height_cm "Section 11.6.1"
cat catu_microrelief_ant FK "Section 11.6.2"
%% optional details %%
num[0-Inf] amt_microrelief_ant_width_cm "Section 11.6.1"
num[0-Inf] amt_microrelief_ant_height_cm "Section 11.6.1"
num[0-Inf] amt_depth_water "Section 12.7"
cat catu_depth_water FK "Section 12.7"
%% vegetation could also be stored at landscape and/or landform %%
cat catu_vegetation_luc FK "Section 7.1"
}
slope_methods {
id id_slope_method PK
cat catu_slope_method FK "Table 11.1"
txt txt_slope_method_name "Table 11.1"
txt txt_slope_method_desc "Table 11.1"
}
aspect_methods {
id id_aspect_method PK
cat catu_aspect_method FK "Table 11.2"
txt txt_aspect_method_name "Table 11.2"
txt txt_aspect_method_desc "Table 11.2"
}
measurement_types {
id id_mtype PK
cat catu_mtype FK
txt txt_mtype_name "Table D.1"
txt txt_mtype_desc "Table D.1"
}
surface_cover {
id id_site PK
cat catu_surface_cover FK "Section 11.3"
num[0-100] amt_surface_cover "Section 11.3"
}
surface_cover_types {
id id_surfcov PK
cat catu_surface_cover FK "Table 11.3"
txt txt_surface_cover_name "Table 11.3"
txt txt_surface_cover_desc "Table 11.3"
}
surface_water_types {
id id_surface_water PK
cat catu_surface_water FK "Table 11.4"
txt txt_surface_water_name "Table 11.4"
txt txt_surface_water_desc "Table 11.4"
}
surface_water_persts {
id id_surface_water_perst PK
cat catu_surface_water_perst FK "Table 11.5"
txt txt_surface_water_perst_name "Table 11.5"
txt txt_surface_water_perst_desc "Table 11.5"
}
surface_crack_types {
id id_surface_crack
cat catu_surface_crack "Table 11.6"
txt txt_surface_crack_name "Table 11.6"
txt txt_surface_crack_desc "Table 11.6"
}
surface_crack_shapes {
id id_surface_crack_shp PK
cat catu_surface_crack_shp FK "Table 11.7"
txt txt_surface_crack_shp_name "Table 11.7"
txt txt_surface_crack_shp_desc "Table 11.7"
}
site_microrelief_nat {
id id_microrelief_nat PK
cat catu_microrelief_nat FK "Table 11.8"
txt txt_microrelief_nat_name "Table 11.8"
txt txt_microrelief_nat_desc "Table 11.8"
}
site_microrelief_ant {
id id_microrelief_ant PK
cat catu_microrelief_ant FK "Table 11.9"
txt txt_microrelief_ant_name "Table 11.9"
txt txt_microrelief_ant_desc "Table 11.9"
}
site_erosion {
id id_site PK
id id_erosion PK
cat catu_erosion FK "Section 11.7"
cat cato_erosion_severity FK "Section 11.7"
cat cato_erosion_activity FK "Section 11.7"
}
erosion_types {
id id_erosion PK
cat catu_erosion FK "Table 11.10"
txt txt_erosion_name "Table 11.10"
txt txt_erosion_desc "Table 11.10"
}
erosion_severity {
id id_erosion_severity PK
cat catu_erosion_severity FK "Table 11.11"
txt txt_erosion_severity_name "Table 11.11"
txt txt_erosion_severity_desc "Table 11.11"
}
erosion_activity {
id id_erosion_activity PK
cat catu_erosion_activity FK "Table 11.12"
txt txt_erosion_activity_name "Table 11.12"
txt txt_erosion_activity_desc "Table 11.12"
}
site_deposition {
id id_site PK
id id_deposition PK
cat catu_deposition FK "Section 11.8"
cat cato_deposition_severity FK "Section 11.8"
cat cato_deposition_activity FK "Section 11.8"
}
deposition_types {
id id_deposition PK
cat catu_deposition FK "Table 11.13"
txt txt_deposition_name "Table 11.13"
txt txt_deposition_desc "Table 11.13"
}
deposition_severity {
id id_deposition_severity PK
cat catu_deposition_severity FK "Table 11.14"
txt txt_deposition_severity_name "Table 11.14"
txt txt_deposition_severity_desc "Table 11.14"
}
deposition_activity {
id id_deposition_activity PK
cat catu_deposition_activity FK "Table 11.15"
txt txt_deposition_activity_name "Table 11.15"
txt txt_deposition_activity_desc "Table 11.15"
}
water_depths {
id id_water_depths PK
cat catu_water_depths FK "Table 12.4"
txt txt_water_depths_name "Table 12.4"
txt txt_water_depths_desc "Table 12.4"
}
luc_vegetation_codes {
id id_vegetation_luc PK
cat catu_vegetation_luc FK "Section 7.1"
txt txt_vegetation_luc_name "Section 7.1"
txt txt_vegetation_luc_desc "Section 7.1"
}
```
## Horizon overview {#sec-erd-horizono}
The horizon overview table stores boundary definitions, soil moisture status at the time of examination, and parent material origin.
::: {.content-hidden when-format='docx'}
```{mermaid}
%%| fig-cap: "Horizon - Overview"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
horizon }|--|{ boundary_shapes : "code comes from"
horizon }|--|{ boundary_widths : "code comes from"
horizon }|--|{ soil_moistures : "code comes from"
horizon }|--|{ nzsc_parent_material_origin : "code comes from"
horizon }|--|{ parent_material_origin_mod : "code comes from"
```
:::
```{mermaid}
%%| fig-cap: "Horizon - Details"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
horizon }|--|{ boundary_shapes : "code comes from"
horizon }|--|{ boundary_widths : "code comes from"
horizon }|--|{ soil_moistures : "code comes from"
horizon }|--|{ nzsc_parent_material_origin : "code comes from"
horizon }|--|{ parent_material_origin_mod : "code comes from"
horizon {
id id_site PK
id id_horizon PK
num[0-Inf] amt_upper_depth_cm "Section 12.2"
num[0-Inf] amt_upper_depth_med_cm "Section 12.2"
num[0-Inf] amt_upper_depth_min_cm "Section 12.2"
num[0-Inf] amt_upper_depth_max_cm "Section 12.2"
num[0-Inf] amt_upper_depth_cm "Section 12.2"
num[0-Inf] amt_lower_depth_med_cm "Section 12.2"
num[0-Inf] amt_upper_depth_min_cm "Section 12.2"
num[0-Inf] amt_upper_depth_max_cm "Section 12.2"
cat catu_boundary_shape FK "Section 12.4"
num[0-Inf] amt_boundary_cm "Section 12.5"
cat catu_boundary_width FK "Section 12.5"
cat cato_soil_moisture FK "Section 12.6"
%% pmo %%
cat catu_parent_material_origin FK "Section 12.8"
cat catu_anthropic_origin_modifier FK "Section 12.8"
%% weathering %%
cat cato_horizon_weathering FK "Section 12.9"
}
boundary_shapes {
id id_boundary_shape PK
cat catu_boundary_shape FK "Table 12.1"
txt txt_boundary_shape_name "Table 12.1"
txt txt_boundary_shape_desc "Table 12.1"
}
boundary_widths {
id id_boundary_width PK
cat catu_boundary_width FK "Table 12.2"
txt txt_boundary_width_name "Table 12.2"
txt txt_boundary_width_desc "Table 12.2"
}
soil_moistures {
id id_soil_moisture PK
cat catu_soil_moisture FK "Table 12.3"
txt txt_soil_moisture_name "Table 12.3"
}
nzsc_parent_material_origin {
id id_pmo PK
cat catu_pmo FK "Table 24.5"
txt txt_pmo_name "Table 24.5"
txt txt_pmo_desc "Table 24.5"
}
parent_material_origin_mod {
id id_pmo_mod PK
cat catu_pmo_mod FK "Table 12.5"
txt txt_pmo_mod_name "Table 12.5"
txt txt_pmo_mod_desc "Table 12.5"
}
```
## Horizon architecture {#sec-erd-horizona}
The horizon architecture table stores data about pedality, fragments, roots, voids and pores. This table can optionally extend the horizon overview table (@sec-erd-horizono) as it has a 1:1 relationship.
::: {.content-hidden when-format='docx'}
```{mermaid}
%%| fig-cap: "Horizon architecture - Overview"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
horizon_arch ||--|{ horizon_structures : "may have"
horizon_arch }|--|{ structure_types : "code comes from"
horizon_arch }|--|{ structure_grades : "code comes from"
horizon_arch }|--|{ structure_sizes_rapid : "code comes from"
horizon_structures }|--|{ structure_types : "code comes from"
horizon_structures }|--|{ structure_grades : "code comes from"
horizon_structures }|--|{ structure_shapes : "code comes from"
horizon_arch ||--|{ horizon_rock_fragments : "may have"
horizon_rock_fragments }|--|{ fragment_sizes_simple : "code comes from"
horizon_rock_fragments }|--|{ rock_fragment_shapes : "code comes from"
horizon_rock_fragments }|--|{ nzsc_lithologies : "code comes from"
horizon_arch ||--|{ horizon_other_fragments : "may have"
horizon_other_fragments }|--|{ fragment_sizes_simple : "code comes from"
horizon_other_fragments }|--|{ other_fragment_types : "code comes from"
horizon_arch ||--|{ horizon_artefacts : "may have"
horizon_artefacts }|--|{ fragment_sizes_simple : "code comes from"
horizon_artefacts }|--|{ artefact_types: "code comes from"
horizon_arch ||--|{ horizon_plastics : "may have"
horizon_plastics }|--|{ plastic_types: "code comes from"
horizon_plastics }|--|{ plastic_fixations: "code comes from"
horizon_plastics }|--|{ plastic_shapes: "code comes from"
horizon_plastics }|--|{ plastic_degradations: "code comes from"
horizon_arch ||--|{ horizon_roots : "may have"
horizon_arch }|--|{ root_positions: "code comes from"
horizon_roots }|--|{ root_positions: "code comes from"
horizon_roots }|--|{ root_sizes_simple: "code comes from"
horizon_arch ||--|{ horizon_voids : "may have"
horizon_voids }|--|{ void_types : "code comes from"
horizon_voids }|--|{ void_conns : "code comes from"
```
:::
```{mermaid}
%%| fig-cap: "Horizon architecture - Details"
%%{ init: { 'er': { 'layoutDirection': 'LR' } } }%%
erDiagram
horizon_arch ||--|{ horizon_structures : "may have"
horizon_arch }|--|{ structure_types : "code comes from"
horizon_arch }|--|{ structure_grades : "code comes from"
horizon_arch }|--|{ structure_sizes_rapid : "code comes from"
horizon_structures }|--|{ structure_types : "code comes from"
horizon_structures }|--|{ structure_grades : "code comes from"
horizon_structures }|--|{ structure_shapes : "code comes from"
horizon_arch ||--|{ horizon_rock_fragments : "may have"
horizon_rock_fragments }|--|{ fragment_sizes_simple : "code comes from"
horizon_rock_fragments }|--|{ rock_fragment_shapes : "code comes from"
horizon_rock_fragments }|--|{ nzsc_lithologies : "code comes from"
horizon_arch ||--|{ horizon_other_fragments : "may have"
horizon_other_fragments }|--|{ fragment_sizes_simple : "code comes from"
horizon_other_fragments }|--|{ other_fragment_types : "code comes from"
horizon_arch ||--|{ horizon_artefacts : "may have"
horizon_artefacts }|--|{ fragment_sizes_simple : "code comes from"
horizon_artefacts }|--|{ artefact_types: "code comes from"
horizon_arch ||--|{ horizon_plastics : "may have"
horizon_plastics }|--|{ plastic_types: "code comes from"
horizon_plastics }|--|{ plastic_fixations: "code comes from"
horizon_plastics }|--|{ plastic_shapes: "code comes from"
horizon_plastics }|--|{ plastic_degradations: "code comes from"
horizon_arch ||--|{ horizon_roots : "may have"
horizon_arch }|--|{ root_positions: "code comes from"
horizon_roots }|--|{ root_positions: "code comes from"
horizon_roots }|--|{ root_sizes_simple: "code comes from"
horizon_arch ||--|{ horizon_voids : "may have"
horizon_voids }|--|{ void_types : "code comes from"
horizon_voids }|--|{ void_conns : "code comes from"
horizon_arch {
id id_site PK
id id_horizon PK
%% structures rapid (detailed in subtable) %%
cat catu_structure_type FK "Section 13.1.1"
cat cato_structure_grade FK "Section 13.1.2"
cat catu_structure_shape FK "Section 13.1.3"
cat cato_structure_size FK "Section 13.1.4"
%% all frags super rapid (record this OR the next three) %%
num[0-100] amt_total_frags_p "Section 4.2"
%% rock frags rapid (detailed in subtable) %%
num[0-100] amt_rockfrags_p "Section 13.2"
%% notrock frags rapid %%
num[0-100] amt_otherfrags_p "Section 13.2.1.1"
%% notrock frags rapid %%
num[0-100] amt_artefacts_p "Section 13.2.1.2"
%% roots rapid %%
num[0-100] amt_total_roots_p "Section 13.3.1"
cat catu_total_roots_pos FK "Section 13.3.2"
%% void rapid %%
num[0-100] amt_total_voids_p "Section 13.4"
%% pores rapid %%
num[0-10] amt_total_pores_p "Section 13.5"
%% pores detailed (could also spin out to subtable) %%
num[0-10] amt_macropores_p "Section 13.5"
num[0-10] amt_micropores_p "Section 13.5"
}
structure_types {
id id_structure_type PK
cat catu_structure_type FK "Table 13.1"
txt txt_structure_type_name "Table 13.1"
txt txt_structure_type_desc "Table 13.1"
}
structure_grades {
id id_structure_grade PK
cat cato_structure_grade FK "Table 13.2"
txt txt_structure_grade_name "Table 13.2"
txt txt_structure_grade_desc "Table 13.2"
}
structure_sizes_rapid {
id id_structure_size_rapid PK "Section 13.1.4"
cat catu_structure_size_rapid FK "C, F"
txt txt_structure_size_rapid_name "Coarse, Fine"
}
%% structures detailed %%
horizon_structures {
id id_site PK
id id_horizon PK
id id_structure PK
cat catu_structure_type FK "Section 13.1.1"
cat cato_structure_grade FK "Section 13.1.2"
cat cato_structure_shape FK "Section 13.1.3"
num[0-Inf] amt_structure_size_med_mm "Section 13.1.4"
num[0-Inf] amt_structure_size_min_mm "Section 13.1.4"
num[0-Inf] amt_structure_size_max_mm "Section 13.1.4"
}
structure_shapes {
id id_structure_shape PK
cat catu_structure_shape FK "Table 13.3"
txt txt_structure_shape_name "Table 13.3"
txt txt_structure_shape_desc "Table 13.3"
}
horizon_rock_fragments {
id id_site PK
id id_horizon PK
id id_rock_fragment PK
cat cato_rock_fragment_size FK "Section 13.2.1"
cat catu_rock_fragment_shape FK "Section 13.2.1"
num[0-100] num_rock_fragment_p
cat catu_rock_fragment_lithology FK "Section 24.1.2"
}
fragment_sizes_simple {
id id_rockfrag_size PK
cat catu_rockfrag_size FK "Table 13.4"
txt txt_rockfrag_size_name "Table 13.4"
txt txt_rockfrag_size_desc "Table 13.4"
}
rock_fragment_shapes {
id id_rockfrag_shape PK
cat catu_rockfrag_shape FK "Table 13.5"
txt txt_rockfrag_shape_name "Table 13.5"
txt txt_rockfrag_shape_desc "Table 13.5"
}
nzsc_lithologies {
id id_nzsc_lithology PK
cat catu_nzsc_lithology FK "Table 24.2"
txt txt_nzsc_lithology_name "Table 24.2"
}
%% %%
horizon_other_fragments {
id id_site PK
id id_horizon PK
id id_other_fragment PK
cat cato_other_fragment_size FK "Table 13.4"
cat cato_other_fragment FK "Table 13.6"
num[0-100] num_rock_fragment_p "Section 13.2.1"
}
other_fragment_types {
id id_other_fragment PK
cat cato_other_fragment FK "Table 13.6"
txt txt_other_fragment_name "Table 13.6"
txt txt_other_fragment_desc "Table 13.6"
}
%% %%
horizon_artefacts {
id id_site PK
id id_horizon PK
id id_artefact PK
cat cato_artefact_size FK "Table 13.4"
cat cato_artefact FK "Table 13.7"
num[0-100] num_artefact_p "Section 13.2.2"
}
artefact_types {
id id_artefact PK
cat catu_artefact FK "Table 13.7"
txt txt_artefact_type_name "Table 13.7"
txt txt_artefact_type_desc "Table 13.7"
}
%% %%
horizon_plastics {
id id_site PK
id id_horizon PK
id id_plastic PK
cat catu_plastic FK "Table 13.8"
num[0-100] num_plastic_p "Section 13.2.4"
cat cato_plastic_fixation "Table 13.9"
cat catu_plastic_shape "Table 13.10"
cat cato_plastic_degradation "Table 13.11"
}
plastic_types {
id id_plastic PK
cat catu_plastic FK "Table 13.8"
txt txt_plastic_name "Table 13.8"
txt txt_plastie_desc "Table 13.8"
}
plastic_fixations {
id id_plastic_fixation PK
cat catu_plastic_fixation FK "Table 13.9"
txt txt_plastic_fixation_name "Table 13.9"
txt txt_plastic_fixation_desc "Table 13.9"
}
plastic_shapes {
id id_plastic_shape PK
cat catu_plastic_shape FK "Table 13.10"
txt txt_plastic_shape_name "Table 13.10"
txt txt_plastic_shape_desc "Table 13.10"
}
plastic_degradations {
id id_plastic_degradations PK
cat catu_plastic_degradations FK "Table 13.11"
txt txt_plastic_degradations_name "Table 13.11"
txt txt_plastic_degradations_desc "Table 13.11"
}
%% %%
horizon_roots {
id id_site PK
id id_horizon PK
id id_root PK
cat cato_root_size FK "Table 13.12"
cat cato_root_pos FK "Table 13.13"
num[0-100] num_root_p "Section 13.3.1"
}
root_sizes_simple {
id id_root_size PK
cat catu_root_size FK "Table 13.12"
txt txt_root_size_name "Table 13.12"