This is a river join implementation in Python.
Project description
Framework for Spatially Joining Two Hydrofabric Flowlines
riverjoin- Hydrofabric Flowlines Join Tool
Background
Hydrofabric datasets from different sources (NWM, SWORD, GeoGLOWS, MERIT, GRIT) often represent the same river network but with different segmentation, attributes, and topologies. RiverJoin enables users to spatially join these datasets — transferring attributes, detecting bifurcations, tracing downstream networks, and resolving mismatches between flowline geometries — providing a unified representation for cross-framework hydrological analysis.
Package Structure
riverjoin_py/
├── docs/
│ └── riverjoin_docs.ipynb # Detailed documentation and usage examples
├── images/
│ └── Flowchart_SpatialJoin.png # Framework workflow diagram
├── src/
│ └── riverjoin/
│ ├── combined_workflow.py # End-to-end combined join pipeline
│ ├── utilis.py # Shared utility functions
│ └── modules/
│ ├── attribute_transfer.py # Transfer attributes between flowlines
│ ├── bifurcation_detector.py # Detect river bifurcations
│ ├── compare_linelength.py # Compare segment line lengths
│ ├── flowlines_buffer.py # Buffer-based spatial matching
│ ├── interactive_map.py # Interactive map visualization
│ ├── perpendicularlines.py # Generate perpendicular cross-sections
│ ├── project_initialization.py # Project setup and configuration
│ ├── setup_hydrofabric.py # Hydrofabric data preparation
│ ├── situation_checker.py # Geometry situation classification
│ ├── traced_downstream.py # Downstream network tracing
│ └── traced_downstream_trace_bifurcation.py # Downstream tracing with bifurcation handling
└── tests/ # Test cases for all modules
Installation and Usage
We recommend using a virtual environment to avoid dependency conflicts. Though it only depends on few light weight Python libraries.
Using conda
conda create --name riverjoin python==3.10
conda activate riverjoin
Using venv
python -m venv riverjoin
# macOS/Linux
source riverjoin/bin/activate
# Windows
riverjoin\Scripts\activate
Install the package
pip install uv
uv pip install riverjoin
# OR
pip install riverjoin
For detail usage, refer to the riverjoin_docs.ipynb.
Citating This Tool
Chen, Y., Cohen, S., Baruah, A. et al. Merging Remote Sensing Derived River Slope Datasets with High-Resolution Hydrofabrics for the United States. Sci Data 12, 1657 (2025). https://doi.org/10.1038/s41597-025-05941-6
Contributing
We welcome contributions. See CONTRIBUTING.md for more details.
Acknowledgements
| Funding for this project was provided by the National Oceanic & Atmospheric Administration (NOAA), awarded to the Cooperative Institute for Research to Operations in Hydrology (CIROH) through the NOAA Cooperative Agreement with The University of Alabama (NA22NWS4320003). |
For More Information
Dr. Sagy Cohen (sagy.cohen@ua.edu), Dr. Yixian Chen (ychen223@ua.edu), Supath Dhital (sdhital@ua.edu)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file riverjoin-0.1.10.tar.gz.
File metadata
- Download URL: riverjoin-0.1.10.tar.gz
- Upload date:
- Size: 35.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e13071e2bf69a2602d8a6bd0e09f521912d9fedbe7b82ace8a4cf8bc4e857b78
|
|
| MD5 |
cc5c0a774874c36f0dd037786946fd3e
|
|
| BLAKE2b-256 |
41309e18183e47e03801a6f21496a39c1891b48fc61dd4059459646285ff7d26
|
File details
Details for the file riverjoin-0.1.10-py3-none-any.whl.
File metadata
- Download URL: riverjoin-0.1.10-py3-none-any.whl
- Upload date:
- Size: 42.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ab11497050c724c6147658a0d8b2f477f0ef4003e356c527ed0f0de8fe4a06c
|
|
| MD5 |
d3544c24c03c8ad9d7d6278236dc5104
|
|
| BLAKE2b-256 |
dd5299618df900656723bff46f4b98480a556259eafb9442754db25592632a00
|