Package: soilDB 2.9.2

Andrew Brown

soilDB: Soil Database Interface

A collection of functions for reading soil data from U.S. Department of Agriculture Natural Resources Conservation Service (USDA-NRCS) and National Cooperative Soil Survey (NCSS) databases.

Authors:Dylan Beaudette [aut], Jay Skovlin [aut], Stephen Roecker [aut], Andrew Brown [aut, cre]

soilDB_2.9.2.tar.gz
soilDB_2.9.2.zip(r-4.7)soilDB_2.9.2.zip(r-4.6)soilDB_2.9.2.zip(r-4.5)
soilDB_2.9.2.tgz(r-4.6-any)soilDB_2.9.2.tgz(r-4.5-any)
soilDB_2.9.2.tar.gz(r-4.7-any)soilDB_2.9.2.tar.gz(r-4.6-any)
soilDB_2.9.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
soilDB/json (API)

# Install 'soilDB' in R:
install.packages('soilDB', repos = c('https://ncss-tech.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ncss-tech/soildb/issues

Pkgdown/docs site:https://ncss-tech.github.io

Datasets:

On CRAN:

Conda:

ksslnasisnrcssoilsoil-data-accesssoil-surveysoilwebsqlusda

11.68 score 100 stars 1 packages 1.1k scripts 1.8k downloads 1 mentions 171 exports 4 dependencies

Last updated from:38a30308f2. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK182
source / vignettesOK256
linux-release-x86_64OK165
macos-release-arm64OK127
macos-oldrel-arm64OK158
windows-develOK125
windows-releaseOK199
windows-oldrelOK166
wasm-releaseOK149

Exports:codecreateSSURGOcreateStaticNASISdbConnectNASISdbQueryNASISdownloadSSURGOestimateColorMixtureestimateSTRfetchGDBfetchHenryfetchHWSDfetchKSSLfetchLDMfetchNASISfetchNASISLabDatafetchNASISWebReportfetchOSDfetchPedonPCfetchRaCAfetchSCANfetchSDAfetchSDA_spatialfetchSoilGridsfetchSOLUSfetchSRIfetchVegdatafilter_geochemformat_SQL_in_statementget_chorizon_from_NASISWebReportget_chorizon_from_SDAget_cointerp_from_SDAget_colors_from_NASIS_dbget_colors_from_pedon_dbget_comonth_from_NASIS_dbget_competing_soilseries_from_NASISget_component_cogeomorph_data_from_NASIS_dbget_component_cogeomorph_data_from_NASIS_db2get_component_copm_data_from_NASIS_dbget_component_correlation_data_from_NASIS_dbget_component_data_from_NASIS_dbget_component_diaghz_from_NASIS_dbget_component_esd_data_from_NASIS_dbget_component_from_GDBget_component_from_NASISWebReportget_component_from_SDAget_component_horizon_data_from_NASIS_dbget_component_otherveg_data_from_NASIS_dbget_component_restrictions_from_NASIS_dbget_concentrations_from_NASIS_dbget_copedon_from_NASIS_dbget_cosoilmoist_from_NASISget_cosoilmoist_from_NASISWebReportget_cosoilmoist_from_SDAget_cotext_from_NASIS_dbget_ecosite_history_from_NASIS_dbget_EDIT_ecoclass_by_geoUnitget_extended_data_from_NASIS_dbget_extended_data_from_pedon_dbget_HWSD_pathget_hz_data_from_NASIS_dbget_hz_data_from_pedon_dbget_lablayer_data_from_NASIS_dbget_labpedon_data_from_NASIS_dbget_legend_from_GDBget_legend_from_NASISget_legend_from_NASISWebReportget_legend_from_SDAget_lmuaoverlap_from_NASISget_lmuaoverlap_from_NASISWebReportget_lmuaoverlap_from_SDAget_mapunit_from_GDBget_mapunit_from_NASISget_mapunit_from_NASISWebReportget_mapunit_from_SDAget_mutext_from_NASIS_dbget_NASIS_column_metadataget_NASIS_fkey_by_nameget_NASIS_metadataget_NASIS_pkey_by_nameget_NASIS_pkeyref_by_nameget_NASIS_table_key_by_nameget_NASIS_table_metadataget_NASIS_table_name_by_purposeget_NOAA_GHCNDget_NOAA_stations_nearXYget_OSDget_OSD_JSONget_phfmp_from_NASIS_dbget_phroots_from_NASIS_dbget_progress_from_NASISWebReportget_project_correlation_from_NASISWebReportget_project_from_NASISWebReportget_projectmapunit_from_NASISget_projectmapunit_from_NASISWebReportget_projectmapunit2_from_NASISWebReportget_projectmilestone_from_NASISget_RMF_from_NASIS_dbget_SDA_coecoclassget_SDA_cosurfmorphget_SDA_hydricget_SDA_interpretationget_SDA_metricsget_SDA_muaggattget_SDA_NASIS_keyget_SDA_pmgroupnameget_SDA_propertyget_SDV_legend_elementsget_site_association_from_NASISget_site_data_from_NASIS_dbget_site_data_from_pedon_dbget_sitesoilmoist_from_NASISWebReportget_soilDB_envget_soilseries_from_NASISget_soilseries_from_NASISWebReportget_SRIget_SRI_layersget_text_notes_from_NASIS_dbget_veg_data_from_NASIS_dbget_veg_from_AK_Siteget_veg_from_MT_veg_dbget_veg_from_NPS_PLOTS_dbget_veg_other_from_MT_veg_dbget_veg_species_from_MT_veg_dbget_vegplot_from_NASIS_dbget_vegplot_groundsurface_from_NASIS_dbget_vegplot_location_from_NASIS_dbget_vegplot_prodquadrats_from_NASIS_dbget_vegplot_species_from_NASIS_dbget_vegplot_speciesbasalarea_from_NASISget_vegplot_textnote_from_NASIS_dbget_vegplot_transect_from_NASIS_dbget_vegplot_transpecies_from_NASIS_dbget_vegplot_transpoints_from_NASIS_dbget_vegplot_tree_si_details_from_NASIS_dbget_vegplot_tree_si_summary_from_NASIS_dbget_vegplot_trhi_from_NASIS_dbgetHzErrorsNASISgetHzErrorsPedonPCISSR800.wcsKSSL_VG_modellocal_NASIS_definedmake_EDIT_service_URLmakeChunksmonth2seasonmukey.wcsNASISNASISChoiceListNASISDomainsAsFactorOSDqueryparseWebReportprocessSDA_WKTROSETTASCAN_sensor_metadataSCAN_site_metadataSDA_querySDA_spatialQueryseriesExtentsiblingssimplifyArtifactDatasimplifyColorDatasimplifyFragmentDatasoilColor.wcssoilDB_user_dirsoilDB.envSoilWeb_spatial_querySTRplotsummarizeSoilTemperaturetaxaExtentuncodewaterDayYearWCS_details

Dependencies:curldata.tableDBIjsonlite

Map Unit Key Grids and Thematic Maps of Soil Survey Geographic (SSURGO) Data
Introduction | Setup | Grid Selection | gSSURGO | gNATSGO | Raster Soil Survey | STATSGO | Thematic Mapping | Caveats / Limitations | Web Coverage Service Requests Using Bounding Boxes | Manual Creation of Bounding Boxes | Map Unit Key Grids | SSURGO Polygons from SDA | Grid Resolution Specification | Raster Soil Survey Data | Hawaii SSURGO | Puerto Rico SSURGO | Map Unit Aggregate Values | Interpretations for Soil Suitability / Limitation | Component-level Properties | Several Horizon-level Soil Properties | Sand, Silt, and Clay at a Soil Survey Area Boundary

Last update: 2026-05-04
Started: 2023-06-09

Soil Data Access
Introduction to Soil Data Access (SDA) | What is SDA? | SSURGO and STATSGO2 Data | When to Use SDA vs. Local SSURGO | Package Requirements | Basic SDA_query() Function | Core Syntax | Handling Errors | Understanding SDA SQL | Basic Table Joins | Understanding LEFT JOIN vs INNER JOIN | When Data are Complete: INNER JOIN | When Data May Be Missing: LEFT JOIN | Summary: When to Use Each Join Type | Aggregation Functions | Data Filters | Filtering SSURGO vs. STATSGO2 | Filtering Horizon Data | Filtering Strategy | Soil Materials | Rock Fragment Data | Basic Rock Fragment Query | Aggregating Rock Fragments by Horizon | Rock Fragment Properties via get_SDA_property() | SDA Query Limits and Strategies | SDA Query Limitations | Strategies for Large Queries | SQL Dialect Handling | T-SQL Syntax Specifics | NULL Handling | Type Casting | String Operations | Query Chunking for Large Datasets | Why "Chunking"? | Using makeChunks() | Example Chunked Property Query | Recommended Chunk Sizes | Spatial Queries | Converting sf Objects to WKT | High-level Functions | Spatial Queries: The Two-Step Pattern | SDA Spatial Helper Functions | Spatial and Tabular Property Integration | get_SDA_property(): Component and Horizon Properties | Available Properties | Method: Dominant Component (Category) | Method: Dominant Component (Numeric) | Method: Weighted Average | Method: Min/Max | Method: Dominant Condition | Method: None | Inspecting Generated Queries | get_SDA_interpretation(): Soil Interpretations | Available Interpretations | Method: Dominant Component | Understanding Output Columns | get_SDA_hydric(): Hydric Soil Classifications | Method: MAPUNIT (Default) | Method: DOMINANT COMPONENT | Method: DOMINANT CONDITION | Method: NONE | get_SDA_muaggatt(): Map Unit Aggregate Attributes | Filtering Results | get_SDA_pmgroupname(): Parent Material Groups | Simplify Parameter | get_SDA_coecoclass(): Component Ecological Classes | Method: NONE (Default) | Method: ALL | get_SDA_cosurfmorph(): Component Surface Morphometry | Available Tables | Example: 3D Geomorphic Classification | Example: Hillslope Position by Area | Example: Surface Shape | Example: Microrelief | fetchSDA(): Get Soil Profile Collection | Basic Usage | Handling Duplicates | fetchLDM(): Get Laboratory Data | Querying by Taxon Name | Advanced Usage: Specific Tables | Integration Examples: Combining Multiple Functions | Example 1: Multi-Method Property Comparison | Example 2: Properties and Interpretations for Land Use Planning | Example 3: Hydric Status and Interpretations | Example 4: Aggregating Across Multiple Areas | Example 5: Component-Level Analysis | Summary and Best Practices | Key Takeaways | Recommended Workflow | SDA Resources | Appendix: Common SDA Tables and Columns | Core Tables | Common Columns

Last update: 2026-02-04
Started: 2026-01-23

fetchNASIS(from='pedons') Columns

Last update: 2026-01-23
Started: 2023-01-12

Local Soil Survey Geographic (SSURGO) Databases
Overview | Remote vs. Local Access | Download SSURGO Data | Create a Local SSURGO Database | Load and Explore the Database | View Table Structure | Basic Queries | Join Tables | Load Spatial Data | Visualizing Soil Properties | Load Tabular Data | Example 1: Dominant Component Percentage (comppct_r) | Example 2: Hydrologic Group (hydgrp) and Drainage Class (drainagecl) | Thematic Maps | Query and Aggregation Functions | Alternative Tools

Last update: 2026-01-23
Started: 2025-08-28

Functions and Data Sources that Depend on SoilWeb
Summary | Primary Data Sources | soilDB Functions | Functions with Questionable Future | Related Web Applications | Relevant Tutorials | SoilWeb Curated Data Sources | SC and OSD Derivatives | SSURGO Derivatives | MLRA | Geomorphic Summaries | Siblings | Other | Parent Material Summaries | Series and Taxa Extent | Web Coverage Services | Climate Data and Derivatives | Frost-Free Period | Frost-Free Days | Design Freeze Index | Growing Degree Days (C) | Effective Precipitation | Fraction of Precipitation as Rain | DEM Derivatives | Geomorphons

Last update: 2026-01-23
Started: 2026-01-21

Mapping Dominant Ecological Sites using SSURGO Data
Overview | Prerequisites | Load SSURGO Spatial Data | Using Soil Data Access | Option 1: Use SDA_spatialQuery() to get mukey polygons for an AOI | Option 2: Use fetchSDA_spatial() | fetchSDA_spatial() geometry sources | SDA_spatialQuery() vs. fetchSDA_spatial() | Local Data Sources | Query SDA for Dominant Ecological Site Info | Extract Unique Map Unit Keys | Use get_SDA_coecoclass() | Using method="dominant component" | Using method="dominant condition" | Join Tabular and Spatial Data | Visualize the Result | Export Spatial File | References | SSURGO Data and Tools | soilDB functions | Spatial Analysis in R

Last update: 2025-08-28
Started: 2025-08-28

Readme and manuals

Help Manual

Help pageTopics
Soil Database InterfacesoilDB-package soilDB
Create a database from SSURGO ExportscreateSSURGO
Create a memory or file-based instance of NASIS databasecreateStaticNASIS
Create local NASIS database connectiondbConnectNASIS NASIS
Query a NASIS DBIConnectiondbQueryNASIS
Get SSURGO ZIP files from Web Soil Survey 'Download Soils Data'downloadSSURGO
Estimate color mixtures using weighted average of CIELAB color coordinatesestimateColorMixture
Estimate Soil Temperature RegimeestimateSTR
Fetch Harmonized World Soil Database DatafetchHWSD get_HWSD_path
Get Kellogg Soil Survey Laboratory Data from SoilWeb snapshotfetchKSSL
Query data from Kellogg Soil Survey Laboratory Data Mart via Soil Data Access or local SQLite snapshotfetchLDM
Get a pedon or component data 'SoilProfileCollection' from NASISfetchNASIS get_concentrations_from_NASIS_db get_phfmp_from_NASIS_db get_phorizon_from_NASIS_db
Get NCSS Pedon laboratory data from NASISfetchNASISLabData
Get component tables from NASIS Web ReportsfetchNASISWebReport get_chorizon_from_NASISWebReport get_component_from_NASISWebReport get_cosoilmoist_from_NASISWebReport get_legend_from_NASISWebReport get_lmuaoverlap_from_NASISWebReport get_mapunit_from_NASISWebReport get_progress_from_NASISWebReport get_projectmapunit2_from_NASISWebReport get_projectmapunit_from_NASISWebReport get_project_correlation_from_NASISWebReport get_project_from_NASISWebReport get_sitesoilmoist_from_NASISWebReport
Get Official Series Descriptions and summaries from SoilWeb APIfetchOSD
Get a SoilProfileCollection from a PedonPC v.5 databasefetchPedonPC getHzErrorsPedonPC
Get Rapid Carbon Assessment (RaCA) datafetchRaCA
Get Daily Climate Data from USDA-NRCS SCAN (Soil Climate Analysis Network) StationsfetchSCAN SCAN_sensor_metadata SCAN_site_metadata
Get Spatial Data from Soil Data Access by 'mukey', 'nationalmusym' or 'areasymbol'fetchSDA_spatial
Get SoilGrids 2.0 Property Estimates for Points or Spatial ExtentfetchSoilGrids
Fetch Soil Landscapes of the United States (SOLUS) GridsfetchSOLUS
Fetch Soil Inventory Resource (SRI) for USFS Region 6fetchSRI
Get vegetation plot data from local NASIS databasefetchVegdata get_vegplot_from_NASIS_db get_vegplot_groundsurface_from_NASIS_db get_vegplot_location_from_NASIS_db get_vegplot_prodquadrats_from_NASIS_db get_vegplot_speciesbasalarea_from_NASIS get_vegplot_species_from_NASIS_db get_vegplot_textnote_from_NASIS_db get_vegplot_transect_from_NASIS_db get_vegplot_transpecies_from_NASIS_db get_vegplot_transpoints_from_NASIS_db get_vegplot_tree_si_details_from_NASIS_db get_vegplot_tree_si_summary_from_NASIS_db get_vegplot_trhi_from_NASIS_db
Filter KSSL Geochemical Tablefilter_geochem
Format vector of values into a string suitable for an SQL 'IN' statement.format_SQL_in_statement
Get Soil Color Data from a local NASIS Databaseget_colors_from_NASIS_db
Get Soil Color Data from a PedonPC Databaseget_colors_from_pedon_db
Get component month data from a local NASIS Databaseget_comonth_from_NASIS_db
Get component data from a local NASIS Databaseget_component_cogeomorph_data_from_NASIS_db get_component_cogeomorph_data_from_NASIS_db2 get_component_copm_data_from_NASIS_db get_component_correlation_data_from_NASIS_db get_component_data_from_NASIS_db get_component_diaghz_from_NASIS_db get_component_esd_data_from_NASIS_db get_component_horizon_data_from_NASIS_db get_component_otherveg_data_from_NASIS_db get_component_restrictions_from_NASIS_db get_copedon_from_NASIS_db
Get a SoilProfileCollection from a SSURGO file geodatabasefetchGDB get_component_from_GDB get_legend_from_GDB get_mapunit_from_GDB
Get SSURGO/STATSGO2 Mapunit Data from Soil Data AccessfetchSDA get_chorizon_from_SDA get_cointerp_from_SDA get_component_from_SDA get_cosoilmoist_from_SDA get_legend_from_SDA get_lmuaoverlap_from_SDA get_mapunit_from_SDA
Get the Component Soil Moisture Tablesget_cosoilmoist_from_NASIS
Get Site Ecological Site Historyget_ecosite_history_from_NASIS_db
Get Ecological Dynamics Information Tool (EDIT) ecological sites by catalog (ESD/ESG) and MLRAget_EDIT_ecoclass_by_geoUnit
Get accessory tables and summaries from a local NASIS Databaseget_extended_data_from_NASIS_db
Get accessory tables and summaries from a local pedonPC Databaseget_extended_data_from_pedon_db
Get Horizon Data from a local NASIS Databaseget_hz_data_from_NASIS_db
Get Horizon Data from a PedonPC Databaseget_hz_data_from_pedon_db
Get lab pedon layer data from a local NASIS Databaseget_lablayer_data_from_NASIS_db
Get lab pedon data from a local NASIS Databaseget_labpedon_data_from_NASIS_db
Get Legend, Mapunit and Legend Mapunit Area Overlap Tablesget_legend_from_NASIS get_lmuaoverlap_from_NASIS get_mapunit_from_NASIS
Get NASIS Metadata (Domain, Column and Choice Lists)get_NASIS_column_metadata get_NASIS_metadata
Get a NASIS table key by type and table nameget_NASIS_fkey_by_name get_NASIS_pkeyref_by_name get_NASIS_pkey_by_name get_NASIS_table_key_by_name
Get NASIS Table Metadata (Table and Column Descriptions)get_NASIS_table_metadata
Get NASIS 7 Physical Table Namesget_NASIS_table_name_by_purpose
Get Global Historical Climatology Network Daily (GHCND) data from NOAA APIget_NOAA_GHCND
Get NOAA station data near a given latitude and longitudeget_NOAA_stations_nearXY
Get Official Series Description Data from JSON, HTML or TXT sourcesget_OSD get_OSD_JSON
Get pedon horizon roots data from a local NASIS Databaseget_phroots_from_NASIS_db
Get NASIS Project Informationget_projectmapunit_from_NASIS get_projectmilestone_from_NASIS
Get RMF data from local NASISget_RMF_from_NASIS_db
Get mapunit ecological sites from Soil Data Accessget_SDA_coecoclass
Get Geomorphic/Surface Morphometry Data from Soil Data Accessget_SDA_cosurfmorph
Get map unit hydric soils information from Soil Data Accessget_SDA_hydric
Get map unit interpretations from Soil Data Access by rule nameget_SDA_interpretation
Get Soil Data Access, Lab Data Mart and Web Soil Survey Usage Metricsget_SDA_metrics
Get map unit aggregate attribute information from Soil Data Accessget_SDA_muaggatt
Get NASIS Record IDs from Soil Data Accessget_SDA_NASIS_key
Get map unit parent material group information from Soil Data Accessget_SDA_pmgroupname
Get map unit properties from Soil Data Accessget_SDA_property
Get Soil Data Viewer Attribute Informationget_SDV_legend_elements
Get Site Data from a local NASIS Databaseget_site_association_from_NASIS get_site_data_from_NASIS_db
Get Site Data from a PedonPC Databaseget_site_data_from_pedon_db
Get records from the Series Classification (SC) databaseget_competing_soilseries_from_NASIS get_soilseries_from_NASIS get_soilseries_from_NASISWebReport
Get Soil Inventory Resource (SRI) for USFS Region 6get_SRI
Get SRI Layersget_SRI_layers
Get text note data from a local NASIS Databaseget_cotext_from_NASIS_db get_mutext_from_NASIS_db get_text_notes_from_NASIS_db
Get vegetation data from a local NASIS Databaseget_veg_data_from_NASIS_db
Get Vegetation Data from an AK Site Databaseget_veg_from_AK_Site
Get Site and Plot-level Data from a Montana RangeDB databaseget_veg_from_MT_veg_db
Get Vegetation Data from an NPS PLOTS Databaseget_veg_from_NPS_PLOTS_db
Get cover composition data from a Montana RangeDB databaseget_veg_other_from_MT_veg_db
Get species-level Data from a Montana RangeDB databaseget_veg_species_from_MT_veg_db
Get Logic Errors in NASIS/PedonPC Pedon HorizongetHzErrorsNASIS
Get 800m gridded soil properties from SoilWeb ISSR800 Web Coverage Service (WCS)ISSR800.wcs
Develop a Water Retention Curve from KSSL DataKSSL_VG_model
Example 'SoilProfilecollection' Objects Returned by 'fetchNASIS'.gopheridge loafercreek mineralKing
Check for presence of 'nasis_local' ODBC data sourcelocal_NASIS_defined
Make Ecological Dynamics Interpretive Tool (EDIT) web services URLmake_EDIT_service_URL
Generate chunk labels for splitting datamakeChunks
NASIS 7 Metadatametadata
Get Map Unit Key ('mukey') grid from SoilWeb Web Coverage Service (WCS)mukey.wcs
NASIS 7 Tables, Columns and Foreign KeysNASIS_table_column_keys
Work with NASIS Choice ListsNASISChoiceList
Get/Set Options for Encoding NASIS Domains as FactorsNASISDomainsAsFactor
NASIS Local DatabaseNASISLocalDatabase
Search full text of Official Series Description on SoilWebOSDquery
Parse contents of a web report, based on supplied arguments.parseWebReport
Post-process Well-Known Text from Soil Data AccessprocessSDA_WKT
Query USDA-ARS ROSETTA Model APIROSETTA
USDA-NRCS Station Metadata for SCAN, CSCAN, SNOTEL, SNOWLITE NetworksSCAN_SNOTEL_metadata state_FIPS_codes
Query Soil Data AccessSDA_query
Query Soil Data Access by spatial intersection with supplied geometrySDA_spatialQuery
Retrieve Soil Series Extent Maps from SoilWebseriesExtent
Get "siblings" and "cousins" for a given soil seriessiblings
Simplify Coarse Fraction DatasimplifyArtifactData simplifyFragmentData
Simplify Color Data by IDsimplifyColorData
Access gridded soil color data from the SoilWeb Web Coverage Service (WCS)soilColor.wcs
Get soilDB User Directory PathsoilDB_user_dir
Get the soilDB environment used for storing error messages and quality control outputget_soilDB_env soilDB.env
Get SSURGO Data via Spatial QuerySoilWeb_spatial_query
Graphical Description of US Soil Taxonomy Soil Temperature RegimesSTRplot
Get data from Henry Mount Soil Temperature and Water DatabasefetchHenry month2season summarizeSoilTemperature
Soil Taxonomy Grids via SoilWebtaxaExtent
Convert coded values returned from NASIS and SDA queries into human-readable valuescode uncode
Timeline of US Published Soil Surveysus_ss_timeline
Compute Water Day and YearwaterDayYear
Web Coverage Services DetailsWCS_details