Query the Soil Data Access (SDA) API for NASIS record identifiers
(nasiscoiid
, nasischiid
) associated with map units, components, or
horizons. These identifiers are available in SDA beginning with NASIS version
7.4.3 and are useful for linking SDA data to NASIS backend records.
Usage
get_SDA_NASIS_key(
x,
by = "mukey",
include_chorizon = FALSE,
query_string = FALSE,
dsn = NULL
)
Arguments
- x
A character vector of keys to match (
mukey
,cokey
, orchkey
).- by
A character string indicating the type of key provided in
x
. Must be one of"mukey"
,"cokey"
, or"chkey"
.- include_chorizon
Logical. If
TRUE
, join results tochorizon
table to include"nasischiid"
. Default:FALSE
but alwaysTRUE
forby="chkey"
.- query_string
Logical. If
TRUE
, return the SQL query string instead of executing it. Default:FALSE
.- dsn
Optional. Path to a local database or connection object. If
NULL
(default), the SDA web service is used.
Value
A data.frame
containing mukey
, cokey
, chkey
, nasiscoiid
,
and nasischiid
, or a character string if query_string = TRUE
.
Details
This function is intended for use with SDA (dsn = NULL
). When used with
local SSURGO snapshots or other data sources, these columns may not be
present.