This function downloads a generalized representations of a soil series extent from SoilWeb, derived from the current SSURGO snapshot. Data can be returned as vector outlines (sf
object) or gridded representation of area proportion falling within 800m cells (SpatRaster
object). Gridded series extent data are only available in CONUS. Vector representations are returned with a GCS/WGS84 coordinate reference system and raster representations are returned with an Albers Equal Area / NAD83 coordinate reference system (EPSG:5070
).
seriesExtent(s, type = c("vector", "raster"), timeout = 60)
a soil series name, case-insensitive
series extent representation, vector
results in a SpatialPolygonsDataFrame
object and raster
results in a raster
object
time that we are willing to wait for a response, in seconds
# \donttest{
if(requireNamespace("curl") &
requireNamespace("sf") &
requireNamespace("terra") &
curl::has_internet()) {
# required packages
library(sf)
library(terra)
# specify a soil series name
s <- 'magnor'
# return an sf object
x <- seriesExtent(s, type = 'vector')
# return a terra SpatRasters
y <- seriesExtent(s, type = 'raster')
if (!is.null(x) && !is.null(y)) {
# note that CRS are different
sf::st_crs(x)
terra::crs(y)
# transform vector representation to CRS of raster
x <- sf::st_transform(x, terra::crs(y))
# graphical comparison
par(mar = c(1, 1 , 1, 3))
plot(y, axes = FALSE)
# no fill color
plot(x['series'], add = TRUE, col = NA)
}
}
#> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1; sf_use_s2() is TRUE
#> terra 1.5.34
# }