Skip to contents

Generate commands for the 'SSURGO Portal' Data Loader command-line interface, and parse resulting JSON output.

Usage

ssurgo_portal(
  request = NULL,
  pyz_path = file.path(ssurgo_portal_dir("data"), "SSURGOPortal.pyz"),
  ...,
  schema = FALSE,
  command_only = FALSE
)

Arguments

request

One of the available request types, see Details.

pyz_path

Path to "SSURGO Portal" .pyz file. Default "SSURGOPortal.pyz" in ssurgo_portal_dir("data") directory.

...

Additional parameters for request

schema

Return request and response schemas? Default: FALSE

command_only

Return command string rather than executing it? Default: FALSE

Value

A list object corresponding to the JSON response. NULL (invisibly) on error along with any other standard output from the tool printed to the console.

Details

Request NameDescription
getstatusQuick check for application responsiveness
getusageReturn usage information in payload.
getwindowsdrivelettersReturn all drive letters (only valid for Microsoft Windows)
getfoldertreeReturns a file system tree.
gettemplatecatalogReturns JSON containing information about all available empty SSURGO SQLite templates.
copytemplatefileCopies a template file to a specified folder path and name.
opentemplateOpens a SQLite file to confirm that it meets certain minimal criteria.
getdatabaseinventoryList survey areas and related data within a SQLite database.
deleteareasymbolsDelete the specified areasymbols from the database.
pretestimportcandidatesPerform a 'pre-test' on subfolders under a root folder.
importcandidatesImport SSURGO data from subfolders under a root folder. The import terminates if any folder fails.
importspatialdataFor internal use only. Import SSURGO spatial data from shapefiles under a specified path. Note that this activity is isolated to support its use in a child process.
getrecordlistbytableRetrieve table rows for a specified table
generaterastersGenerate rasters of the mupolygon dataset in the user specified SSURGO Template Database.
logjavascripterrorWrite an error to the log file
getsdvattributesbyfolderGet Soil Data Viewer attributes
getsdvratingoptionsGet Soil Data Viewer rating options
generateaggregationGenerate an aggregation
sortratingtableSort a rating table by a specified column name
exportratingresultsExport rating results

Examples

if (FALSE) { # \dontrun{
ssurgo_portal("getstatus")

ssurgo_portal("getstatus", schema = TRUE)

ssurgo_portal(
  "getfoldertree",
  path = "C:/SSURGO Portal/WV",
  folderpattern = "WV",
  filepattern = "txt",
  ignorefoldercase = TRUE,
  ignorefilecase = TRUE,
  showfiles = FALSE,
  maxdepth = 2
)

ssurgo_portal("gettemplatecatalog")

ssurgo_portal(
  "copytemplate",
  templatename = "GeoPackage",
  folder = "test",
  filename = "test.gpkg",
  overwrite = TRUE
)

dbp <- "C:/SSURGO Portal/Databases/West_Virginia_Geopackage.gpkg"

ssurgo_portal("opentemplate", database = dbp)

ssurgo_portal(
  "pretestimportcandidates",
  database = dbp,
  root = "C:/SSURGO Portal/WV",
  istabularonly = FALSE
)

ssurgo_portal(
  "importcandidates",
  database = dbp,
  root = "C:/SSURGO Portal/WV",
  istabularonly = FALSE,
  skippretest = TRUE,
  subfolders = list("WV603"),
  loadinspatialorder = FALSE,
  loadspatialdatawithinsubprocess = TRUE,
  dissolvemupolygon = TRUE
)

ssurgo_portal("getdatabaseinventory", database = dbp)

ssurgo_portal("deleteareasymbols",
              database = dbp,
              areasymbols = list("WV603"))
} # }