NLDI Flowtools
Version: 0.3.8
Basin delineation and flow path tracing for any point within CONUS, powered by NHDPlus V2 data and the Network Linked Data Index.
from nldi_flowtools.nldi_flowtools import splitcatchment, flowtrace
# Delineate the full upstream drainage basin
basin = splitcatchment(lon=-93.0, lat=45.0, upstream=True, simplified=True)
# Trace the flow path to the nearest stream
trace = flowtrace(lon=-93.0, lat=45.0, direction="down")
Both functions accept WGS 84 longitude/latitude coordinates and return GeoJSON FeatureCollections.
Tools
Split Catchment — Identifies the NHD catchment containing a point and delineates the upstream contributing area. Can return either the local split portion or the full upstream drainage basin merged with all upstream catchments.
Flow Trace — Follows the 30m flow direction grid downhill from a point until it intersects an NHD stream. Returns the traced raindrop path and the intersected stream segment (upstream, downstream, or full geometry).
Tip
When delineating a point on a stream, run it through flowtrace first to
snap the point to the flowline. Use the returned intersection point as input
to splitcatchment for the most accurate basin boundary.
Installation
pip install nldi-flowtools
Requirements: Python 3.10 – 3.14.
For development setup, see the Contributor Guide.
Acknowledgments
Hydrologic delineations use an algorithm borrowed from SS-Delineate.
Developed in collaboration with @rmcd’s NLDI XStools.
Cloud-optimized flow direction raster hosted by @dblodgett.