Skip to contents

This 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")
)

Arguments

mukeys

map unit key from gssurgo

fields

a character vector of the fields to be extracted. See details and the default argument to find out how to define fields.

Value

a dataframe with soil properties.

Details

This function queries the NRCS gSSURGO database using map unit keys (mukeys).

  • Available tables: mapunit, component, muaggatt, chorizon, and chfrags.

  • Field definitions: Fields must be specified with their associated table name. For example, total sand content is stored in the chorizon table and must be requested as chorizon.sandtotal_(r|l|h), where:

    • r = representative value

    • l = low value

    • h = high value

Commonly queried fields and units (see NRCS gSSURGO "Tables and Columns Report" for full list):

FieldDescriptionUnits
chorizon.cec7_rCation exchange capacity at pH 7cmol(+)/kg
chorizon.sandtotal_rTotal sand (<2 mm fraction)%
chorizon.silttotal_rTotal silt (<2 mm fraction)%
chorizon.claytotal_rTotal clay (<0.002 mm fraction)%
chorizon.om_rOrganic matter (<2 mm soil)%
chorizon.hzdept_rHorizon top depthcm
chfrags.fragvol_rRock fragments% (by volume)
chorizon.dbthirdbar_rBulk density at field capacityg/cm³
chorizon.ph1to1h2o_rSoil pH (1:1 H2O)pH (unitless)
chorizon.cokeyComponent key (identifier)
chorizon.chkeyHorizon 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.

Author

Hamze Dokohaki, Akash

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"))
} # }