Skip to main content

U.S. National Hydrography Dataset Network & Barrier Analysis Tools

Build Status Coverage Status

This library was used to help perform network connectivity analysis for the Southeast Aquatic Barrier Prioritization Tool. See https://github.com/astutespruce/sarp-connectivity for more information about specific processing for that project.

This library is intended to provide more general processing utilities to assist with analyzing connectivity using the National Hydrography Dataset (NHD) - High Resolution Plus version.

We do not currently intend to add support for the NHD - Medium Resolution dataset. Pull requests are welcome to add this functionality.

Due to the large size of NHD data, it may be possible to only process a single region at a time, or a group of regions. The key limits are based on the amount of available memory (RAM) and the file sizes of the outputs (shapefiles are limited to 2 GB in size).

Key features:

  • preprocessing utilities to prepare NHD data for analysis within this library
  • merging of NHD flowlines between adjacent basins or regions
  • automatic snapping barriers to nearest flowlines, including heuristics to aid with manual QA/QC
  • cutting of NHD flowlines at barriers
  • construction of functional upstream networks from a barrier to the next upstream barriers or origins of a stream network
  • network statistics
  • optimized data I/O using the feather file format for intermediate data products and customized serialization / deserialization of spatial data

Notes:

  • reading / writing shapefiles using Geopandas can be very slow. We preferred to use the feather format for intermediate files (geofeather provides spatial compatibility).
  • data from NHD are downloaded as ArcGIS File Geodatabases. While these formats can be read (usually) using Geopandas, it is not possible to write this format, so shapefile outputs are generally the only option for use in GIS.

Installation

pip install nhdnet

This project uses GeoPandas, Pandas, rtree, and shapely in Python 3.6+.

We do not intend to support Python < 3.6.

Due to the complexity of these libraries, installation instructions for your platform may vary from the following.

rtree first requires the separate installation of libspatialindex. On MacOS:

brew install spatialindex

Python dependencies and virtual environment are managed using pipenv.

pipenv install

If you do not wish to use pipenv, see the Pipfile for the list of dependencies.

Source Data

NHD High Resolution data are downloaded by HUC4 from NHD Data Distribution Site.

Development

This project uses black for autoformatting and pylint for linting.

Notes

Known issues:

Credits

This project was made possible in partnership with the Southeast Aquatic Resources Partnership as part of a larger project to develop a comprehensive inventory of aquatic barriers in the Southeastern US and assess impacts of these barriers on aquatic systems.

The results of this project are available in the Southeast Aquatic Barrier Prioritization Tool.

Metadata

Release files for nhdnet 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nhdnet 0.2.0
File Size Uploaded
nhdnet-0.2.0.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nhdnet 0.2.0
File Interpreter ABI Platform
nhdnet-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.4 kB

Release files / nhdnet-0.2.0.tar.gz

Download URL nhdnet-0.2.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c9e845c4533bb4919c4191c4aed899fbf22b2492630a2514dbba31fece3e25fb
BLAKE2b-256 checksum
How to use checksums
7834fa81ee808b5b96ddfba34e780bcebff84c2664923f1e4a2ff01091d66f2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / nhdnet-0.2.0-py3-none-any.whl

Download URL nhdnet-0.2.0-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6144496c1534247b088a8eca7a6a5a4cb8920b6c332529de59bce89faf04f9f9
BLAKE2b-256 checksum
How to use checksums
4a8bfbaa4523c92de17d323630c58850bd58f858076db7ef2acd1f60ef321336
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page