A Python package to automatically extract channel centerlines and banklines from water index images of rivers
Project description
rivabar
Description
rivabar is a Python package that aims to automatically extract 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, as this
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 relies on the following Python packages, among others:
- networkx to work with graphs
- sknw for converting the channel skeleton into a graph
- Python Spatial Analysis Library (libpysal) to get neighborhood relations between banks / islands
- Urban Morphology Measuring Toolkit (momepy) to create clean centerline graphs
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 end (sink) points for the channel / channel belt / delta.
The images below illustrate how rivabar extracts both centerlines and banklines from a Landsat image of the Brahmaputra River, and creates
an island neighborhood graph in addition to the centerline graph.
Brahmaputra River - water index
Rook graph and centerline polygons
Centerline graph and bar polygons
Installation
You can install rivabar directly from PyPI:
pip install rivabar
Alternatively, you can install from source:
git clone https://github.com/zsylvester/rivabar.git
cd rivabar
pip install -e .
Getting started
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 rivabar-0.1.0.tar.gz.
File metadata
- Download URL: rivabar-0.1.0.tar.gz
- Upload date:
- Size: 50.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9d3711e759d1ccdf5cfea6c13f2fa6bfe14d1ba45c4795d1ffa5f5259bafb3a
|
|
| MD5 |
407b3322346c78973f82440481b1cc23
|
|
| BLAKE2b-256 |
2e0b715548c48cd4b86f3c4a3063f10a6a4ed05fe5e05beb00f44968b1ce9a57
|
File details
Details for the file rivabar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rivabar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 48.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
686816c694065ad9b5cb035ec84576ea5cc999064d2547a13593b2555404b799
|
|
| MD5 |
7a27abd19b8ca8709ff0fd5cd512dbe8
|
|
| BLAKE2b-256 |
4c5364697cf7dc8a2a0a0b8bac80a08feadd32d7d043a7038dd8f1a34da16ef4
|