get_ssurgo_soil_profile: Retrieve soil profile data and convert it to an object of...

View source: R/get_ssurgo_soil_profile.R

get_ssurgo_soil_profileR Documentation

Retrieve soil profile data and convert it to an object of class ‘soil_profile’

Description

Generate a synthetic soil profile based on the information in SSURGO database

Usage

get_ssurgo_soil_profile(
  lonlat,
  shift = -1,
  nmapunit = 1,
  nsoil = 1,
  xout = NULL,
  soil.bottom = 200,
  method = c("constant", "linear"),
  nlayers = 10,
  check = TRUE,
  fix = FALSE,
  verbose = FALSE,
  xargs = NULL
)

Arguments

lonlat

Longitude and latitude vector (e.g. c(-93, 42))

shift

simple mechanism for creating an area of interest by displacing the point indicated in lonlat by some amount of distance (e.g. 300 - in meters)

nmapunit

number of mapunits to select (see ssurgo2sp)

nsoil

number of soils to select (see ssurgo2sp). If the number of soils is negative or NA it will fetch all the soils in the mapunit

xout

see ssurgo2sp

soil.bottom

see ssurgo2sp

method

interpolation method see ssurgo2sp

nlayers

number for layer for the new soil profile

check

whether to check for reasonable values using check_apsimx_soil_profile. TRUE by default. If ‘fix’ is TRUE, it will be applied only after the fix attempt.

fix

whether to fix compatibility between saturation and bulk density (default is FALSE).

verbose

default FALSE. Whether to print messages.

xargs

additional arguments passed to apsimx_soil_profile function.

Details

Data source is USDA-NRCS Soil Data Access. See package soilDB for more details

Value

this function will always return a list. Each element of the list will be an object of class ‘soil_profile’

Examples

## Not run: 
require(soilDB)
require(sp)
require(sf)
require(spData)
require(ggplot2)
## Soil inforation for a single point
sp <- get_ssurgo_soil_profile(lonlat = c(-93, 42))
## The initial attempt throws warnings, so better to use 'fix'
sp <- get_ssurgo_soil_profile(lonlat = c(-93, 42), fix = TRUE)
plot(sp[[1]])
plot(sp[[1]], property = "water")
## Add initial water
iwat <- initialwater_parms(Thickness = sp[[1]]$soil$Thickness,
                           InitialValues = sp[[1]]$soil$DUL * 0.8)
sp[[1]]$initialwater <- iwat
plot(sp[[1]], property = "initialwater")

## End(Not run)



apsimx documentation built on Sept. 11, 2024, 5:42 p.m.