get_EDIT_ecoclass_by_geoUnit() and make_EDIT_service_URL()) updated to new USDA-managed server: https://edit.sc.egov.usda.gov/soilColor.wcs(), ISSR800.wcs(), mukey.wcs()) have been updated with FY26 maps, now including most OCONUS soil surveys (AK, HI, PR, PW, GU, AS, MP)downloadSSURGO() gains arguments include_spatial and include_tabular that are analogous to arguments of the same name from createSSURGO(). Also, added LAPPLY.FUN to support arbitrary parallel or progress reporting backends. Thanks to feature request from @dylanbeaudette (#470).ROSETTA() updates thanks to Todd Skaggs (USDA-ARS):
est.type for selecting ensemble summary method and resulting units of measurefetchGDB() now supports passing path to SSURGO GeoPackage file via dsn argumentSoilProfileCollection datasets (loafercreek, gopheridge, mineralKing) updated to 2.9.x fetchNASIS() schema
stringsAsFactors argument has been removed from many query functions, use NASISChoiceList() and/or NASISDomainsAsFactor() instead for manual or automatic setting of domain values as factors, respectivelySDA_query() and high-level wrapper functions for SDA queries in soilDBfetchOSD(..., extended = TRUE) gains geomorphon proportions via SoilWeb (#435)get_SDA_property(method="weighted average") resolved efficiency issues and streamlined SQL Common Table Expressions for processing very large sets of map unit keys (#432)OSDquery() gains remarks argument for searching the REMARKS section of OSDstype for selecting the type of query; replaces deprecated formativeElementSDA_query() now includes additional metadata (comment header in SQL) to inform usage metrics of various access points to SDAfetchSDA() and related lower-level child functions now include nasiscoiid and nasischiid for relating to internal database record IDsget_SDA_NASIS_key() for obtaining NASIS record IDs for component and component horizon data from Soil Data Access (#409)SDA_spatialQuery() fixed a bug with new addFields argument and geomIntersection=TRUE (#414)get_OSD() replace old base URL for result='html'SDA_query() include soilDB package version in User-Agent stringSDA_spatialQuery() and get_SDA_coecoclass()downloadSSURGO() and createSSURGO()SDA_spatialQuery() now supports addFields argument to add columns to the result from other non-spatial tables.
"legend", "mapunit", and "muaggatt" tables for what equal to "mupolygon", "mupoint", "muline" or "mukey""legend" table for what equal to "areasymbol" or "sapolygon""featdesc" for what equal to "featpoint" or "featline"createSSURGO():
append argument to fix overwrite behavioroverwrite logic for non-file-based RDBMSfetchNASIS(): fixed bug when fill=TRUE and there are no horizons in the source data for any profileget_component_from_SDA() fixed bug in join of "chorizon" and "chfrags" tables, now uses merge(incomparables=NA)get_vegplot_tree_si_summary_from_NASIS_db() updated for new siteindexcurve table in data model version 7.4.3fetchSDA_spatial() geom.src="mlrapolygon" uses a new URL on the DSHub S3 bucket"projectsubtype" and "milestonetype" to the "project" set for get_NASIS_table_name_by_purpose()fetchVegdata() add nullFragsAreZero argument (passed to get_site_data_from_NASIS_db())soilDB_user_dir() for caching local copies of data for use in soilDB functions (#377)fetchHWSD() and get_HWSD_path() for the FAO Harmonized World Soil Database (#391)get_phroots_from_NASIS_db() for getting pedon horizon root information from NASIS (#393)get_vegplot_groundsurface_from_NASIS_db() thanks to Greg Schmidt (@phytoclast; #373)"transectgroundsurfcover" table to "vegetation" set for get_NASIS_table_name_by_purpose()fetchNASIS("components") deprecation messages for maat_l, maat_r, maat_h, mast_r, ecosite_id, ecosite_name, othervegid, and othervegclass columnsfetchSDA_spatial(geom.src="mlrapolygon"): uses an AWS (S3) source and Seek-optimized ZIP file (thanks to @jneme910)get_SDA_property() (method "weighted average" and "min/max"), get_SDA_hydric(), and get_SDA_interpretation() (method "weighted average") now use Common Table Expressions (CTEs) and therefore are compatible with local (SQLite or other) data sourcesfetchSCAN(): Bug fix when sensor column contains all NAROSETTA(): now uses HTTPS URL for API endpointfetchNASIS(): Bug fix for (now deprecated) pedon_id in horizon slot rather than siteloafercreek, gopheridge, mineralKingfetchNASISLabData(): use ncsspedonlabdataiid as unique pedon IDfetchVegdata()
"ecostateid", "ecostatename", "commphaseid", "commphasename" to columns from site and siteobs are now joined into "vegplot" result."site" join used for "vegplot" table result. Now using LEFT join to add siteecositehistory informationget_vegplot_trhi_from_NASIS_db() & get_vegplot_transect_from_NASIS_db() no longer join to the pedon table. Use the "siteobsiid" or vegetation plot "assocuserpedonid" to join to pedon records when necessary.
get_vegplot_*() functions use INNER join to vegtransect table where applicable, so records are only returned for vegplots with an associated transect. Thanks to Zach Van Abbema for suggestion.createSSURGO(): more informative error message when no export files found for importfetchNASIS() and fetchVegdata() when a local NASIS instance is not availableloafercreek, gopheridge, mineralKing)fetchNASIS() and get_site_data_from_NASIS_db() now return Ecological Site State and Community Phase information (ecostatename, ecostateid, commphasename, commphaseid columns) from Site Observation tablecreateStaticNASIS() bug fixes
DBI::dbReadTable() for all tables via NASIS ODBC connectionoutput_path=NULLfetchNASIS() changed default behavior to mixColors=FALSE which returns dominant condition for each moisture state rather than mixing LAB color coordinates
get_colors_from_NASIS_db() deprecate mixColors argument, add method argument with options "dominant", "mixed", and "none". New aggregation method "none" returns long format representation of color data from phcolor table with no aggregation applied.createSSURGO() updates:
maxruledepth argument to allow filtering of cointerp table, and set default to 0.
cointerp rows by about 75% for published SSURGO. Generally, Web Soil Survey exports have maximum rule depth of 1, but custom NASIS exports can be "deeper"filename argument when conn DBIConnection is specified and improved overwrite logicdissolve_field to facilitate creating aggregate geometries by "mukey" or other spatial attributeinclude_tabular argument to support omitting tabular data when building a databaseinclude_spatial and include_tabular are allowed to be a character vectors of table names
TRUE is all tables, FALSE is no tables. This allows for subsets of the SSURGO data model to be specified with finer user control over database contents."soil_metadata" table is made with "areasymbol" column and one row per soil survey area, rather than one table per soil survey area. This is more compact and scales better to larger databases.fetchLDM() add support for area_type argument with local database connections (dsn argument)fetchSCAN() updates:
?NASISLocalDatabase (#360)get_SDA_*() function updates related to consistent parameters for miscellaneous areas and minor components (#361)fetchSOLUS(): New function for downloading data from Soil Landscapes of the United States 100-meter (SOLUS100) soil property maps project repository (#362)fetchNASIS() more consistent QC messages and output for multiple site observations and lab samplesloafercreek, gopheridge, mineralKing) for aqp 2.1.x object definition and recent changes to fetchNASIS() (#363)createSSURGO() bug fixes following changes in 2.8.3
gpkg_contents for GeoPackage files failed to add entries for "features" data_typefilename argument not properly handled in some casesSDA_query() handle another possible failure point in error handling codecreateStaticNASIS() use odbc::dbListFields() instead of odbc::odbcConnectionColumns()ISSR800.wcs() and soilColor.wcs() now set color table internally when possibleSDA_query() updates
createSSURGO(): added support for creating DuckDB, PostgreSQL, and other DBI-compatible databases (#352) via conn argumentfetchSDA() and get_chorizon_from_SDA() concatenate multiple texcl using a comma when a texture group contains multiple texture classes (e.g. stratified textures) (fixes #353)fetchNASIS()/.formatLandformString(): append geomfmod column to landscape, landform, and microfeature strings where present; thanks to Gabriel Benitez for suggestionfetchNASIS()/get_extended_data_from_NASIS_db(): fix conversion of codes to labels for microrelieffetchSCAN(): fix header format; thanks to @dschlaep for reporting and providing a fixmukey.wcs()) and metadata have been updated for FY2024
ISSR800.wcs() source) is still using FY2023/FY2022 dataget_SDA_coecoclass() default data returned for methods "Dominant Component", "Dominant Condition" and "None" now include localphase columnget_soilseries_from_NASIS() and get_competing_soilseries_from_NASIS(): add SS argument for parity with all other NASIS "get" methods
FALSE for backward compatibility/common use casesget_site_data_from_NASIS_db() gains Frost Free Days, MAP, REAP, MAAT, MAST, MSAT, MSST, MWAT, MWST, and Parent Material Group Name; thanks to Zach Van Abbema for suggestion"areasymbol" (#272); thanks to Zach Van Abbema for suggestion
get_site_data_from_NASIS_db(): Add state, county, and MLRA areasymbol references ("site_state", "site_county", "site_mlra")get_mapunit_from_NASIS_db(): Add dominant MLRA areasymbol reference column "lmapunit_mlra"get_soilseries_from_NASIS(): replace areasymbol column to use relationship-style name "soilseries_typelocst" (minor breaking change)fetchSDA_spatial(): Add support for querying mapunit point ("mupoint"), mapunit line ("muline"), special feature point ("featpoint"), special feature line ("featline") by mukey or featkey, geometry type selectable via geom.src argumentSDA_spatialQuery(): Add support for querying mapunit point ("mupoint"), mapunit line ("muline"), special feature point ("featpoint"), special feature line ("featline") for a spatial extent, geometry type selectable via what argumentsimplifyFragmentData() / simplifyArtifactData() efficiency improvement when all records are missing dataget_mapunit_from_NASIS(), get_lmuaoverlap_from_NASIS() and get_legend_from_NASIS() gain areatypename argument used for filtering legends by areatypename.
"Non-MLRA Soil Survey Area" and "MLRA Soil Survey Area". Set to NULL for no filter.waterDayYear() and summarizeSoilTemperature() for leap years (#333)fetchSoilGrids() upgrades
data.frame outputSys.sleep() to conform with ISRIC "Fair Use" policyfetchSDA_spatial() gains ability to query mapunit delineations by Ecological Site ID (by.col="ecoclassid")get_SDA_coecoclass() default ecoclasstypename is now c("NRCS Rangeland Site", "NRCS Forestland Site"), as this is the most common type of aggregation and is least prone to producing unusual composition-related errors due to duplications
aqp::col2Munsell(), to "encourage" users to update to the more efficient routines provided in {aqp} 2+ (if they haven't already), and prepare for future updates in the 2.x series.get_SDA_interpretation() when dsn refers to a local SQLite source
and in concatenation of reason string when wide_reason=TRUEcreateSSURGO() updates:
"mupolygon" rather than "soilmu_a").downloadSSURGO() gains db argument which gives ability to download STATSGO by state or all of US from Web Soil Survey. Thanks to Meghan Krueger for suggestion.get_SDA_property(): weighted average/dominant component numeric methods now return mukey in first column position; for parity with other get_SDA* methods recently updated/already doing this, making it easier to use these columns for raster attribute tables via terra::set.levels()fetchNASIS(lab=TRUE) fixed a bug when multiple phlabresults records are present for a single horizon, but one or both is missing bottom depth. Thanks to Meyer Bohn (@MollicMeyer) for reporting.metadata(x)$created (#235)area_type argument to fetchLDM() for non-SSA area queries (#328)grid argument to fetchSoilGrids() for downloading Cloud-Optimized GeoTIFF subsets for spatial extent (#329)fetchOSD() now automatically batches requests into sets of 100 series, allowing arbitrarily large requests to be made (#239)fetchSDA_spatial() gains geom.src="mlrapolygon" for obtaining Major Land Resource Area (MLRA) polygon boundaries. When using this geometry source x is a vector of MLRARSYM (MLRA Symbols).
fetchSDA_spatial() arguments are not currently supported for the MLRA geometry source. In the future a mlrapolygon table may be added to SDA (analogous to mupolygon and sapolygon), and the function will be updated accordingly at that time.Web coverage services and related raster attribute tables provided by SoilWeb (mukey.wcs() etc.) are now using the SoilWeb load-balancer URL
get_SDA_coecoclass() gains method="all" for aggregating information about ecological sites and related components. The method performs a condition-based aggregation for each ecological site condition in the map unit, producing a "wide" data.frame result with as many columns as needed to portray all site conditions.
fetchLDM() gains new argument WHERE for supplying a custom SQL where clause for selecting sites of interest. For example: fetchLDM(WHERE = "CASE WHEN corr_name IS NOT NULL THEN LOWER(corr_name) ELSE LOWER(samp_name) END = 'musick'")
method options for fetchSDA_spatial(). Aggregation grouping is controlled by the by.col argument. This works for mapunit and survey area polygon geometries, aggregating all polygons in the group for each mukey, nationalmusym, lkey, or areasymbol extent.
method="extent" method calculates a bounding rectanglemethod="convexhull" calculates the convex hullmethod="union" returns a MULTIPOLYGONmethod="collection" returns a GEOMETRYCOLLECTIONBug fix for get_vegplot_transpoints_from_NASIS_db(); using wrong record ID for transect points
get_NASIS_table_name_by_purpose() now includes "pointplantcoverdetails", "plantprodquadratdetails" in the "vegetation" table purpose group
Added new SoilWeb "Web Coverage Service" vignette (https://ncss-tech.github.io/soilDB/articles/wcs-ssurgo.html) related to creating thematic maps using grids of mapunit keys from SoilWeb with aggregated tabular data from Soil Data Access.
get_SDA_*() functions now all return mukey values in first column
mukey.wcs() gains a 30m gridded version of Hawaii and Puerto Rico SSURGO data via db="HI_SSURGO" and db="PR_SSURGO", respectively.
get_vegplot_data_from_NASIS_db(): now uses LEFT join to plant table so that empty records can be diagnosed; thanks to @natearoe for suggestion
Added new NASIS query functions for vegetation transect point and quadrat details: get_vegplot_prodquadrats_from_NASIS_db() and get_vegplot_transpoints_from_NASIS_db()
get_SDA_property(method="Dominant Component (Numeric)") now includes minors by default, fixing issues with STATSGO mapunits that have no major components flagged. (@dylanbeaudette)
get_component_data_from_NASIS_db(): removed duplicated hydricrating column, also now includes climate columns with standard names. This is a continuation of the idea that custom aliases for standard NASIS columns are deprecated (https://github.com/ncss-tech/soilDB/issues/242)
.pickBestEcosite() now considers record_when_last_updated in lieu of correlation date; this stabilizes sort order from SQLite snapshot v.s. NASIS local database sources (https://github.com/ncss-tech/soilDB/issues/295)
get_component_from_GDB(): fixes for batching over component geomorphic description and parent material group
get_mapunit_from_SDA(): handle possibility of mapunit-level SDA query failure
fetchNASIS(from="pedons") and get_site_data_from_NASIS_db() now return siteobsiid column (@natearoe)
mukey.wcs() gains experimental gridded STATSGO layer (300m)
Add get_NASIS_table_metadata() for returning information about columns in NASIS tables.
simplifyFragment/ArtifactData(): downgrade warnings
get_cosoilmoist_from_SDA(): mukey and cokey now included when duplicates=TRUE; thanks to @andypaolucci for catching this
fetchSoilGrids()
Add SpatVector coercion for input locations (already supported sf/sp classes)
Add handling for messages from API about erroneous input
Add fetchNASIS("pedons") columns vignette
Add get_NASIS_table_metadata() and optional argument include_description for get_NASIS_metadata() and get_NASIS_column_metadata()
get_SDA_cosurfmorph() + get_SDA_pmgroupname(): support for including or excluding misc. areas via miscellaneous_areas argument
get_site_data_from_NASIS_db():
Omit "multiple horizontal datums" warning
Remove calculated X/Y long/lat + add proper NASIS alias for long/lat
Add siteothvegclass id/name - add tables to default lookup/site sets
dbQueryNASIS(..., close=TRUE) now calls dbDisconnect() on.exit() (ensuring connections get closed on error)
fetchSCAN():
2x requests when timeseries argument not specified
Account for no results (e.g. year = 1800)
Bug fix in vectorization when daily + hourly data requested
downloadSSURGO():
Handle SDA_query() with invalid syntax in WHERE clause
Fix for include_template=FALSE
createSSURGO()
gpkg_contents when output filename is a GeoPackageFix for .get_comonth_from_SDA()
Fix selected set (SS argument) for get_ecosite_history_from_NASIS_db() in get_site_data_from_NASIS_db()
get_SDA_pmgroupname: return NA (not "NULL") for empty/missing pmgroupname when simplify=TRUE
SDA_spatialQuery():
geomIntersection=TRUE with db="SAPOLYGON" now correctly labels the areasymbol column (previously was mukey) to match geomIntersection=FALSE and SDA schema
Bounding box extent polygons are now only calculated for SpatRaster (not SpatVector) input
All references to soilDB.env have been replaced with a function that returns that environment object (get_soilDB_env()); thanks to @MollicMeyer for identifying this as a problem in #277. This object used to be exported but was unintentionally omitted from NAMESPACE; this has been fixed.
fetchNASIS(lab=TRUE) bug fix related to many:1 relationships between lab samples and morphologic horizons with all-missing columns having logical datatype (#277)
Added get_SRI() and fetchSRI() functions for accessing USFS Region 6 Soil Resource Inventory information from https://ecoshare.info/; thanks to @joshualerickson for the contribution (https://github.com/ncss-tech/soilDB/pull/274)
fetchLDM() now sets the horizon designation metadata like other fetch* functions that return SoilProfileCollection objects (@dylanbeaudette)
mukey.wcs() fix spurious warnings occasionally given due to minor differences (rounding) of grid dimensions
{curl} has been moved from Suggests to Imports
simplfyFragmentData() alias for simplifyFragmentData() removed (@infotroph)
Updates to SSURGO File Geodatabase functions (fetchGDB() and related) by @smroecker
Added soilColor.wcs() to access a web coverage service for soil color at various depths by @dylanbeaudette
waterDayYear(): fix for CRAN and different timezones; now defaults to tz="UTC" #268
summarizeSoilTemperature(): set default timezone to tz="UTC"Fix for uncode() on pre-decoded values when ChoiceName and ChoiceLabel overlap #273
NASISChoiceList() related to #273get_soilseries_from_NASIS(): Remove areaacres and obterm for #272 by @smroecker
Fix for get_OSD(..., fix_ocr_errors = TRUE) with empty typical profile for #271 by @dylanbeaudette
fetchNASIS() drops non-representative and additional when dropNotRepresentative/dropAdditional are set (@natearoe)
Fix for as.POSIXct() in R 4.3+; for #265
Fix for "status was 'SSL connect error" for fetchKSSL() and other functions that download JSON (@kramdog)
ssl_verifyhost=0Fixes for compatibility with {jsonlite} >1.8.1 that now uses {base} rather than {curl}
Update row count expectations for end of FY22 SSURGO refresh
uncode() replaced \(x) syntax inadvertently included in a recent update to fix R < 4.1 compatibility; thanks to @cbrueffer for catching this (https://github.com/ncss-tech/soilDB/issues/262)!
get_SDA_property() fixes for weighted average method (https://github.com/ncss-tech/soilDB/issues/229, https://github.com/ncss-tech/soilDB/issues/261)
fetchOSD() now automatically encodes horizon distinctness codes to default depth offsets, stored in hz-level attr: hzd
get_SDA_property() all methods now support miscellaneous_areas argument. This defaults to FALSE for the methods it was previously implemented for--so be aware that queries using "Dominant Component" or "Dominant Condition" (which previously did not respond to miscellaneous_areas) may have the number of rows in result reduced due to omission of miscellaneous land types. If this is unexpected or undesired, please use miscellaneous_areas=TRUE. (https://github.com/ncss-tech/soilDB/issues/257)
Adds get_NASIS_metadata() and helper method get_NASIS_column_metadata() and other new tools for working with uncode(), factors and NASIS metadata cached in the package.
Bug fix for get_cosoilmoist_from_SDA(); thanks to Monika Shea @monikashea for reporting the problem (https://github.com/ncss-tech/soilDB/issues/253)
fetchNASIS_report() now works with the output from "get_site_from_NASIS" report (useful for site records without associated pedons)
createSSURGO() gains arguments quiet and include_spatial to toggle messages and inclusion of spatial data in created SQLite database, respectively
downloadSSURGO() now handles queries against sacatalog that return no results more gracefully
get_OSD(): Add fix_ocr_errors argument for result='json' to fix common optical character recognition errors associated with horizon designations and colors (NOTE: does NOT fix depths)
fetchSCAN() gains timeseries argument to support batch downloads of hourly data. Additional arguments (...) are passed as a raw request, allowing other parameters sent in request to be modified if needed, and bypassing batch functionality. This is similar to the req argument syntax used in earlier versions of this function, which had been deprecated for some time now. Thanks to Matthew Morriss for raising the discussion item @morrismc99 (https://github.com/ncss-tech/soilDB/discussions/260).
{curl} moved from Suggests to Imports; curl::curl_download() is now used instead of utils::download.file() because it seems to handle SSL certificates better on some networks.
fetchNASIS("components'): Fix and refactor ( breaking change from 2.7.1, which introduced a bug/inconsistency) of recent change; duplicates argument is now required to merge in data from mapunit/legend tables (where many:1 relationships between legend/mapunit and datamapunit are possible). In 2.7.1 possibly incomplete mapunit/legend tables could be joined to SoilProfileCollection result (if and only if the tables were populated in selected set/local DB). Does not change historic (<=2.7.0) default behavior. Thanks to @dylanbeaudette for suggesting use of get_component_correlation_data_from_NASIS_db() here.
Several fixes for Roxygen documentation (notably for ROSETTA() and various NASIS web report related functions) that were missing @export tags. Several previously-exported functions missed being explicitly exported in the new Roxygen-generate NAMESPACE. These unintentional omissions from 2.7.1 NAMESPACE have been resolved.
Fixes an old bug in fetchSDA()/get_chorizon_from_SDA() related to LEFT OUTER versus RIGHT JOIN to chtexture table
get_SDA_coecoclass() better handling of NULL ecoclassref; support for filtering on ecoclasstypename; not_assigned_value now applies to ecoclassname, ecoclasstypename and ecoclassref columns in addition to ecoclassid; Thanks to Andy Paolucci and Jason Nemecek. Also, added additional columns from legend/mapunit tables (areasymbol, lkey, muname).
fetchNASIS(from="components") now returns mapunit and legend information (if loaded in local NASIS database); results now contain mustatus and repdmu which can be used to remove components from additional mapunits and non-representative data mapunits; thanks to Nathan Roeus_ss_timeline result to ASCIISDA_query(): Fixed POST request that could produce unhandled errors on network failure (now returns try-error like other error-causing code)SDA_query(): In the event of a syntax error, error contents are now returned as a message, not a warning.uncode() and code() now work with data.table and tibble objects.sp and raster which means soilDB no longer requires the soon-to-retire rgdal package.sf and terra, which have been added to Suggests.
sf, SpatRaster) will be returned by default rather than Spatial*DataFrame or RasterLayer from sp and raster.fetchSDA_spatial() and SDA_spatialQuery() gain as_Spatial argument; when TRUE equivalent (backward compatible) sp and raster data types are returned.options(soilDB.return_Spatial=TRUE)mukey.wcs() and ISSR800.wcs() bug fix for some instances where the target extent was miscalculated, resulting in slight differences from requested resolution (res argument) of result.mukey.wcs() gains a new possible data source db="RSS" which accesses a Web Coverage Service containing grids from Raster Soil Surveys in the United States.rmHzErrors argument now defaults to FALSE. Please let us know if allowing horizon errors results in unexpected behavior so we can repair various interfaces that rely on no errors being present. See aqp::checkHzDepthLogic() for more information on the types of things that used to result in profiles being removed from results and for guidelines on how to fix.plotplantinventory table to get_vegplot_species_from_NASIS_db() result; thanks to Zachary Van Abbema for suggestion and feedbackuncode() are now cached within an R session which results in faster query processing times for users with a local NASIS database connection set up.
db argument to uncode() has been deprecated. Now, code() and uncode() can use ChoiceName and/or ChoiceLabel in coding and decoding ChoiceValue for all data sources.get_SDA_cosurfmorph(): a new function in "SSURGO On Demand" style. Users can customize the WHERE clause, target tables and the grouping variable used to calculate proportions (default by="compname")
get_SDA_property() with method="weighted average" and include_minors=TRUE/miscellaneous_areas=TRUE, thanks to Andy Paolucci and Dylan Beaudette for testing and providing feedback on the queries.get_SDA_*() methods (except get_SDA_metrics()) now support input of custom WHERE clause in lieu of mukeys/areasymbols arguments and gain a dsn argument for specifying a local SQLite database or DBIConnection.downloadSSURGO() for downloading/extraction of the SSURGO data by survey area from Web Soil Survey.createSSURGO() for building of local databases as SQLite/Geopackage from one or more SSURGO exports.fetchNASIS()
mixColors argument used to toggle color mixing for pedon horizons with multiple colors per moisture state.
TRUE mixes colors based on reported color percentage via estimateColorMixture(). FALSE returns the dominant color in each moisture state, or first record for cases without colorpct populated.taxreaction and taxfamhahatmatcl to extended taxonomic informationsoilDB.NASIS.skip_uncode) to bypass uncode() in NASIS functions (mostly used for debugging or special database instances that come pre-decoded)fetchNASIS(from="components") where local database connection was left open was fixedfetchLDM() function to access Kellogg Soil Survey Lab Data Mart via Soil Data Access or local SQLite snapshot (https://github.com/ncss-tech/soilDB/pull/243)get_SDA_metrics() for accessing usage metrics for Soil Data Access, Web Soil Survey and the Lab Data Mart. Thanks to Jason Nemecek for submitting the base SQL queryget_SDA_interpretation(method = "dominant condition") now includes total_comppct_* columns reflecting the summed component percentage of the dominant conditionpedlabsampnum (KSSL Pedon Sample ID)waterYearDay() bug fix for more specific (sub-daily) date-time formatsfetchSCAN() better handling of empty results in multi-site queriesfetchNASIS("pedons") no longer includes pmweatheringfetchNASIS("components") no longer includes ecositeoriginstringsAsFactors argument to soilDB functions has been deprecated in favor of a package option
NASISDomainsAsFactor(TRUE) to toggle package option soilDB.NASIS.DomainsAsFactorfetchSDA_spatial now supports by.col "areaname", "mlraoffice", and "mouagencyresp"; thanks to suggestion by Jay SkovlinfetchNASIS fix for multiple site observation records with surface fragments; thanks to bug report from Brianna WegnerwaterYearDay() use format and timezone for start date conversionfetchNASIS fix for from="components", SS=FALSE and queries where no NASIS local database is present (e.g. from SQLite source)NASIS_table_column_keys dataset of NASIS primary and foreign keys by table name to include many more tablesfetchVegdata() no longer errors for child table queries unless site/site observation/vegetation plot records are missingfetchOSD(extended=TRUE) now returns an element "NCCPI" containing the National Commodity Crop Production Index summaries. The values returned are quantiles at the 1, 5, 25, 50, 75, 95, and 99% levels over all SSURGO components with compname matching series for irrigated and non-irrigated condition.get_SDA_property() now works with mixed component and horizon-level properties; thanks to Matthieu Stigler for the bug reportget_SDV_legend_elements() for fetching and parsing XML for Soil Data Viewer / Web Soil Survey-style symbol themes for soil interpretations from Soil Data AccessfetchNASIS() pedon and component geomorphic summaries now include columns for landscape, microfeature, microrelief, 2D/3D morphometry, and slope shapefetchNASIS('pedons') now uses simplifyFragmentData() for surface fragmentsfetchSDA() handle NULL component-level results with an informative errorfetchSDA() now (again) returns mapunit/legend-level information via get_mapunit_from_NASIS()createStaticNASIS() and queries to SQLite NASIS snapshots now preserve date/time using RSQLite 2.2.4+ via extended_types=TRUE argument to dbConnect()get_soilseries_from_NASIS() now returns soiltaxclasslastupdated as a date/time and stores the year in calculated column soiltaxclassyearlastupdatedget_NASIS_table_name_by_purpose()fetchOSD() gains surface shape proportions in extended shape_across and shape_down tablesSDA_spatialQuery() what='mukey' now works with db='STATSGO'loafercreek, gopheridge and mineralKingwaterYearDay() pass through format argument for POSIX time conversionwaterDayYear() and .formatDates() allow optional format and tz argument; used for consistent POSIX time conversion in tests where date/time has granularity finer than one dayfetchSDA() extensions for better handling of components with no horizon dataSDA_spatialQuery() and processSDA_WKT() fully use {sf}, replacing {sp} in these contextsSDA_spatialQuery() gains argument byFeature to use multiple single-feature queries and combine the results with a unique feature ID specified by idcol argument. This allows for specific feature intersection results without secondary spatial overlay of the polygons (https://github.com/ncss-tech/soilDB/issues/222)dbConnectNASIS() no longer requires that the NASIS credentials option be set if the dsn argument is specified.loafercreek, gopheridge and mineralKing from latest fetchNASIS() results.processSDA_WKT(): replaced {rgeos} with {wk} and {sf}SDA_spatialQuery(): added query_string argumentget_SDA_property(): fixes for MIN/MAX aggregation (https://github.com/ncss-tech/soilDB/issues/219)get_component_from_SDA(): fragment size thresholds now conform with new (clarified) NSSH definitionsfetchNASIS() upgrades: use data.table and base internally for data aggregationfetchNASIS("components") now "sieves" rock fragments and human artifacts using same routines as for pedons; respects nullFragsAreZero argumentfetchKSSL(..., returnGeochemicalData = TRUE) safely returns 0-length data.frame when no data availableget_OSD(): Handle "NA" and type conversion for JSON results an convert spaces to underscores for file names as neededfetchSCAN(): graceful handling of timeout and converted from {plyr} to {data.table}; (https://github.com/ncss-tech/soilDB/issues/161, https://github.com/ncss-tech/soilDB/issues/184)get_EDIT_ecoclass_by_geoUnit(): graceful handling of timeoutget_SDA_muaggatt(): add query_string argument for parity with other "SSURGO on demand" / get_SDA_*() functionsget_SDA_pmgroupname() and get_SDA_hydric() now support alternate aggregation methods.
get_SDA_pmgroupname() is "dominant component", now also supports "dominant condition" and "none".get_SDA_hydric() is a map unit level aggregation of components and assigns new classes ; now supports "dominant component", "dominant condition" and "none"fetchNASIS(from="pedons") now supports fill=TRUE argument just like from="components" to include pedons that have no horizon recordscreateStaticNASIS(): column order should match NASIS, even if data types require reorder for ODBC driverfetchSoilGrids() bug fixes, updates to metadata and references in documentation (https://github.com/ncss-tech/soilDB/issues/201)
nitrogen values (conversion from cg/kg to g/kg)bdod and nitrogen (SoilGrids uncertainty layer always uses factor of 10 to create integers)progress and verbose arguments for text progress bar and additional message outputget_SDA_coecoclass() SOD-style method for mapunit/component level summaries of ecological site and other vegetation class informationSDA_query() and all functions that call SDA_query() get proper column class handling (related to #190), however:
type.convert() may have changed (e.g. component.wei)SDA_spatialQuery() can now be used to return soil survey area symbols or geometry using what="areasymbol" or what="sapolygon", respectivelyget_soilseries_from_NASIS(); now including taxonomic mineralogy class which may contain multiple parts for series with strongly contrasting control sectionsget_SDA_*() methods
get_SDA_property(property = ...) and get_SDA_interpretation(rulename = ...) vectorization over property/rulename to work with any aggregation method.
query_string argument (default: FALSE). Set as TRUE to skip submitting query to SDA, instead returning a string of the query that would have been sent instead of data.frame resultget_SDA_property: better handling of NULL, miscellaneous areas, and property-specific weighting
ISNULL(x, 0) logic that affected weighted averages in presence of missing datainclude_minors=FALSE includes only components where majcompflag = 'Yes' in resultmiscellaneous_areas=FALSE removes miscellaneous land types compkind values from resultget_SDA_interpretation: added argument not_rated_value with default value of NA to set "not rated"" values across methods/queries. For backwards compatibility with original SQL use not_rated_value = 99.0phlabresults wasn't working as expected and for highlighting some more improvements (https://github.com/ncss-tech/soilDB/issues/192)get_OSD() TXT and HTML formats now supported (in addition to JSON) through a common function interfaceget_NASIS_table_key_by_name() get_NASIS_fkey_by_name(), get_NASIS_pkeyref_by_name(), get_NASIS_pkey_by_name(), get_NASIS_table_name_by_purpose() methods for helping get information on primary/foreign keys and thematic groups of NASIS tables (useful for creating SQLite/external snapshots of NASIS tables)get_mapunit_from_NASIS(), get_legend_from_NASIS() and get_lmuaoverlap_from_NASIS() now works for "MLRA Survey Area" areatypename and no longer is limited by constraints on legendsuituse or mustatusformativeElement argument to taxaExtent() (SoilWeb taxon extent function)
taxaExtent("abruptic", level = 'subgroup', formativeElement = TRUE) will get an 800m grid (for SSURGO data in CONUS) showing extent of taxa that have "abruptic" in subgroup-level taxon namefetchNASIS(from="pedons") result now contains the "taxclname" (full family-level taxon name) field from the NASIS pedon table; this value is calculated based on contents of petaxhistory child tableget_SDA_interpretation and get_SDA_property now support aggregation method="NONE" allowing for returning properties, classes and ratings for individual components or horizons (https://github.com/ncss-tech/soilDB/pull/181)ISSR800.wcs and mukey.wcs now return a result that inherits from try-error (and a message) if the Web Coverage Service query failsDBI and odbc, replacing RODBCdbConnectNASIS and dbQueryNASIS for NASIS access with read-only credentials, fetching query results, and closing the DBIConnection upon completiondsn argument to specify a local "static" SQLite file containing NASIS tables, or custom DBIConnection to a database with NASIS schema
dsn = NULL uses "nasis_local" ODBC connection to local NASIS SQL Serveraqp::checkHzDepthLogic(), powered by {data.table}get_SDA_property, get_SDA_interpretation, get_SDA_muaggatt, get_SDA_hydric, get_SDA_pmgroupnameOSDquery gets a new argument (everything) for searching the entire documentfetchNASIS(..., rmHzErrors=TRUE) -- spurious removals of data due to missing "extended" records. fetchNASIS now uses aqp::horizons<- after building a minimal SoilProfileCollection from NASIS site and horizon tables. This allows aqp integrity methods to trigger where needed--preventing unintentional re-ordering or removals of "valid" horizon data.HenryTimeLine moved to {sharpshootR} packagemukey.wcs() and ISSR800.wcs() for hitting web coverage service (WCS) for gSSURGO, gNATSGO, and ISSR-800 gridsROSETTA() for accessing the new ROSETTA model API (c/o Todd Skaggs, USDA-ARS)fetchOSD(..., extended=TRUE) gains geographically associated soils, parsed from OSD (thanks AGB)fetchSDA_spatial now can return soil survey area polygons using geom.src = "sapolygon" with x as a vector of area symbols (areasymbol) or legend keys (lkey). For sapolygon results, the method and add.field arguments work the same as for mupolygon, only now both geometries can be returned with fields from the legend table.fetchSDA_spatial now can return STATSGO gsmmupolygon geometry with db = "STATSGO"; these data are linked to mapunit and (national) legend just like mupolygon.fetchNASIS / soilDB:::.rockFragmentSieve now uses fragment RV, soilDB:::.sieve uses < operator (https://github.com/ncss-tech/soilDB/issues/1)fetchKSSL(..., returnMorphologicData=TRUE) now returns redoximorphic features by horizontaxaExtent returns 800m gridded taxonomic grids for CONUSseriesExtent can now return 800m gridded series extents for CONUSSDA_spatialQuery can now retrieve SSURGO and STATSGO geometry c/o dschlaep (https://github.com/ncss-tech/soilDB/issues/141)data.table; beginning to implement data.table-aware methods in aqp and soilDBfetchGDB for querying tabular data from SSURGO/gNATSGO/STATSGO File Geodatabasesget_NOAA_GHCND() and get_NOAA_stations_nearXY() for batch queries of NOAA Daily Climate Data (requires free API token)fetchSDA_spatial with chunk.size > 1 resulting in duplicate data in resultfetchSDA_spatial to handle queries that exceed JSON Serialization LimitfetchSoilGrids for point data queries to SoilGrids v2 API with SoilProfileCollection outputfetchKSSL(..., returnGeochemicalData=TRUE) now returns geochemical, optical and XRD/thermal datafetchKSSL related to vectorization, all arguments vectorized except for bboxKSSL_VG_model output cleaned-up, now returns phi -> theta functionfetchKSSL is now fully vectorized and builds on new SoilWeb JSON APIget_concentrations_from_NASIS_db() and get_phfmp_from_NASIS_db() for fetching Pedon Horizon Concentrations and Field Measured Properties from NASIS local databasefetchNASIS(from='components', fill=TRUE, rmHzErrors=TRUE) in context of new ::hzDepthTests() and non-unique chiid due to NA values introduced by fillsimplifyColorData and mix_and_clean_colors always use CIELAB colorspace for weighted averages, and best-available metric for transformation to Munsell notationfetchSDA_spatial - new fetch function that simplifies getting spatial data associated with a vector of mukey or nationalmusym. The function has options for customizing result attribute table and is designed to automatically use makeChunks() to prevent timeout on large queries.aqp::test_hz_logic is now deprecated -- refactored affected fetch functionsfetchNASIS_pedons()
fetchNASIS() has @restrictions set automatically if data are populatedget_RMF_from_NASIS_db()SDA_query() related to multi-line records (https://github.com/ncss-tech/soilDB/issues/28)sharpshootR added to SUGGESTS
fetchHenry() and fetchSCAN() now include water year/day (Oct 1 -- Sep 30)HenryTimeLine() convenience function addedfetchOSD(..., extended=TRUE) when no climate data availableSDA_query()simplifyFragmentData() and related functions now 4-5x faster
fetchOSD() now returns metadata when extended=TRUEstringrfetchNASIS() related to conversion of NULL fragment volume to 0
fetchKSSL() can now automatically simplify colors with simplifyColors = TRUEsiblings()
fetchOSD(..., extended=TRUE) gets competing soil seriesfetchOSD() gets an overhaul, new API and featuresOSDquery()loafercreek and gopheridge sample datasets and manual page to reflect latest fetchNASISRCurl functions in favor of httr alternatives (done)
+ switch from reshape to reshape2 (pending)
+ possibly move some packages from SUGGESTS to IMPORTSreshape package, will transition to reshape2 with soilDB 2.0
loafercreek and gopheridge sample datasetssuggests, and checking for package availability at function runtime. this will make soilDB more portable, as not every user will want or need all functionality.