Queries the ISRIC SoilGrids REST API for soil properties at given coordinates.
Arguments
- env.id
vector (character). Environment identifiers.
- lat, lon
vector (numeric). Coordinates in decimal degrees (WGS84).
- variables.names
vector (character). SoilGrids properties. See Details.
- depths
vector (character). Depth intervals to request.
- stat
character. Which summary to return:
"mean"(default),"q_5","q_50","q_95"or"uncertainty".- wide
boolean. Return one row per environment with one column per property-depth (default), else long format.
- sleep
numeric. Minimum seconds between successive API requests. Minimum 12 (SoilGrids fair-use limit of 5 requests/min). Network time counts toward this interval, and duplicate coordinates are fetched only once.
- tries
integer. Retry attempts per failed request.
- timeout
numeric. Maximum seconds to wait for a single SoilGrids response before the request is aborted and retried. Prevents one stalled connection from blocking the whole sequential download. Default 60.
- verbose
boolean. Print progress messages.
Details
Accepted properties: bdod, cec, cfvo, clay,
nitrogen, ocd, ocs, phh2o, sand,
silt, soc, wv0010, wv0033, wv1500.
SoilGrids returns values in mapped units (e.g. clay in g/kg x 10). No unit
conversion is applied; the unit column records what was served.
References
Poggio, L. et al. (2021). SoilGrids 2.0: producing soil information for the globe with quantified spatial uncertainty. SOIL 7, 217-240.
Examples
if (FALSE) { # \dontrun{
## Requires the live SoilGrids service.
get_soil(env.id = "NM", lat = -13.05, lon = -56.05,
variables.names = c("clay", "nitrogen"))
} # }
