OSDquery: filter by benchmark series #234
Replies: 3 comments
-
Thanks for using the "Discussions" feature! Currently the In the meantime here is a workaround that downloads a snapshot of the Series Classification database from https://github.com/ncss-tech/SoilWeb-data/ and uses the library(aqp)
#> This is aqp 1.40
library(soilDB)
# library(R.utils)
# download series classification database and unzip
x <- download.file("https://github.com/ncss-tech/SoilWeb-data/raw/main/files/SC-database.csv.gz",
destfile = 'series-classification-database.csv.gz', mode = "wb")
R.utils::gunzip('series-classification-database.csv.gz', overwrite = TRUE)
sc <- read.csv('series-classification-database.csv')
# subset to just benchmark soils
sc.benchmark <- subset(sc, benchmarksoilflag)
# find OSDs of Haploxeralfs in MLRAs 17 and 18
mlra <- c("17","18")
osd_haploxeralfs <- do.call('rbind', lapply(mlra, function(x) OSDquery(mlra = x, taxonomic_class = "Haploxeralfs")))
# get just benchmark
osd_benchmark_haploxeralfs <- subset(osd_haploxeralfs, osd_haploxeralfs$series %in% sc.benchmark$soilseriesname)
# inspect result
o <- fetchOSD(osd_benchmark_haploxeralfs$series)
plotSPC(o) |
Beta Was this translation helpful? Give feedback.
-
EDIT: haha, @brownag beat me to it. It isn't currently possible, but something that I would like to add in the near future. Thanks for the idea. Until this is implemented, you can augment your search with the Soil Classification database snapshot. This contains a column called tf <- tempfile()
download.file('https://github.com/ncss-tech/SoilWeb-data/raw/main/files/SC-database.csv.gz', tf)
x <- read.csv(tf)
# see "benchmarksoilflag" column
x[x$soilseriesname == 'CORNING', 1:4] |
Beta Was this translation helpful? Give feedback.
-
Thanks for the solution, @brownag and @dylanbeaudette! I appreciate the quick replies |
Beta Was this translation helpful? Give feedback.
-
Is it currently possible to limit an OSD query to benchmark series within soilDB as allowed by the NRCS OSD Query Facility? I didn't see a way to do that within the SoilWeb OSD search interface.
Beta Was this translation helpful? Give feedback.
All reactions