Check criteria to classify your soil

About This Application

Digital Keys to Soil Taxonomy is an interactive, offline-first Progressive Web App for USDA soil classification following the Keys to Soil Taxonomy (13th Edition, 2022).

The application guides you through the official USDA dichotomous key by progressively revealing classification criteria. Check the criteria that match your soil properties, and the app determines the taxonomic classification: Order → Suborder → Great Group → Subgroup.

No internet connection is required after the first visit. The entire application — code, data, and glossary — is cached locally by the Service Worker.

Data Summary

This dataset includes decision criteria organized across the USDA soil taxonomy hierarchy:

The glossary includes soil taxonomy terms — diagnostic quantities, features, properties, and related concepts used in the taxonomic system.

JSON Data Schema v1.0.0

The application is powered by data/dst-data.json, a ~3.5 MB file generated from USDA source data. The file contains five top-level sections:

SectionDescription
navigation.criteriaArray of decision criteria with clause hierarchy, AND/OR logic, and pre-linkified glossary terms
outcomesObject keyed by taxonomic code — each is a classification result (depth -1)
glossaryObject keyed by term ID — soil science terms with definitions
order_namesSingle-letter code → Order name (e.g., A → Gelisols)
code_namesFull code → taxon name at all levels (e.g., AA → Histels)

Criterion Fields

FieldTypeDescription
critstringHierarchical code (A–L Orders, AA–LL Suborders, AAA+ deeper)
clausenumberNumeric clause ID within the group
parent_clausenumber|""Parent clause reference (empty for roots)
logicstringOR or AND — how this node's children relate
depthnumber0=Order, 1=Suborder, 2=Great Group, 3=Subgroup
contentstringPlain text criterion description
content_htmlstringContent with glossary terms pre-linkified

DSTCore Engine

scripts/dst-core.js is a standalone, framework-agnostic logic engine with no DOM dependencies. It works identically in the browser (window.DSTCore) and Node.js (require()).

Satisfaction Algorithm

Each parent criterion's logic field determines how its children are evaluated:

  • AND — ALL children must be satisfied
  • OR — at least ONE child must be satisfied
  • Leaf nodes (no children) — satisfied when checked by the user

Evaluation is recursive with per-mutation cache invalidation.

Key API Methods

MethodReturnsDescription
DSTCore.create(data)engineCreate engine instance from parsed JSON
engine.check(id)Check a criterion (auto-invalidates caches)
engine.toggle(id)Toggle check state
engine.reset()Clear all checks
engine.isClauseSatisfied(c)booleanRecursive satisfaction check (cached)
engine.isGroupSatisfied(code)booleanIs an entire taxonomic group satisfied?
engine.getVisibleGroups()arrayGroups to display at current level
engine.getClassificationPath()arrayCurrent taxonomy path (Order → Subgroup)
engine.getCurrentClassification()stringName of deepest satisfied taxon
engine.onChange(fn)unsubscribeRegister state change listener

Technology Stack

Frontend: Alpine.js v3.13.3 (loaded via CDN), CSS with custom properties for light/dark theming

Engine: Standalone JavaScript logic engine (scripts/dst-core.js) with no dependencies. Works identically in browser and Node.js.

Data: Python preprocessing pipeline generates optimized JSON from USDA source files. Service Worker enables offline-first caching.

Testing: Custom test harness with Node.js and browser execution modes.

Resources

Source & License

Loading criteria...