NLDI XSTools
Version: 0.13.0
Generate topographic cross-sections for any point within CONUS using NHDPlus V2 data, the Network Linked Data Index (NLDI), and the 3D Elevation Program (3DEP).
from nldi_xstool.nldi_xstool import getxsatpoint, getxsatendpts, getxsatpathpts
# Cross-section at a point, snapped to the nearest NHD stream segment
xs = getxsatpoint(point=(-103.8011, 40.2684), numpoints=100, width=1000.0)
# Cross-section between two user-defined endpoints
xs = getxsatendpts(path=[(-103.801134, 40.267335), (-103.800787, 40.272798)], numpts=100)
All functions accept WGS 84 longitude/latitude coordinates and return GeoDataFrames with GeoJSON output support.
Tools
Cross-Section at Point (xsatpoint) — Snaps a point to the nearest NHD stream
segment via the NLDI, then generates a perpendicular topographic cross-section using
3DEP elevation data. Configurable width, number of points, and DEM resolution.
Cross-Section at Endpoints (xsatendpts) — Generates a topographic cross-section
between two user-defined endpoints using 3DEP elevation data. No stream snapping is
performed.
Cross-Section at Path (xsatpathpts) — Generates a topographic cross-section
along a user-defined path of coordinate pairs using 3DEP elevation data.
Tip
3DEP does not specifically include bathymetry. For measured bathymetric
cross-sections, see the ExtADCPBathy class in the modules documentation.
Installation
pip install nldi-xstool
Or with uv:
uv add nldi-xstool
Requirements: Python 3.10 – 3.14.
For development setup, see the Contributing.
Acknowledgments
Cross-section generation powered by py3dep, pynhd, and pygeohydro from the HyRiver suite.
Developed in collaboration with @ahopkins’s NLDI Flowtools.
Also available as a pygeoapi process plugin.
This project was generated from @hillc-usgs’s Pygeoapi Plugin Cookiecutter.