Learn R Programming

soilDB (version 2.5.9)

taxaExtent: Retrieve Soil Taxonomy Membership Grids

Description

This function downloads a generalized representation of the geographic extent of any single taxa from the top 4 tiers of Soil Taxonomy. Data are provided by SoilWeb, ultimately sourced from from the current SSURGO snapshot. Data are returned as raster objects representing area proportion falling within 800m cells. Data are only available in CONUS and returned using an Albers Equal Area / NAD83 coordinate reference system.

Usage

taxaExtent(
  x,
  level = c("order", "suborder", "greatgroup", "subgroup"),
  timeout = 60
)

Arguments

x

single taxa name, case-insensitive

level

the taxonomic level within the top 4 tiers of Soil Taxonomy, one of c('order', 'suborder', 'greatgroup', 'subgroup')

timeout

time that we are willing to wait for a response, in seconds

Value

a raster object

Examples

Run this code
# NOT RUN {
if(requireNamespace("curl") &
   curl::has_internet()) {
  
  library(raster)
  
  # try a couple of different examples
  
  # soil order
  taxa <- 'vertisols'
  x <- taxaExtent(taxa, level = 'order')
  a <- raster::aggregate(x, fact = 5)
  
  # suborder
  taxa <- 'ustalfs'
  x <- taxaExtent(taxa, level = 'suborder')
  a <- raster::aggregate(x, fact = 5)
  
  # greatgroup
  taxa <- 'haplohumults'
  x <- taxaExtent(taxa, level = 'greatgroup')
  a <- raster::aggregate(x, fact = 5)
  
  # subgroup
  taxa <- 'Typic Haploxerepts'
  x <- taxaExtent(taxa, level = 'subgroup')
  a <- raster::aggregate(x, fact = 5)
  
  # quick evaluation of the result
  if(requireNamespace("rasterVis") & requireNamespace('viridis')) {
    rasterVis::levelplot(a, 
      margin = FALSE, scales = list(draw = FALSE), 
      col.regions = viridis::viridis, 
      main = names(a)
    )
  }
  
  # slippy map
  if(requireNamespace("mapview")) {
    mapview::mapview(a, col.regions = viridis::viridis, na.color = NA, use.layer.names = TRUE)
  }
  
  
  
}

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab