This function queries the gSSURGO database for a series of map unit keys
Source:R/gSSURGO_Query.R
gSSURGO.Query.RdThis function queries the gSSURGO database for a series of map unit keys
Usage
gSSURGO.Query(
mukeys,
fields = c("chorizon.sandtotal_r", "chorizon.silttotal_r", "chorizon.claytotal_r")
)Details
This function queries the NRCS gSSURGO database using map unit keys (mukeys).
Available tables:
mapunit,component,muaggatt,chorizon, andchfrags.Field definitions: Fields must be specified with their associated table name. For example, total sand content is stored in the
chorizontable and must be requested aschorizon.sandtotal_(r|l|h), where:r= representative valuel= low valueh= high value
Commonly queried fields and units (see NRCS gSSURGO "Tables and Columns Report" for full list):
| Field | Description | Units |
chorizon.cec7_r | Cation exchange capacity at pH 7 | cmol(+)/kg |
chorizon.sandtotal_r | Total sand (<2 mm fraction) | % |
chorizon.silttotal_r | Total silt (<2 mm fraction) | % |
chorizon.claytotal_r | Total clay (<0.002 mm fraction) | % |
chorizon.om_r | Organic matter (<2 mm soil) | % |
chorizon.hzdept_r | Horizon top depth | cm |
chfrags.fragvol_r | Rock fragments | % (by volume) |
chorizon.dbthirdbar_r | Bulk density at field capacity | g/cm³ |
chorizon.ph1to1h2o_r | Soil pH (1:1 H2O) | pH (unitless) |
chorizon.cokey | Component key (identifier) | — |
chorizon.chkey | Horizon key (identifier) | — |
API stability: The NRCS occasionally modifies the API schema. If queries fail, adjustments may be required here to align with the updated structure.
Full documentation of available tables and their relationships is provided in the gSSURGO documentation.
Examples
if (FALSE) { # \dontrun{
PEcAn.data.land::gSSURGO.Query(
mukeys = 2747727,
fields = c(
"chorizon.cec7_r", "chorizon.sandtotal_r",
"chorizon.silttotal_r","chorizon.claytotal_r",
"chorizon.om_r","chorizon.hzdept_r","chorizon.frag3to10_r",
"chorizon.dbovendry_r","chorizon.ph1to1h2o_r",
"chorizon.cokey","chorizon.chkey"))
} # }