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"
inssurgo_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 Name | Description |
getstatus | Quick check for application responsiveness |
getusage | Return usage information in payload. |
getwindowsdriveletters | Return all drive letters (only valid for Microsoft Windows) |
getfoldertree | Returns a file system tree. |
gettemplatecatalog | Returns JSON containing information about all available empty SSURGO SQLite templates. |
copytemplatefile | Copies a template file to a specified folder path and name. |
opentemplate | Opens a SQLite file to confirm that it meets certain minimal criteria. |
getdatabaseinventory | List survey areas and related data within a SQLite database. |
deleteareasymbols | Delete the specified areasymbols from the database. |
pretestimportcandidates | Perform a 'pre-test' on subfolders under a root folder. |
importcandidates | Import SSURGO data from subfolders under a root folder. The import terminates if any folder fails. |
importspatialdata | For 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. |
getrecordlistbytable | Retrieve table rows for a specified table |
generaterasters | Generate rasters of the mupolygon dataset in the user specified SSURGO Template Database. |
logjavascripterror | Write an error to the log file |
getsdvattributesbyfolder | Get Soil Data Viewer attributes |
getsdvratingoptions | Get Soil Data Viewer rating options |
generateaggregation | Generate an aggregation |
sortratingtable | Sort a rating table by a specified column name |
exportratingresults | Export 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"))
} # }