Skip to content

VeinsOfTheEarth/RivGraph

Repository files navigation

DOI tests docs

RivGraph logo

RivGraph

RivGraph is a Python package for converting a binary mask of a channel network into a directed, weighted graph of connected links and nodes. It is designed for river and delta channel networks derived from remote sensing imagery and geospatial masks.

Core functionality of RivGraph

Core capabilities

  • morphologic metrics such as widths, lengths, and branching characteristics
  • graph-based and algebraic representations of channel networks
  • topologic and dynamic metrics such as alternative paths, flux sharing, and entropy-based measures
  • tools for cleaning and preparing binary channel masks
  • island detection, metrics, and filtering
  • mesh generation for along-river analysis
  • geospatial export of links, nodes, rasters, and derived products

RivGraph preserves georeferencing information throughout the workflow. If you start with a georeferenced mask, exported rasters and vectors remain aligned with the source data and can be used directly in GIS workflows.

The flow-directionality logic and validation are described in our ESurf Dynamics paper. General package usage is described in our JOSS paper.

Getting started

Start with the documentation and the notebooks in examples/. RivGraph contains two primary classes, delta and river, that organize the main processing workflows. These notebooks show the end-to-end usage patterns:

  • examples/delta_example.ipynb
  • examples/braided_river_example.ipynb
  • examples/mouse_brain_example.ipynb

Use of AI

RivGraph was initially released before the advent of LLMs and thus v0.5.0 was written entirely without AI assistance. However, the v1.0 release was made possible through efficiencies provided by relying heavily on AI coding (mainly OpenAI tools).

Contributing

Bug reports, documentation improvements, and pull requests are welcome. The easiest way to start is to open an issue in the tracker.

Citing RivGraph

If you use RivGraph in your research, please consider citing it.

If you use RivGraph's flow-directionality algorithms, please cite our ESurf Dynamics paper.

If you use RivGraph's flux paritioning scheme that asssumes steady-state, width-weighted fluxes at junctions, you should be aware of this work.

License

RivGraph is distributed under the BSD 3-clause license.

About

Extracting and quantifying graphical representations of river and delta channel networks from binary masks

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors