| createSSURGO | R Documentation |
The following database types are tested and fully supported:
SQLite or Geopackage
DuckDB
Postgres or PostGIS
createSSURGO(
filename = NULL,
exdir = NULL,
conn = NULL,
pattern = NULL,
include_spatial = TRUE,
include_tabular = TRUE,
include_raster = FALSE,
LAPPLY.FUN = lapply,
LAPPLY.FUN.ARGS = NULL,
dissolve_field = NULL,
maxruledepth = 0,
overwrite = FALSE,
append = FALSE,
header = FALSE,
sep = "|",
na.strings = c("", "NA"),
quote = "",
fiscal_year = NULL,
template = NULL,
touches = FALSE,
grid_alignment = c("gssurgo", "target_aligned", "nlcd"),
resolution_m = 10,
quiet = TRUE,
areasymbols = NULL,
...
)
filename |
character. Output file name (e.g. |
exdir |
character. Path containing input SSURGO spatial (.shp) and tabular
(.txt) files, downloaded and extracted by |
conn |
A DBIConnection object. Default is a |
pattern |
character. Optional regular expression to use to filter subdirectories of
|
include_spatial |
logical or character. Include spatial data layers in database?
Default: |
include_tabular |
logical or character. Include tabular data layers in database?
Default: |
include_raster |
logical. Generate MUKEY GeoTIFF rasters for each SSA?
Default: |
LAPPLY.FUN |
function. |
LAPPLY.FUN.ARGS |
list. Optional list of additional arguments to pass to |
dissolve_field |
character. Dissolve geometries to create MULTIPOLYGON features? Column
name specified is the grouping variable. Default: |
maxruledepth |
integer. Maximum rule depth for |
overwrite |
logical. Overwrite existing layers? Default: |
append |
logical. Append to existing layers? Default: |
header |
logical. Passed to |
sep |
character. Passed to |
na.strings |
character. Passed to |
quote |
character. Passed to |
fiscal_year |
character. Optional fiscal year label for cache organization (e.g., |
template |
Optional |
touches |
logical. If |
grid_alignment |
character. Grid alignment mode when |
resolution_m |
numeric. Finite positive raster cell size in meters when |
quiet |
logical. Suppress messages and other output from database read/write operations? |
areasymbols |
character. Optional character vector of soil survey area symbols (e.g. |
... |
Additional arguments passed to |
In theory any other DBI-compatible data source can be used for output. See conn argument. If
you encounter issues using specific DBI connection types, please report in the soilDB issue
tracker.
When include_raster=TRUE, common resolutions include 10m, 30m, 300m, and 900m; any positive
resolution can be requested. Custom SpatRaster templates can be supplied for arbitrary grids.
The alignment modes are
intentional: gssurgo matches official USDA-NRCS products, target_aligned follows
zero-origin GDAL-style alignment, and nlcd uses the canonical WGS84 Albers origin. These
choices support interoperability with federal raster products including NLCD, CDL, USGS 3DEP,
and gNATSGO. A supplied template defines a common CRS and grid for all selected SSAs. Without
a template, selected SSAs must share a regional CRS. The Pacific Island default CRS (EPSG:4326)
is geographic, so meter-based rasterization there requires an explicit template. Raster output
uses NAflag = 0; MUKEY zero is reserved as NoData.
A single SSURGO MUKEY per cell may be misleading at resolutions greater than 90 meters. A warning is issued for recognized SSURGO area symbols when the output grid exceeds this resolution.
character. Vector of layer/table names in filename.
downloadSSURGO()
## Not run:
downloadSSURGO("areasymbol IN ('CA067', 'CA077', 'CA632')", destdir = "SSURGO_test")
createSSURGO("test.gpkg", "SSURGO_test")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.