Download soil characterization and morphologic data via BBOX, MLRA, or soil series name query, from the KSSL database.

  series = NA,
  bbox = NA,
  mlra = NA,
  pedlabsampnum = NA,
  pedon_id = NA,
  pedon_key = NA,
  returnMorphologicData = FALSE,
  returnGeochemicalData = FALSE,
  simplifyColors = FALSE,
  progress = TRUE



vector of soil series names, case insensitive


a single bounding box in WGS84 geographic coordinates e.g. c(-120, 37, -122, 38)


vector of MLRA IDs, e.g. "18" or "22A"


vector of KSSL pedon lab sample number


vector of user pedon ID


vector of KSSL internal pedon ID


logical, optionally request basic morphologic data, see details section


logical, optionally request geochemical, optical and XRD/thermal data, see details section


logical, simplify colors (from morphologic data) and join with horizon data


logical, optionally give progress when iterating over multiple requests


a SoilProfileCollection object when returnMorphologicData is FALSE, otherwise a list.


This is an experimental interface to a subset for the most commonly used data from a snapshot of KSSL (lab characterization) and NASIS (morphologic) data.

Series-queries are case insensitive. Series name is based on the "correlated as" field (from KSSL snapshot) when present. The "sampled as" classification was promoted to "correlated as" if the "correlated as" classification was missing.

When returnMorphologicData is TRUE, the resulting object is a list. The standard output from fetchKSSL (SoilProfileCollection object) is stored in the named element "SPC". The additional elements are basic morphologic data: soil color, rock fragment volume, pores, structure, and redoximorphic features. There is a 1:many relationship between the horizon data in "SPC" and the additional dataframes in morph. See examples for ideas on how to "flatten" these tables.

When returnGeochemicalData is TRUE, the resulting object is a list. The standard output from fetchKSSL (SoilProfileCollection object) is stored in the named element "SPC". The additional elements are geochemical and mineralogy analysis tables, specifically: geochemical/elemental analyses "geochem", optical mineralogy "optical", and X-ray diffraction / thermal "xrd_thermal". returnGeochemicalData will include additional dataframes geochem, optical, and xrd_thermal in list result.

Setting simplifyColors=TRUE will automatically flatten the soil color data and join to horizon level attributes.

Function arguments (series, mlra, etc.) are fully vectorized except for bbox.


SoilWeb maintains a snapshot of these KSSL and NASIS data. The SoilWeb snapshot was developed using methods described here: Please use the link below for the live data.


See also


D.E. Beaudette and A.G. Brown


# \donttest{ if(requireNamespace("curl") & curl::has_internet()) { library(aqp) library(plyr) library(reshape2) # search by series name s <- fetchKSSL(series='auburn') # search by bounding-box # s <- fetchKSSL(bbox=c(-120, 37, -122, 38)) # how many pedons length(s) # plot plotSPC(s, name='hzn_desgn', max.depth=150) ## ## morphologic data ## # get lab and morphologic data s <- fetchKSSL(series='auburn', returnMorphologicData = TRUE) # extract SPC pedons <- s$SPC ## automatically simplify color data s <- fetchKSSL(series='auburn', returnMorphologicData = TRUE, simplifyColors=TRUE) # check par(mar=c(0,0,0,0)) plot(pedons, color='moist_soil_color', }
#> This is aqp 1.30
#> #> Attaching package: 'aqp'
#> The following object is masked from 'package:stats': #> #> filter
#> #> Attaching package: 'plyr'
#> The following objects are masked from 'package:aqp': #> #> mutate, summarize
#> 14 pedons loaded (0.06 Mb transferred)
#> 14 pedons loaded (0.09 Mb transferred)
#> mixing dry colors ... [2 of 53 horizons]
#> mixing moist colors ... [4 of 52 horizons]
#> 14 pedons loaded (0.09 Mb transferred)
# }