library(aqp)
library(soilDB)
library(sf)
library(sharpshootR)
library(SoilTaxonomy)


## possible AOIs defined using a bounding-box via SoilWeb

# WI: many ties 
bb <- '-97.0983 39.3808,-97.0983 39.4127,-97.0282 39.4127,-97.0282 39.3808,-97.0983 39.3808'

# KS069
# bb <- '-100.5534 37.9177,-100.5534 37.9822,-100.4389 37.9822,-100.4389 37.9177,-100.5534 37.9177'



## assemble AOI polygon into WKT
wkt <- sprintf('POLYGON((%s))', bb)

## init sf polygon
# GCS WGS84
x <- st_as_sfc(wkt, crs = 4326)


## get overlapping map unit keys
# could also use SDA_query() with more elaborate SQL
m <- SDA_spatialQuery(x, what = 'mukey')

## compose SQL to return component details for these map unit keys
# return only:
# * map units overlapping with BBOX
# * major components
# * no misc. areas that might share name with a poorly-named soil series
sql <- sprintf(
  "SELECT mukey, cokey, compname, compkind, comppct_r 
  FROM component 
  WHERE mukey IN %s 
  -- AND majcompflag = 'Yes'
  AND compkind != 'Miscellaneous area'
  ", format_SQL_in_statement(as.integer(m$mukey))
)

## send to SDA, result is a data.frame
s <- SDA_query(sql)



## get OSD morphology + extended summaries 
osd <- fetchOSD(unique(s$compname), extended = TRUE)


## check out results
str(osd, 1)
## List of 19
##  $ SPC             :Formal class 'SoilProfileCollection' [package "aqp"] with 8 slots
##  $ competing       :'data.frame':    86 obs. of  3 variables:
##  $ geog_assoc_soils:'data.frame':    78 obs. of  2 variables:
##  $ geomcomp        :'data.frame':    17 obs. of  9 variables:
##  $ hillpos         :'data.frame':    17 obs. of  8 variables:
##  $ mtnpos          : logi FALSE
##  $ terrace         :'data.frame':    10 obs. of  5 variables:
##  $ flats           :'data.frame':    2 obs. of  7 variables:
##  $ shape_across    :'data.frame':    19 obs. of  8 variables:
##  $ shape_down      :'data.frame':    19 obs. of  8 variables:
##  $ pmkind          :'data.frame':    26 obs. of  5 variables:
##  $ pmorigin        :'data.frame':    9 obs. of  5 variables:
##  $ geomorphons     :'data.frame':    19 obs. of  12 variables:
##  $ mlra            :'data.frame':    130 obs. of  4 variables:
##  $ ecoclassid      :'data.frame':    62 obs. of  5 variables:
##  $ climate.annual  :'data.frame':    152 obs. of  12 variables:
##  $ climate.monthly :'data.frame':    456 obs. of  14 variables:
##  $ NCCPI           :'data.frame':    19 obs. of  16 variables:
##  $ soilweb.metadata:'data.frame':    28 obs. of  2 variables:
# single iteration of hydrologic ordering
h1 <- hydOrder(osd$shape_across, g = 'shape', clust = TRUE)

# return trace log for eval of objective function
# increase max iterations
h2 <- iterateHydOrder(osd$shape_across, 'shape', maxIter = 100, verbose = TRUE, trace = TRUE)

# compare
h1$match.rate
## [1] 0.5789474
h2$match.rate
## [1] 0.6315789
# inspect objective function evolution
tr <- h2$trace

obj <- sapply(tr, '[[', 'obj')
hist(obj, las = 1, xlab = 'Objective Function\nLower is Better')

Histogram of obj Objective Function Lower is Better Frequency 0 100 200 300 400 500 600 700 0 5 10 15 20 25 30 35

match.rate <- sapply(tr, '[[', 'match.rate')
hist(match.rate, las = 1, xlab = 'Matching Rate')

Histogram of match.rate Matching Rate Frequency 0.5 0.6 0.7 0.8 0 5 10 15 20 25 30

Note that profiles deeper than 180cm are marked as truncated via ragged bottoms.

# provide additional arguments to aqp::plotSPC() via options
options(.aqp.plotSPC.args = list(max.depth = 190))

par(mar = c(1, 0, 1, 2))
plotGeomorphCrossSection(osd, type = 'line', maxIter = 100, verbose = TRUE)

Ap E Bt1 Bt2 BC C1 C2 C3 BUTLER Ap AB Bt1 Bt2 Bt3 BC C1 C2 DETROIT Ap BA Bt1 Bt2 Bt3 Bt4 C Ab WYMORE Ap A BA Bt1 Bt2 BC C CRETE A1 A2 R SOGN A BA Bt1 Bt2 C R LABETTE A Bw C Cr CLIME Ap A BA Bt1 Bt2 Bt3 BC C PAWNEE Ap BA Bt1 Bt2 BC C GEARY Ap A BA Bt1 Bt2 BC C HASTINGS A BA Bt1 Bt2 Cr LANCASTER A AC C Cr KIPSON A1 A2 2Bt1 2Bt2 2Btk 3BCk 3Cr BENFIELD Ap A Bw1 Bw2 BC MUIR A BA Bt1 Bt2 BC C TULLY A C1 C2 C3 HOBBS A1 A2 C TOBIN 200 cm 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm 0.0 0.2 0.4 0.6 0.8 1.0 Summit Shoulder Backslope Footslope Toeslope Proportion

plotGeomorphCrossSection(osd, type = 'bar', maxIter = 100, verbose = TRUE)

Ap E Bt1 Bt2 BC C1 C2 C3 BUTLER Ap AB Bt1 Bt2 Bt3 BC C1 C2 DETROIT Ap BA Bt1 Bt2 Bt3 Bt4 C Ab WYMORE Ap A BA Bt1 Bt2 BC C CRETE A1 A2 R SOGN A BA Bt1 Bt2 C R LABETTE A Bw C Cr CLIME Ap A BA Bt1 Bt2 Bt3 BC C PAWNEE Ap BA Bt1 Bt2 BC C GEARY Ap A BA Bt1 Bt2 BC C HASTINGS A BA Bt1 Bt2 Cr LANCASTER A AC C Cr KIPSON A1 A2 2Bt1 2Bt2 2Btk 3BCk 3Cr BENFIELD Ap A Bw1 Bw2 BC MUIR A BA Bt1 Bt2 BC C TULLY A C1 C2 C3 HOBBS A1 A2 C TOBIN 200 cm 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm 2 5 17 4 14 10 3 13 6 7 11 9 1 12 16 8 15 vertic argiaquolls pachic argiustolls aquertic argiudolls pachic udertic argiustolls lithic haplustolls udic argiustolls udorthentic haplustolls oxyaquic vertic argiudolls udic argiustolls udic argiustolls udic argiustolls udorthentic haplustolls udertic argiustolls cumulic haplustolls pachic argiustolls mollic ustifluvents cumulic haplustolls Summit Shoulder Backslope Footslope Toeslope Proportion

par(mar = c(1, 0, 1, 2))
plotGeomorphCrossSection(osd, type = 'line', clust = FALSE)

Ap E Bt1 Bt2 BC C1 C2 C3 BUTLER Ap AB Bt1 Bt2 Bt3 BC C1 C2 DETROIT Ap BA Bt1 Bt2 Bt3 Bt4 C Ab WYMORE Ap A BA Bt1 Bt2 BC C CRETE A1 A2 R SOGN Ap A BA Bt1 Bt2 Bt3 BC C PAWNEE A BA Bt1 Bt2 C R LABETTE A Bw C Cr CLIME Ap A BA Bt1 Bt2 BC C HASTINGS Ap BA Bt1 Bt2 BC C GEARY A BA Bt1 Bt2 Cr LANCASTER A AC C Cr KIPSON A1 A2 2Bt1 2Bt2 2Btk 3BCk 3Cr BENFIELD Ap A Bw1 Bw2 BC MUIR A BA Bt1 Bt2 BC C TULLY A C1 C2 C3 HOBBS A1 A2 C TOBIN 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm 0.0 0.2 0.4 0.6 0.8 1.0 Summit Shoulder Backslope Footslope Toeslope Proportion

plotGeomorphCrossSection(osd, type = 'bar', clust = FALSE)

Ap E Bt1 Bt2 BC C1 C2 C3 BUTLER Ap AB Bt1 Bt2 Bt3 BC C1 C2 DETROIT Ap BA Bt1 Bt2 Bt3 Bt4 C Ab WYMORE Ap A BA Bt1 Bt2 BC C CRETE A1 A2 R SOGN Ap A BA Bt1 Bt2 Bt3 BC C PAWNEE A BA Bt1 Bt2 C R LABETTE A Bw C Cr CLIME Ap A BA Bt1 Bt2 BC C HASTINGS Ap BA Bt1 Bt2 BC C GEARY A BA Bt1 Bt2 Cr LANCASTER A AC C Cr KIPSON A1 A2 2Bt1 2Bt2 2Btk 3BCk 3Cr BENFIELD Ap A Bw1 Bw2 BC MUIR A BA Bt1 Bt2 BC C TULLY A C1 C2 C3 HOBBS A1 A2 C TOBIN 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm 2 5 17 4 14 13 10 3 7 6 11 9 1 12 16 8 15 vertic argiaquolls pachic argiustolls aquertic argiudolls pachic udertic argiustolls lithic haplustolls oxyaquic vertic argiudolls udic argiustolls udorthentic haplustolls udic argiustolls udic argiustolls udic argiustolls udorthentic haplustolls udertic argiustolls cumulic haplustolls pachic argiustolls mollic ustifluvents cumulic haplustolls Summit Shoulder Backslope Footslope Toeslope Proportion

o <- reconcileOSDGeomorph(osd, 'hillpos')
res <- vizHillslopePosition(o$geom, verbose = TRUE)
print(res$fig)

Proportion BUTLER DETROIT WYMORE CRETE SOGN LABETTE CLIME PAWNEE GEARY HASTINGS LANCASTER KIPSON BENFIELD MUIR TULLY HOBBS TOBIN 0.0 0.2 0.4 0.6 0.8 1.0 103 5 254 400 422 197 224 451 403 396 220 127 48 30 153 62 16 0 0 1.37 1.58 1.1 0.87 0.96 1.47 1.09 0.89 0.52 0.24 0 0 0 0 0 N H Toeslope Footslope Backslope Shoulder Summit

par(mar = c(1, 0, 1, 1))
idx <- match(hydOrder(o$geom, g = 'hillpos', clust = FALSE), profile_id(o$SPC))
plotSPC(o$SPC, plot.order = idx, width = 0.35, name.style = 'center-center', cex.names = 0.65)

Ap E Bt1 Bt2 BC C1 C2 C3 BUTLER Ap AB Bt1 Bt2 Bt3 BC C1 C2 DETROIT Ap BA Bt1 Bt2 Bt3 Bt4 C Ab WYMORE Ap A BA Bt1 Bt2 BC C CRETE A1 A2 R SOGN Ap A BA Bt1 Bt2 Bt3 BC C PAWNEE A BA Bt1 Bt2 C R LABETTE A Bw C Cr CLIME Ap A BA Bt1 Bt2 BC C HASTINGS Ap BA Bt1 Bt2 BC C GEARY A BA Bt1 Bt2 Cr LANCASTER A AC C Cr KIPSON A1 A2 2Bt1 2Bt2 2Btk 3BCk 3Cr BENFIELD Ap A Bw1 Bw2 BC MUIR A BA Bt1 Bt2 BC C TULLY A C1 C2 C3 HOBBS A1 A2 C TOBIN 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm

o <- reconcileOSDGeomorph(osd, 'geomcomp')
res <- vizGeomorphicComponent(o$geom, verbose = TRUE)
print(res$fig)

Proportion BUTLER DETROIT WYMORE CRETE HASTINGS PAWNEE LABETTE GEARY SOGN BENFIELD CLIME KIPSON LANCASTER TULLY HOBBS MUIR TOBIN 0.0 0.2 0.4 0.6 0.8 1.0 104 5 244 400 395 434 197 403 365 48 225 116 220 153 62 23 3 0 0 0.75 0.94 0.87 1.08 1.04 0.38 0.51 0 0 0 0 0.75 0 0 0 N H Interfluve Crest Head Slope Nose Slope Side Slope Base Slope

par(mar = c(1, 0, 1, 1))
idx <- match(hydOrder(o$geom, g = 'geomcomp', clust = FALSE), profile_id(o$SPC))
plotSPC(o$SPC, plot.order = idx, width = 0.35, name.style = 'center-center', cex.names = 0.65)

Ap E Bt1 Bt2 BC C1 C2 C3 BUTLER Ap AB Bt1 Bt2 Bt3 BC C1 C2 DETROIT Ap BA Bt1 Bt2 Bt3 Bt4 C Ab WYMORE Ap A BA Bt1 Bt2 BC C CRETE Ap A BA Bt1 Bt2 BC C HASTINGS Ap A BA Bt1 Bt2 Bt3 BC C PAWNEE A BA Bt1 Bt2 C R LABETTE Ap BA Bt1 Bt2 BC C GEARY A1 A2 R SOGN A1 A2 2Bt1 2Bt2 2Btk 3BCk 3Cr BENFIELD A Bw C Cr CLIME A AC C Cr KIPSON A BA Bt1 Bt2 Cr LANCASTER A BA Bt1 Bt2 BC C TULLY A C1 C2 C3 HOBBS Ap A Bw1 Bw2 BC MUIR A1 A2 C TOBIN 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm

o <- reconcileOSDGeomorph(osd, 'flats')
res <- vizFlatsPosition(o$geom, verbose = TRUE)
print(res$fig)

Proportion HASTINGS HOBBS 0.0 0.2 0.4 0.6 0.8 1.0 2 1 0 0 N H Dip Talf Flat Rise

par(mar = c(1, 0, 1, 2))
idx <- match(hydOrder(o$geom, g = 'flats', clust = FALSE), profile_id(o$SPC))
plotSPC(o$SPC, plot.order = idx, width = 0.35, name.style = 'center-center', cex.names = 0.65)

Ap A BA Bt1 Bt2 BC C HASTINGS A C1 C2 C3 HOBBS 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm

o <- reconcileOSDGeomorph(osd, 'terrace')
res <- vizTerracePosition(o$geom, verbose = TRUE)
print(res$fig)

Proportion HOBBS MUIR BUTLER HASTINGS CRETE DETROIT TOBIN SUTPHEN SHERDAHL WYMORE 0.0 0.2 0.4 0.6 0.8 1.0 35 129 23 1 9 126 35 3 21 3 1 0.34 0 0 0 0 0 0 0 0 N H Tread Riser

par(mar = c(1, 0, 1, 1))
idx <- match(hydOrder(o$geom, g = 'terrace', clust = FALSE), profile_id(o$SPC))
plotSPC(o$SPC, plot.order = idx, width = 0.35, name.style = 'center-center', cex.names = 0.65)

A C1 C2 C3 HOBBS Ap A Bw1 Bw2 BC MUIR Ap E Bt1 Bt2 BC C1 C2 C3 BUTLER Ap A BA Bt1 Bt2 BC C CRETE Ap AB Bt1 Bt2 Bt3 BC C1 C2 DETROIT Ap A BA Bt1 Bt2 BC C HASTINGS Ap A C1 C2 2Ab 2Bkb1 2Bkb2 2Bkb3 2Bkb4 SHERDAHL Ap A1 Bss Bkss1 Bkss2 C1 C2 SUTPHEN A1 A2 C TOBIN Ap BA Bt1 Bt2 Bt3 Bt4 C Ab WYMORE 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm

No mountains in this example.

o <- reconcileOSDGeomorph(osd, 'mtnpos')
res <- vizMountainPosition(o$geom, verbose = TRUE)
print(res$fig)

No mountains in this example.

par(mar = c(1, 0, 1, 0))
idx <- match(hydOrder(o$geom, g = 'mtnpos', clust = FALSE), profile_id(o$SPC))
plotSPC(o$SPC, plot.order = idx, width = 0.35, name.style = 'center-center', cex.names = 0.65)
o <- reconcileOSDGeomorph(osd, 'shape_across')
res <- vizSurfaceShape(o$geom, title = 'Shape Across', verbose = TRUE)
print(res$fig)

Shape Across Proportion KIPSON WYMORE SOGN LABETTE PAWNEE HASTINGS CLIME CRETE GEARY DETROIT BENFIELD TULLY LANCASTER MUIR SUTPHEN SHERDAHL HOBBS BUTLER TOBIN 0.0 0.2 0.4 0.6 0.8 1.0 124 281 397 197 475 419 224 411 409 154 48 151 226 155 76 21 956 219 136 1 0.84 0.71 0.7 0.23 0.06 0 0 0 0 0 0 0 0 0 0 0.1 0.1 0.48 N H Concave Linear Convex Complex Undulating

par(mar = c(1, 0, 1, 1))
idx <- match(hydOrder(o$geom, g = 'shape', clust = FALSE), profile_id(o$SPC))
plotSPC(o$SPC, plot.order = idx, width = 0.35, name.style = 'center-center', cex.names = 0.65)

A AC C Cr KIPSON Ap BA Bt1 Bt2 Bt3 Bt4 C Ab WYMORE A1 A2 R SOGN A BA Bt1 Bt2 C R LABETTE Ap A BA Bt1 Bt2 Bt3 BC C PAWNEE Ap A BA Bt1 Bt2 BC C HASTINGS A1 A2 2Bt1 2Bt2 2Btk 3BCk 3Cr BENFIELD A Bw C Cr CLIME Ap A BA Bt1 Bt2 BC C CRETE Ap AB Bt1 Bt2 Bt3 BC C1 C2 DETROIT Ap BA Bt1 Bt2 BC C GEARY A BA Bt1 Bt2 Cr LANCASTER Ap A Bw1 Bw2 BC MUIR Ap A C1 C2 2Ab 2Bkb1 2Bkb2 2Bkb3 2Bkb4 SHERDAHL Ap A1 Bss Bkss1 Bkss2 C1 C2 SUTPHEN A BA Bt1 Bt2 BC C TULLY A C1 C2 C3 HOBBS Ap E Bt1 Bt2 BC C1 C2 C3 BUTLER A1 A2 C TOBIN 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm

o <- reconcileOSDGeomorph(osd, 'shape_down')
res <- vizSurfaceShape(o$geom, title = 'Shape Down', verbose = TRUE)
print(res$fig)

Shape Down Proportion SOGN LABETTE WYMORE PAWNEE CLIME KIPSON CRETE GEARY LANCASTER HASTINGS BENFIELD DETROIT SHERDAHL TOBIN MUIR HOBBS BUTLER SUTPHEN TULLY 0.0 0.2 0.4 0.6 0.8 1.0 397 197 281 475 224 124 411 409 226 419 48 154 21 136 155 956 219 76 151 0.25 0.77 0.77 0.87 0.95 1.13 1.02 0.82 0.94 0.95 0 0 0 0.19 0.72 0.47 0.39 0 0 N H Concave Linear Convex Complex Undulating

par(mar = c(1, 0, 1, 1))
idx <- match(hydOrder(o$geom, g = 'shape', clust = FALSE), profile_id(o$SPC))
plotSPC(o$SPC, plot.order = idx, width = 0.35, name.style = 'center-center', cex.names = 0.65)

A1 A2 R SOGN Ap BA Bt1 Bt2 Bt3 Bt4 C Ab WYMORE A BA Bt1 Bt2 C R LABETTE Ap A BA Bt1 Bt2 Bt3 BC C PAWNEE A Bw C Cr CLIME A AC C Cr KIPSON Ap A BA Bt1 Bt2 BC C CRETE A BA Bt1 Bt2 Cr LANCASTER Ap BA Bt1 Bt2 BC C GEARY Ap A BA Bt1 Bt2 BC C HASTINGS A1 A2 2Bt1 2Bt2 2Btk 3BCk 3Cr BENFIELD Ap AB Bt1 Bt2 Bt3 BC C1 C2 DETROIT Ap A C1 C2 2Ab 2Bkb1 2Bkb2 2Bkb3 2Bkb4 SHERDAHL A1 A2 C TOBIN Ap A Bw1 Bw2 BC MUIR A C1 C2 C3 HOBBS Ap E Bt1 Bt2 BC C1 C2 C3 BUTLER Ap A1 Bss Bkss1 Bkss2 C1 C2 SUTPHEN A BA Bt1 Bt2 BC C TULLY 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm

Problematic Clustering

s <- siblings('ava')
s <- c('Ava', s$sib$sibling)
o <- fetchOSD(s, extended = TRUE)

iterateHydOrder(o$hillpos, g = 'hillpos', j.amount = 0.05)
## $clust
## 
## Call:
## diana(x = daisy(x.prop, type = list(numeric = 1:n.prop)))
## 
## Cluster method   : NA 
## Distance         : euclidean 
## Number of objects: 12 
## 
## 
## $hyd.order
##  [1] "SHAKAMAK"     "WYNOOSE"      "ROSSMOYNE"    "AVA"          "BLUFORD"      "PARKE"       
##  [7] "SWITZERLAND"  "HICKORY"      "EDEN"         "BLAIR"        "IVA"          "HOOSIERVILLE"
## 
## $clust.hyd.order
##  [1] "AVA"          "BLUFORD"      "PARKE"        "SWITZERLAND"  "HICKORY"      "EDEN"        
##  [7] "BLAIR"        "SHAKAMAK"     "WYNOOSE"      "ROSSMOYNE"    "IVA"          "HOOSIERVILLE"
## 
## $match.rate
## [1] 0.1666667
## 
## $obj
## [1] 502
## 
## $niter
## [1] 20
# 
vizHillslopePosition(o$hillpos, verbose = TRUE)
## $fig

Proportion AVA BLUFORD PARKE SWITZERLAND HICKORY EDEN BLAIR SHAKAMAK WYNOOSE ROSSMOYNE IVA HOOSIERVILLE 0.0 0.2 0.4 0.6 0.8 1.0 792 351 208 51 963 196 96 12 188 170 53 19 1.49 1.52 1.54 1.51 1.12 1.1 0.87 0 0 1.32 1.76 0.9 N H Toeslope Footslope Backslope Shoulder Summit

## 
## $order
##  [1]  1  3  8 11  5  4  2 10 12  9  7  6
## 
## $clust
## 
## Call:
## diana(x = daisy(x.prop, type = list(numeric = 1:n.prop)))
## 
## Cluster method   : NA 
## Distance         : euclidean 
## Number of objects: 12 
## 
## 
## $match.rate
## [1] 0.1666667
vizHillslopePosition(o$hillpos, j.amount = 0.0001, verbose = TRUE)
## $fig

Proportion AVA BLUFORD PARKE SWITZERLAND HICKORY EDEN BLAIR SHAKAMAK WYNOOSE ROSSMOYNE IVA HOOSIERVILLE 0.0 0.2 0.4 0.6 0.8 1.0 792 351 208 51 963 196 96 12 188 170 53 19 1.49 1.52 1.54 1.51 1.12 1.1 0.87 0 0 1.32 1.76 0.9 N H Toeslope Footslope Backslope Shoulder Summit

## 
## $order
##  [1]  1  3  8 11  5  4  2 10 12  9  7  6
## 
## $clust
## 
## Call:
## diana(x = daisy(x.prop, type = list(numeric = 1:n.prop)))
## 
## Cluster method   : NA 
## Distance         : euclidean 
## Number of objects: 12 
## 
## 
## $match.rate
## [1] 0.1666667
# use local data
data("OSDexamples")

o <- reconcileOSDGeomorph(OSDexamples, 'hillpos')

knitr::kable(o$geom, digits = 3)
series Toeslope Footslope Backslope Shoulder Summit n shannon_entropy
AMADOR 0.000 0.163 0.571 0.082 0.184 49 1.632
ARGONAUT 0.038 0.367 0.392 0.190 0.013 79 1.775
CECIL 0.000 0.000 0.316 0.355 0.329 1006 1.583
DRUMMER 0.986 0.012 0.000 0.000 0.002 1623 0.115
HANFORD 0.517 0.329 0.154 0.000 0.000 149 1.436
MOGLIA 0.000 0.195 0.268 0.293 0.244 41 1.985
MUSICK 0.000 0.000 0.753 0.195 0.052 77 0.989
PALAU 0.200 0.200 0.200 0.200 0.200 100 2.322
PARDEE 0.000 0.070 0.254 0.155 0.521 71 1.678
PENTZ 0.000 0.093 0.567 0.093 0.247 97 1.599
REDDING 0.094 0.063 0.150 0.024 0.669 127 1.498
SIERRA 0.000 0.018 0.802 0.108 0.072 111 0.980
SYCAMORE 1.000 0.000 0.000 0.000 0.000 16 0.000
VLECK 0.000 1.000 0.000 0.000 0.000 5 0.000
WILLOWS 1.000 0.000 0.000 0.000 0.000 50 0.000
YOLO 0.593 0.322 0.085 0.000 0.000 59 1.275
ZOOK 0.986 0.015 0.000 0.000 0.000 484 0.109
res <- vizHillslopePosition(o$geom, verbose = TRUE)
print(res$fig)

Proportion PARDEE REDDING CECIL MOGLIA PALAU PENTZ AMADOR MUSICK SIERRA ARGONAUT HANFORD YOLO DRUMMER ZOOK SYCAMORE WILLOWS VLECK 0.0 0.2 0.4 0.6 0.8 1.0 71 127 1006 41 100 97 49 77 111 79 149 59 1623 484 16 50 5 1.68 1.5 1.58 1.98 2.32 1.6 1.63 0.99 0.98 1.77 1.44 1.28 0.11 0.11 0 0 0 N H Toeslope Footslope Backslope Shoulder Summit

# truncate profiles at 180cm
options(.aqp.plotSPC.args = list(max.depth = 180))

par(mar = c(1, 0, 1, 2))
plotGeomorphCrossSection(OSDexamples, type = 'line', maxIter = 100, j.amount = 0.05, verbose = TRUE)

A1 A2 Bt1 Bt2 2Bt3 2R PARDEE A1 A2 2Bt 3Bqm REDDING Ap Bt1 Bt2 BC C CECIL A Bkz Bknz 2Bknz 2Bknyz 3Bknyz MOGLIA A1 B1 B21 B22 B23 C PALAU A1 A2 Bw Bt Cr PENTZ A Bw1 Bw2 Cr AMADOR Oi A AB Bt1 Bt2 BCt MUSICK Ap BAt Bt1 Bt2 BCt C SIERRA A1 A2 Bt1 Bt2 Bt3 Cr ARGONAUT A1 C1 C2 HANFORD Ap1 Ap2 A1 A2 C1 C2 Ab C'3 YOLO Ap A BA Bg Btg1 Btg2 2Btg3 2Cg DRUMMER Ap A1 A2 A3 A4 Bg BCg Cg ZOOK Apg Bssg Bknssg Bnssg1 Bnssg2 Bnssg3 Bnssg4 WILLOWS Ap Bg1 Bg2 C SYCAMORE A1 A2 2Bt1/E 2Bt2 2Bt3/2Bq1 2Bq2 2Bq3 2Cr VLECK 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm 0.0 0.2 0.4 0.6 0.8 1.0 Summit Shoulder Backslope Footslope Toeslope Proportion

par(mar = c(1, 0, 1, 2))
plotGeomorphCrossSection(OSDexamples, type = 'line', clust = FALSE)

A1 A2 Bt1 Bt2 2Bt3 2R PARDEE A1 A2 2Bt 3Bqm REDDING Ap Bt1 Bt2 BC C CECIL A Bkz Bknz 2Bknz 2Bknyz 3Bknyz MOGLIA A1 A2 Bw Bt Cr PENTZ Oi A AB Bt1 Bt2 BCt MUSICK A Bw1 Bw2 Cr AMADOR Ap BAt Bt1 Bt2 BCt C SIERRA A1 B1 B21 B22 B23 C PALAU A1 A2 Bt1 Bt2 Bt3 Cr ARGONAUT A1 A2 2Bt1/E 2Bt2 2Bt3/2Bq1 2Bq2 2Bq3 2Cr VLECK A1 C1 C2 HANFORD Ap1 Ap2 A1 A2 C1 C2 Ab C'3 YOLO Ap A BA Bg Btg1 Btg2 2Btg3 2Cg DRUMMER Ap A1 A2 A3 A4 Bg BCg Cg ZOOK Ap Bg1 Bg2 C SYCAMORE Apg Bssg Bknssg Bnssg1 Bnssg2 Bnssg3 Bnssg4 WILLOWS 175 cm 150 cm 125 cm 100 cm 75 cm 50 cm 25 cm 0 cm 0.0 0.2 0.4 0.6 0.8 1.0 Summit Shoulder Backslope Footslope Toeslope Proportion

## TODO: ensure geomorph data + type aren't mixed up

hydOrder(osd$hillpos, g = 'hillpos', clust = FALSE)
##  [1] "BUTLER"    "DETROIT"   "WYMORE"    "CRETE"     "SOGN"      "PAWNEE"    "LABETTE"   "CLIME"    
##  [9] "HASTINGS"  "GEARY"     "LANCASTER" "KIPSON"    "BENFIELD"  "MUIR"      "TULLY"     "HOBBS"    
## [17] "TOBIN"
hydOrder(osd$hillpos, g = 'hillpos', clust = TRUE)
## $clust
## 
## Call:
## diana(x = daisy(x.prop, type = list(numeric = 1:n.prop)))
## 
## Cluster method   : NA 
## Distance         : euclidean 
## Number of objects: 17 
## 
## 
## $hyd.order
##  [1] "BUTLER"    "DETROIT"   "WYMORE"    "CRETE"     "SOGN"      "PAWNEE"    "LABETTE"   "CLIME"    
##  [9] "HASTINGS"  "GEARY"     "LANCASTER" "KIPSON"    "BENFIELD"  "MUIR"      "TULLY"     "HOBBS"    
## [17] "TOBIN"    
## 
## $clust.hyd.order
##  [1] "CRETE"     "SOGN"      "LABETTE"   "CLIME"     "PAWNEE"    "GEARY"     "HASTINGS"  "LANCASTER"
##  [9] "KIPSON"    "BENFIELD"  "BUTLER"    "DETROIT"   "WYMORE"    "MUIR"      "TULLY"     "HOBBS"    
## [17] "TOBIN"    
## 
## $match.rate
## [1] 0.2352941
## 
## $obj
## [1] 640
hydOrder(osd$flats, g = 'flats', clust = FALSE)
## [1] "HASTINGS" "HOBBS"

Reset options.

options(.aqp.plotSPC.args = NULL)

This document is based on aqp version 2.3.1, soilDB version 2.9.0, and sharpshootR version 2.4.1.