
Fetch a SoilGrids 250 m stack over an AoI
Source:R/foundation_tiles.R
foundation_tile_source_soilgrids.RdThin convenience wrapper around geodata::soil_world() that pulls
the listed variables, crops them to the area of interest, and
returns them as a single terra::SpatRaster with one layer per
variable. SoilGrids is public and keyless so no authentication
is required.
Arguments
- variables
Character vector of SoilGrids variable codes. Common choices:
"soc"(organic carbon),"clay","sand","phh2o"(pH in water),"cec","bdod"(bulk density),"nitrogen","cfvo"(coarse fragments).- depth
Character, one of
"0-5cm","5-15cm","15-30cm","30-60cm","60-100cm","100-200cm".- stat
Character, one of
"mean","Q0.05","Q0.5","Q0.95".- aoi
A
terra::SpatExtent,sfbounding box, or a length-4 numeric vectorc(xmin, xmax, ymin, ymax)in WGS84 degrees.- path
Directory where
geodatacaches raw downloads (defaults totempdir()).
Value
A terra::SpatRaster with one layer per requested variable,
cropped to the AoI.