Skip to content

Releases: ncss-tech/soilDB

soilDB 2.7.5

18 Oct 13:41
Compare
Choose a tag to compare

soilDB 2.7.5 (2022-10-17)

  • 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
    • Fix for NASISChoiceList() related to #273
  • get_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)
    • Now uses standard soilDB {curl} handle, which includes a longer timeout and ssl_verifyhost=0
  • Fixes for compatibility with {jsonlite} >1.8.1 that now uses {base} rather than {curl}
  • Update row count expectations for end of FY22 SSURGO refresh

soilDB 2.7.4

30 Sep 22:34
d797472
Compare
Choose a tag to compare

soilDB 2.7.4 (2022-09-30)

  • uncode() replaced \(x) syntax inadvertently included in a recent update to fix R < 4.1 compatibility; thanks to @cbrueffer for catching this (#262)!

  • get_SDA_property() fixes for weighted average method (#229, #261)

  • fetchOSD() now automatically encodes horizon distinctness codes to default depth offsets, stored in hz-level attr: hzd

soilDB 2.7.3

20 Aug 00:07
Compare
Choose a tag to compare

soilDB 2.7.3 (2022-08-19)

  • 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. (#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 (#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 (#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.

soilDB 2.7.2

27 Jun 20:13
Compare
Choose a tag to compare

soilDB 2.7.2 (2022-06-27)

  • 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

soilDB 2.7.1

10 Jun 21:38
Compare
Choose a tag to compare

soilDB 2.7.1 (2022-06-10)

  • 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 Roe
  • Convert UTF-8 strings in us_ss_timeline result to ASCII
  • SDA_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.
  • Various fixes to tests and error handling code to reduce likelihood of thrown errors from network problems or missing suggested packages.

soilDB 2.7.0

18 May 22:15
Compare
Choose a tag to compare

soilDB 2.7.0 (2022-05-18)

  • Spatial
    • Dropped imports from sp and raster which means soilDB no longer requires the soon-to-retire rgdal package.
    • All spatial data processing has been moved to sf and terra, which have been added to Suggests.
      • (breaking change) Classes from these packages (e.g. sf, SpatRaster) will be returned by default rather than Spatial*DataFrame or RasterLayer from sp and raster.
      • (breaking change) Spatial functions that take spatial input will return the same class type as the input unless otherwise specified.
        • fetchSDA_spatial() and SDA_spatialQuery() gain as_Spatial argument; when TRUE equivalent (backward compatible) sp and raster data types are returned.
        • Alternately, you may set 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.
    • See: #229 for more details on what has changed.
  • NASIS
    • (breaking change) 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.
    • Added several new columns from the plotplantinventory table to get_vegplot_species_from_NASIS_db() result; thanks to Zachary Van Abbema for suggestion and feedback
    • Local NASIS metadata used for uncode() are now cached within an R session which results in faster query processing times for users with a local NASIS database connection set up.
      • The 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.
    • Rock fragment and artifact sieving now uses <76mm as the upper boundary for gravel fraction, and a related QC message has been removed
  • SSURGO / Soil Data Access
    • Added 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")
      • "cosurfmorphgc" summarizes "geomposmntn", "geomposhill", "geomposflats", "geompostrce"
      • "cosurfmorphhpp" summarizes "hillslopeprof"
      • "cosurfmorphss" summarizes "shapeacross", "shapedown", and concatenated "surfaceshape"
    • Several fixes for logic of 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.
    • All 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.
    • Added downloadSSURGO() for downloading/extraction of the SSURGO data by survey area from Web Soil Survey.
    • Added createSSURGO() for building of local databases as SQLite/Geopackage from one or more SSURGO exports.

What's Changed

  • Use terra/sf to replace raster/sp/rgdal by @brownag in #229
  • Add get_SDA_cosurfmorph() by @brownag in #245
  • downloadSSURGO & createSSURGO: download WSS ZIP archives by soil survey area and create local databases (SQLite/SpatiaLite/Geopackage) by @brownag in #244
  • Add get_SSURGO_utils.R by @brownag in #247
  • get_SDA_*(): Local SDA-style queries by @brownag in #246

Full Changelog: 2.6.15...2.7.0

soilDB 2.6.15

14 Apr 16:02
Compare
Choose a tag to compare

soilDB 2.6.15 (2022-04-13)

  • fetchNASIS()
    • New mixColors argument used to toggle color mixing for pedon horizons with multiple colors per moisture state.
      • Default 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.
    • Added taxreaction and taxfamhahatmatcl to extended taxonomic information
    • Added new option (soilDB.NASIS.skip_uncode) to bypass uncode() in NASIS functions (mostly used for debugging or special database instances that come pre-decoded)
    • An instance in fetchNASIS(from="components") where local database connection was left open was fixed
  • Added fetchLDM() function to access Kellogg Soil Survey Lab Data Mart via Soil Data Access or local SQLite snapshot (#243)
  • Added 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 query
  • get_SDA_interpretation(method = "dominant condition") now includes total_comppct_* columns reflecting the summed component percentage of the dominant condition
  • Updated metadata for SCAN sites that were missing pedlabsampnum (KSSL Pedon Sample ID)

CRAN Release 2.6.14

15 Mar 15:33
Compare
Choose a tag to compare

soilDB 2.6.14 (2022-03-15)

  • waterYearDay() bug fix for more specific (sub-daily) date-time formats
  • fetchSCAN() better handling of empty results in multi-site queries
  • Updates to queries, metadata and sample datasets for NASIS 7.4.1 Database Model
    • fetchNASIS("pedons") no longer includes pmweathering
    • fetchNASIS("components") no longer includes ecositeorigin
    • New Component Ecological Site attributes added
  • stringsAsFactors argument to soilDB functions has been deprecated in favor of a package option
    • Default behavior for NASIS domains is to return character labels rather than coded factors
    • Use NASISDomainsAsFactor(TRUE) to toggle package option soilDB.NASIS.DomainsAsFactor

CRAN Release 2.6.13

31 Jan 15:20
Compare
Choose a tag to compare

soilDB 2.6.13 (2022-01-29)

  • fetchSDA_spatial now supports by.col "areaname", "mlraoffice", and "mouagencyresp"; thanks to suggestion by Jay Skovlin
  • fetchNASIS fix for multiple site observation records with surface fragments; thanks to bug report from Brianna Wegner
  • waterYearDay() use format and timezone for start date conversion
  • fetchNASIS fix for from="components", SS=FALSE and queries where no NASIS local database is present (e.g. from SQLite source)
  • Update to NASIS_table_column_keys dataset of NASIS primary and foreign keys by table name to include many more tables
  • fetchVegdata() no longer errors for child table queries unless site/site observation/vegetation plot records are missing
  • fetchOSD(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.

CRAN Release 2.6.12

08 Jan 21:03
Compare
Choose a tag to compare

soilDB 2.6.12 (2022-01-07)

  • get_SDA_property() now works with mixed component and horizon-level properties; thanks to Matthieu Stigler for the bug report
  • Added get_SDV_legend_elements() for fetching and parsing XML for Soil Data Viewer / Web Soil Survey-style symbol themes for soil interpretations from Soil Data Access
  • fetchNASIS() pedon and component geomorphic summaries now include columns for landscape, microfeature, microrelief, 2D/3D morphometry, and slope shape
  • fetchNASIS('pedons') now uses simplifyFragmentData() for surface fragments

soilDB 2.6.11 (2021-12-21)

  • fetchSDA() handle NULL component-level results with an informative error
  • fetchSDA() 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 soiltaxclassyearlastupdated
  • Added several tables to thematic groups in get_NASIS_table_name_by_purpose()
  • fetchOSD() gains surface shape proportions in extended shape_across and shape_down tables
  • SDA_spatialQuery() what='mukey' now works with db='STATSGO'
  • Added metadata to loafercreek, gopheridge and mineralKing
  • waterYearDay() pass through format argument for POSIX time conversion