get_isric_soil_profile: Generate a synthetic APSIM soil profile from the ISRIC soil...

View source: R/get_isric_soil_profile.R

get_isric_soil_profileR Documentation

Generate a synthetic APSIM soil profile from the ISRIC soil database

Description

Retrieves soil data from the ISRIC global database and converts it to an APSIM soil_profile object

Usage

get_isric_soil_profile(
  lonlat,
  statistic = c("mean", "Q0.5"),
  soil.profile,
  find.location.name = TRUE,
  fix = FALSE,
  verbose = TRUE,
  check = TRUE,
  physical = c("default", "SR"),
  xargs = NULL
)

Arguments

lonlat

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

statistic

default is the mean

soil.profile

a soil profile to fill in in case the default one is not appropriate

find.location.name

default is TRUE. Use either maps package or photon API to find Country/State. If you are running this function many times it might be better to set this to FALSE.

fix

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

verbose

argument passed to the fix function.

check

whether to check the soil profile (default is TRUE)

physical

whether soil physical properties are obtained from the data base or through ‘SR’, Saxton and Rawls pedotransfer functions.

xargs

additional arguments passed to apsimx_soil_profile or ‘apsimx:::approx_soil_variable’ function. At the moment these are: ‘soil.bottom’, ‘method’ and ‘nlayers’.

Details

Source: https://www.isric.org/
Details: https://www.isric.org/explore/soilgrids/faq-soilgrids

Pedotransfer functions: Saxton and Rawls, 2006. Soil Water Characteristic Estimates by Texture and Organic Matter for Hydrologic Solutions. Soil Sci. Soc. Am. J. 70:1569–1578.

TODO: need to look into how this is done in APSIM NG https://github.com/APSIMInitiative/ApsimX/pull/3994/files

NOTE: Eric Zurcher provided help by sending me an R file originally written by Andrew Moore. It provides a bit of context for how some of the decisions were made for constructing the synthetic soil profiles in APSIM. (email from june 3 2021).

Variable which are directly retrieved and a simple unit conversion is performed:
* Bulk density - bdod
* Carbon - soc
* Clay - clay
* Sand - sand
* PH - phh2o
* Nitrogen - nitrogen
Variables which are optionally estimated using pedotransfer functions:
LL15, DUL, SAT, KS, AirDry
TO-DO:
What do I do with nitrogen?
Can I use CEC?
How can I have a guess at FBiom and Finert?
FBiom does not depend on any soil property at the moment, should it?

Value

it generates an object of class ‘soil_profile’.

Author(s)

Fernando E. Miguez, Eric Zurcher (CSIRO) and Andrew Moore (CSIRO)

See Also

apsimx_soil_profile, edit_apsim_replace_soil_profile, edit_apsimx_replace_soil_profile.

Examples

## Not run: 
## Only run this if rest.isric.org is working
rest.isric.on <- suppressWarnings(try(readLines("http://rest.isric.org", 
n = 1, warn = FALSE), silent = TRUE))

## Get soil profile properties for a single point
if(!inherits(rest.isric.on, "try-error")){
  sp1 <- get_isric_soil_profile(lonlat = c(-93, 42), fix = TRUE, verbose = FALSE)
  ## Visualize
  plot(sp1)
  plot(sp1, property = "water")
 }

## End(Not run)

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