This is the R interface to OSD search by Section and OSD Search APIs provided by SoilWeb.
OSD records are searched with the PostgreSQL fulltext indexing and query system (syntax details). Each search field (except for the "brief narrative" and MLRA) corresponds with a section header in an OSD. The results may not include every OSD due to formatting errors and typos. Results are scored based on the number of times search terms match words in associated sections.
Usage
OSDquery(
everything = NULL,
mlra = "",
taxonomic_class = "",
typical_pedon = "",
brief_narrative = "",
ric = "",
use_and_veg = "",
competing_series = "",
geog_location = "",
geog_assoc_soils = "",
remarks = ""
)Arguments
- everything
search entire OSD text (default is NULL),
mlramay also be specified, all other arguments are ignored- mlra
a comma-delimited string of MLRA to search ('17,18,22A'), see Details
- taxonomic_class
search family level classification, see Details
- typical_pedon
search typical pedon section
- brief_narrative
search brief narrative
- ric
search range in characteristics section
- use_and_veg
search use and vegetation section
- competing_series
search competing series section
- geog_location
search geographic setting section
- geog_assoc_soils
search geographically associated soils section
- remarks
search remarks section (typically contains diagnostic horizons / features)
Details
Queries including the taxonomic_class argument make use of the Soil Classification database, not fulltext search of OSD records. Queries including the mlra argument make use of a SoilWeb data source based on spatial intersection (SSURGO x MLRA polygons), updated quarterly. MLRA queries are only possible for those soil series used in the current SSURGO snapshot.
The mlra argument must be combined with another argument in order to become active. For example, search for series with "5GY" hues in the "typical pedon" section, but limit to just MLRA 18: OSDquery(mlra = '18', typical_pedon = '5GY').
Syntax Notes:
The PostgreSQL fulltext query syntax is complex, but many common text search concepts are familiar:
logical AND:
&logical OR:
|wildcard, e.g. rhy-something:
rhy:*search terms with spaces need doubled single quotes:
''san joaquin''combine search terms into a single expression:
(grano:* | granite)
Examples
Strategies for searching entire OSD records:
iowa & smectitic & verti:* & Cg & ! saturatediowa & smectitic & verti:* & Cg & terrace(sulfi:* | sulfa:*) & aq:*Coarse-loamy & mixed & active & thermic & Mollic & Haploxeralfssierra & nevada & (meta:* | metamorphic) & xer:* & thermic & lithicsierra & nevada & foothill & (grano:* | granite) & thermicrhyo:* & tuff:* & California & thermicparalithic & thermic & !mesic & mollic & epipedon(gypsum | gyp:*) (MLRA: 15,17)flood & plains & toe & slope
Strategies for search OSD fields:
taxonomic_class = 'duri:* & thermic': family level classification contains "duri-" prefix and "thermic"typical_pedon = 'cobbly & ashy & silt & loam': "cobbly, ashy, silt, loam", any horizongeog_location = 'strath & terrace': "strath" and "terrace" in geographic setting narrative
Related documentation can be found in the following tutorials
References
USDA-NRCS OSD search tools: https://soilseries.sc.egov.usda.gov/
Examples
# \donttest{
# find all series that list Pardee as a geographically associated soil.
s <- OSDquery(geog_assoc_soils = 'pardee')
# get data for these series
x <- fetchOSD(s$series, extended = TRUE, colorState = 'dry')
# simple figure
par(mar=c(0,0,1,1))
if (!is.null(x$SPC) && inherits(x$SPC, "SoilProfileCollection")){
aqp::plotSPC(x$SPC)
}
# }