Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fetchSoilGrids

Fetch SoilGrids 250m properties information from point locations


Description

This function obtains SoilGrids properties information (250m raster resolution) given a data.frame containing site IDs, latitudes and longitudes.

Usage

fetchSoilGrids(locations, loc.names = c("id", "lat", "lon"))

Arguments

locations

A data.frame containing 3 columns referring to site ID, latitude and longitude.

loc.names

Optional: Column names referring to site ID, latitude and longitude. Default: c("id","lat","lon")

Details

The depth intervals returned are: "0-5cm", "5-15cm", "15-30cm", "30-60cm", "60-100cm", "100-200cm" and the properties returned are "bdod", "cec", "cfvo", "clay", "nitrogen", "phh2o", "sand", "silt", "soc" – each with 5th, 50th, 95th, mean and uncertainty values. Point data requests are made through properties/query endpoint of the SoilGrids v2.0 REST API: https://rest.soilgrids.org/soilgrids/v2.0/docs

Value

A SoilProfileCollection

Author(s)

Andrew G. Brown

Examples

if(requireNamespace("curl") &
   curl::has_internet()) {
  
  library(aqp)

  your.points <- data.frame(id  = c("A", "B"), 
                           lat = c(37.9, 38.1), 
                           lon = c(-120.3, -121.5), 
                           stringsAsFactors = FALSE)

  x <- fetchSoilGrids(your.points)
 
  plotSPC(x, name = NA, color = "socQ50")
 }

soilDB

Soil Database Interface

v2.6.1
GPL (>= 3)
Authors
Dylan Beaudette [aut], Jay Skovlin [aut], Stephen Roecker [aut], Andrew Brown [aut, cre]
Initial release
2021-04-7

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.