Skip to contents

Create a SQLite database or GeoPackage from one or more SSURGO Exports

Usage

createSSURGO(
  filename,
  exdir,
  pattern = NULL,
  include_spatial = TRUE,
  overwrite = FALSE,
  header = FALSE,
  quiet = TRUE,
  ...
)

Arguments

filename

Output file name (e.g. 'db.sqlite' or 'db.gpkg')

exdir

Path containing containing SSURGO spatial (.shp) and tabular (.txt) files.

pattern

Character. Optional regular expression to use to filter subdirectories of exdir. Default: NULL will search all subdirectories for SSURGO export files.

include_spatial

Logical. Include spatial data layers in database? Default: TRUE.

overwrite

Logical. Overwrite existing layers? Default FALSE will append to existing tables/layers.

header

Logical. Passed to read.delim() for reading pipe-delimited (|) text files containing tabular data.

quiet

Logical. Suppress messages and other output from database read/write operations?

...

Additional arguments passed to write_sf() for writing spatial layers.

Value

Character. Vector of layer/table names in filename.

Examples

if (FALSE) {
 downloadSSURGO("areasymbol IN ('CA067', 'CA077', 'CA632')", destdir = "SSURGO_test")
 createSSURGO("test.gpkg", "SSURGO_test")
}