Skip to content

Instantly share code, notes, and snippets.

View mheberger's full-sized avatar

Matthew Heberger mheberger

View GitHub Profile
@mheberger
mheberger / get_watersheds_mghydro.ipynb
Last active March 3, 2025 15:18
Demo using Python to download and save watershed boundaries and rivers geodata via the mghydro.com Global Watersheds web app API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mheberger
mheberger / watersheds_usgs.py
Last active June 27, 2025 01:42
Python script for delineating watersheds in the continental United States with the USGS NLDI API
"""
# Demo of watershed delineation in the US using the the Python library pynhd and
data and methods from the USGS
Revision #1, incorporating feedback from Taher Chegini, email of 2022-11-21.
Revision #2, 2025-02-23, updating the new URLs of the USGS API, the NLDI.
Revision #3, 2025-06-11, making it work with updated versions of libraries.
This demo shows you how to use Python to find the watershed for any point in the
continental United States. We'lluse a new water data service created by the US