diff --git a/articles/wcs-ssurgo.html b/articles/wcs-ssurgo.html index 6b36695f..d7e520c2 100644 --- a/articles/wcs-ssurgo.html +++ b/articles/wcs-ssurgo.html @@ -379,7 +379,7 @@

Map Unit Key Grids#> extent : -1365495, -1358925, 2869245, 2873655 (xmin, xmax, ymin, ymax) #> coord. ref. : NAD83 / Conus Albers (EPSG:5070) #> source(s) : memory -#> varname : file20ce4f43c30 +#> varname : file20a757fb2436 #> categories : mukey #> name : mukey #> min value : 144983 @@ -487,7 +487,7 @@

Raster Soil Survey Data#> extent : 1129005, 1135005, 1402995, 1411005 (xmin, xmax, ymin, ymax) #> coord. ref. : NAD83 / Conus Albers (EPSG:5070) #> source(s) : memory -#> varname : file20ce50a29919 +#> varname : file20a762ab98f0 #> categories : mukey #> name : mukey #> min value : 545800 @@ -501,7 +501,7 @@

Raster Soil Survey Data#> extent : 1129005, 1135005, 1402995, 1411005 (xmin, xmax, ymin, ymax) #> coord. ref. : NAD83 / Conus Albers (EPSG:5070) #> source(s) : memory -#> varname : file20ce55aaf397 +#> varname : file20a75c59022f #> categories : mukey #> name : mukey #> min value : 545800 @@ -515,7 +515,7 @@

Raster Soil Survey Data#> extent : 1129005, 1135005, 1402995, 1411005 (xmin, xmax, ymin, ymax) #> coord. ref. : NAD83 / Conus Albers (EPSG:5070) #> source(s) : memory -#> varname : file20ce4ddc1d4e +#> varname : file20a779896c71 #> categories : mukey #> name : mukey #> min value : 3244721 @@ -570,7 +570,7 @@

STATSGO#> extent : 1129005, 1135005, 1402995, 1411095 (xmin, xmax, ymin, ymax) #> coord. ref. : NAD83 / Conus Albers (EPSG:5070) #> source(s) : memory -#> varname : file20ce612b214e +#> varname : file20a7cd02af9 #> categories : mukey #> name : mukey #> min value : 659074 diff --git a/pkgdown.yml b/pkgdown.yml index 8430ce13..41701e8f 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: fetchNASIS: fetchNASIS.html wcs-ssurgo: wcs-ssurgo.html -last_built: 2024-10-07T21:39Z +last_built: 2024-10-23T00:32Z urls: reference: http://ncss-tech.github.io/soilDB/reference article: http://ncss-tech.github.io/soilDB/articles diff --git a/reference/OSDquery-1.png b/reference/OSDquery-1.png index 0b494697..9bfd076c 100644 Binary files a/reference/OSDquery-1.png and b/reference/OSDquery-1.png differ diff --git a/reference/SoilWeb_spatial_query.html b/reference/SoilWeb_spatial_query.html index eb1acd2d..90b3ead5 100644 --- a/reference/SoilWeb_spatial_query.html +++ b/reference/SoilWeb_spatial_query.html @@ -259,7 +259,7 @@

Examples # query by coordinate pair SoilWeb_spatial_query(coords=c(-121, 38)) #> ogc_fid areasymbol musym mukey soilweb_last_update dist_meters -#> 1 1495231 ca077 220 462112 2023-09-11 92.17456302 +#> 1 1494050 ca077 220 462112 2023-09-11 92.17456302 # } diff --git a/reference/fetchOSD-1.png b/reference/fetchOSD-1.png index f7a3e952..693e84c6 100644 Binary files a/reference/fetchOSD-1.png and b/reference/fetchOSD-1.png differ diff --git a/reference/fetchOSD-2.png b/reference/fetchOSD-2.png index f5c05418..b5a9ac3a 100644 Binary files a/reference/fetchOSD-2.png and b/reference/fetchOSD-2.png differ diff --git a/reference/fetchOSD.html b/reference/fetchOSD.html index 76e261df..d4991329 100644 --- a/reference/fetchOSD.html +++ b/reference/fetchOSD.html @@ -140,7 +140,7 @@

Examples plot(x$SPC) str(x, 1) #> List of 18 -#> $ SPC :Formal class 'SoilProfileCollection' [package "aqp"] with 9 slots +#> $ SPC :Formal class 'SoilProfileCollection' [package "aqp"] with 8 slots #> $ competing :'data.frame': 84 obs. of 3 variables: #> $ geog_assoc_soils:'data.frame': 77 obs. of 2 variables: #> $ geomcomp :'data.frame': 11 obs. of 9 variables: diff --git a/reference/fetchSDA_spatial.html b/reference/fetchSDA_spatial.html index e067b9a4..ed07fe1e 100644 --- a/reference/fetchSDA_spatial.html +++ b/reference/fetchSDA_spatial.html @@ -136,7 +136,7 @@

Examples full.extent.nmusym <- try(fetchSDA_spatial(x = "2x8l5", by = "nmusym")) #> Using 1 chunks... #> Chunk #1 completed (n = 3; 0.8 secs) -#> Done in 0.9 secs; mean/chunk: 0.8 secs; mean/symbol: 0.31 secs. +#> Done in 1 secs; mean/chunk: 0.8 secs; mean/symbol: 0.32 secs. # compare extent of nmusym to single mukey within it if (!inherits(single.mukey, 'try-error') && @@ -155,8 +155,8 @@

Examples # demo adding a field (`muname`) to attribute table of result head(try(fetchSDA_spatial(x = "2x8l5", by="nmusym", add.fields="muname"))) #> Using 1 chunks... -#> Chunk #1 completed (n = 3; 0.6 secs) -#> Done in 0.7 secs; mean/chunk: 0.6 secs; mean/symbol: 0.24 secs. +#> Chunk #1 completed (n = 3; 0.5 secs) +#> Done in 0.7 secs; mean/chunk: 0.5 secs; mean/symbol: 0.23 secs. #> Simple feature collection with 6 features and 4 fields #> Geometry type: POLYGON #> Dimension: XY diff --git a/reference/fetchSOLUS-1.png b/reference/fetchSOLUS-1.png new file mode 100644 index 00000000..884b40f9 Binary files /dev/null and b/reference/fetchSOLUS-1.png differ diff --git a/reference/fetchSOLUS-2.png b/reference/fetchSOLUS-2.png new file mode 100644 index 00000000..75b8193f Binary files /dev/null and b/reference/fetchSOLUS-2.png differ diff --git a/reference/fetchSOLUS.html b/reference/fetchSOLUS.html new file mode 100644 index 00000000..63a753f1 --- /dev/null +++ b/reference/fetchSOLUS.html @@ -0,0 +1,227 @@ + +Fetch Soil Landscapes of the United States (SOLUS) Grids — fetchSOLUS • soilDB + Skip to contents + + +
+
+
+ +
+

This tool creates a virtual raster or downloads data for an extent from Cloud Optimized GeoTIFFs +(COGs) from the Soil Landscapes of the United States 100-meter (SOLUS100) soil property maps project repository.

+
+ +
+

Usage

+
fetchSOLUS(
+  x = NULL,
+  depth_slices = c(0, 5, 15, 30, 60, 100, 150),
+  variables = c("anylithicdpt", "caco3", "cec7", "claytotal", "dbovendry", "ec", "ecec",
+    "fragvol", "gypsum", "ph1to1h2o", "resdept", "sandco", "sandfine", "sandmed",
+    "sandtotal", "sandvc", "sandvf", "sar", "silttotal", "soc"),
+  output_type = c("prediction", "relative prediction interval",
+    "95% low prediction interval", "95% high prediction interval"),
+  grid = TRUE,
+  samples = NULL,
+  method = c("linear", "constant", "fmm", "natural", "monoH.FC", "step", "slice"),
+  max_depth = 151,
+  filename = NULL,
+  overwrite = FALSE
+)
+
+ +
+

Arguments

+ + +
x
+

An R spatial object (such as a SpatVector, SpatRaster, or sf object) or a +SoilProfileCollection with coordinates initialized via aqp::initSpatial<-. Default: NULL +returns the CONUS extent as virtual raster. If x is a SpatRaster the coordinate reference +system, extent, and resolution are used as a template for the output raster.

+ + +
depth_slices
+

character. One or more of: "0", "5", "15", "30", "60", "100", +"150". The "depth slice" "all" (used for variables such as "anylithicdpt", and +"resdept") is always included if any site-level variables are selected.

+ + +
variables
+

character. One or more of: "anylithicdpt", "caco3", "cec7", "claytotal", +"dbovendry", "ec", "ecec", "fragvol", "gypsum", "ph1to1h2o", "resdept", +"sandco", "sandfine", "sandmed", "sandtotal", "sandvc", "sandvf", "sar", +"silttotal", "soc".

+ + +
output_type
+

character. One or more of: "prediction", "relative prediction interval", +"95% low prediction interval", "95% high prediction interval"

+ + +
grid
+

logical. Default TRUE returns a SpatRaster object for an extent. FALSE returns +a SoilProfileCollection. Any other value returns a list object with names "grid" and +"spc" containing both result objects.

+ + +
samples
+

integer. Number of regular samples to return for SoilProfileCollection output. +Default NULL will convert all grid cells to a unique profile. Note that for a large extent, +this can produce large objects with a very large number of layers (especially with method +other than "step").

+ + +
method
+

character. Used to determine depth interpolation method for SoilProfileCollection +output. Default: "linear". Options include any method allowed for approxfun() or +splinefun() plus "step" and "slice". "step" uses the prediction depths as the top and +bottom of each interval to create a piecewise continuous profile to maximum of 200 cm depth +(for 150 cm upper prediction depth). "slice" returns a discontinuous profile with 1 cm thick +slices at the predicted depths. Both "step" and "slice" return a number of layers equal to +length of depth_slices, and all other methods return data in interpolated 1cm slices.

+ + +
max_depth
+

integer. Maximum depth to interpolate 150 cm slice data to. Default: 151. +Interpolation deeper than 151 cm is not possible for methods other than "step" and will +result in missing values.

+ + +
filename
+

character. Path to write output raster file. Default: NULL will keep result in +memory (or store in temporary file if memory threshold is exceeded)

+ + +
overwrite
+

Overwrite filename if it exists? Default: FALSE

+ +
+
+

Value

+

A SpatRaster object containing SOLUS grids for specified extent, depths, variables, and +product types.

+
+
+

Details

+

If the input object x is not specified (NULL or missing), a SpatRaster object using the +virtual URLs is returned. The full extent and resolution data set can be then downloaded and +written to file using terra::writeRaster() (or any other processing step specifying an output +file name). When input object x is specified, a SpatRaster object using in memory or local +(temporary file or filename) resources is returned after downloading the data only for the +target extent. In the case where x is a SoilProfileCollection or an sf or SpatVector +object containing point geometries, the result will be a SoilProfileCollection for values +extracted at the point locations. To return both the SpatRaster and SoilProfileCollection +object output in a list, use grid = NULL.

+
+
+

References

+

Nauman, T.W., Kienast-Brown, S., White, D.A. Brungard, C.W., Philippe, J., Roecker, +S.M., Thompson, J.A. Soil Landscapes of the United States (SOLUS): developing predictive soil +property maps of the conterminous US using hybrid training sets. In Prep for SSSAJ.

+
+
+

Author

+

Andrew G. Brown

+
+ +
+

Examples

+

+b <- c(-119.747629, -119.67935, 36.912019, 36.944987)
+
+bbox.sp <- sf::st_as_sf(wk::rct(
+  xmin = b[1], xmax = b[2], ymin = b[3], ymax = b[4],
+  crs = sf::st_crs(4326)
+))
+
+ssurgo.geom <- soilDB::SDA_spatialQuery(
+  bbox.sp,
+  what = 'mupolygon',
+  db = 'SSURGO',
+  geomIntersection = TRUE
+)
+
+# grid output
+res <- fetchSOLUS(
+  ssurgo.geom,
+  depth_slices = "0",
+  variables = c("sandtotal", "silttotal", "claytotal", "cec7"),
+  output_type = "prediction"
+)
+
+terra::plot(res)
+
+
+# SoilProfileCollection output, using linear interpolation for 1cm slices
+# site-level variables (e.g. resdept) added to site data.frame of SPC
+res <- fetchSOLUS(
+  ssurgo.geom,
+  depth_slices = c("0", "5", "15", "30", "60", "100", "150"),
+  variables = c("sandtotal", "silttotal", "claytotal", "cec7", "resdept"),
+  output_type = "prediction",
+  method = "linear",
+  grid = FALSE,
+  samples = 10
+)
+#> converting profile IDs from integer to character
+
+# plot, truncating each profile to the predicted restriction depth
+aqp::plotSPC(trunc(res, 0, res$resdept_p), color = "claytotal_p", divide.hz = FALSE)
+
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/get_soilDB_env.html b/reference/get_soilDB_env.html index 3c542919..170ae6cb 100644 --- a/reference/get_soilDB_env.html +++ b/reference/get_soilDB_env.html @@ -64,7 +64,7 @@

Value

Examples

get_soilDB_env()
-#> <environment: 0x5590ca353638>
+#> <environment: 0x55fbea076b98>