Fetch commonly used site/pedon/horizon data from a PedonPC database.

Share:

Description

Fetch commonly used site/pedon/horizon data from a PedonPC or local NASIS database, return as a SoilProfileCollection object.

Usage

1
2
3
fetchNASIS(rmHzErrors = TRUE, nullFragsAreZero=TRUE, soilColorState='moist')
fetchNASIS_component_data(rmHzErrors=TRUE)
getHzErrorsNASIS(strict=TRUE)

Arguments

rmHzErrors

should pedons with horizonation errors be removed from the results? (default: TRUE)

nullFragsAreZero

should fragment volumes of NULL be interpreted as 0? (default: TRUE), see details

soilColorState

which colors should be used to generate the convenience field 'soil_color'? ('moist' | 'dry')

strict

should horizonation by strictly enforced? (TRUE)

Details

The value of nullFragsAreZero will have a significant impact on the rock fragment fractions returned by fetchNASIS. Set nullFragsAreZero = FALSE in those cases where there are many data-gaps and NULL rock fragment values should be interpretated as NULLs. Set nullFragsAreZero = TRUE in those cases where NULL rock fragment values should be interpreted as 0.

This function attempts to do most of the boilerplate work when extracting site/pedon/horizon data from a local NASIS database. Pedons that are missing horizon data, or have errors in their horizonation are excluded from the returned object, however, their IDs are printed on the console. Pedons with combination horizons (e.g. B/C) are erroneously marked as errors due to the way in which they are stored in NASIS as two overlapping horizon records.

See getHzErrorsNASIS for a simple approach to identifying pedons with problematic horizonation.

Value

a SoilProfileCollection class object

Note

This function currently works only on Windows, and requires a 'nasis_local' ODBC connection.

Author(s)

D. E. Beaudette and J. M. Skovlin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# query depends on some pedon data, queried against the national database
# note that you must setup this connection ahead of time
f <- fetchNASIS()

# plot only those profiles with densic contact
plot(f[which(f$densic.contact), ], name='hzname')

# get basic component data from local NASIS, after performing a 
# DMU-* query against the national database
fc <- fetchNASIS_component_data()

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.