Skip to content

rivabar

tests

rivabar is a Python package that automatically extracts channel centerlines and banklines from water index images of rivers. The focus is on getting good representations of the banklines, as centerlines are not physical features and how they are exactly derived is subjective. This is achieved in part by viewing channels as boundaries between polygons that correspond to islands or bars, which allows us to take advantage of algorithms developed for spatial analysis. In this view, even a single-thread channel becomes the boundary between two land domains.

rivabar can be used to map single-thread and multithread rivers, in an almost entirely automated fashion. It requires a water mask as input and a start (source) and an end (sink) point for the channel / channel belt / delta.

Capabilities

  • Centerline and bankline extraction from Landsat or PlanetScope imagery or pre-computed water masks, for single-thread and multithread rivers — see Getting started
  • Channel morphology: widths along the channel, curvature, wavelength analysis, sinuosity
  • Multi-temporal analysis: tributary detection, splitting rivers at persistent confluences, matching segments across scenes, deposition/erosion mapping — see Multi-temporal analysis
  • Curvature–migration analysis: DTW-based migration rate measurement between scenes and pair classification
  • Migration prediction: calibration and forward prediction with the Howard & Knutson (1984) model, including spatially-varying erodibility — see Migration prediction
  • Animations: river evolution movies from batch-processed scenes — see Animations

rivabar relies on networkx for graphs, sknw for skeleton-to-graph conversion, libpysal for neighborhood relations between banks and islands, and momepy for clean centerline graphs, among others.

Installation

pip install rivabar

Or from source:

git clone https://github.com/zsylvester/rivabar.git
cd rivabar
pip install -e .

License

MIT — see the LICENSE file.