FlowDivide computes hydrographic attributes on D8 grids larger than memory by cutting them into connected regions.
FD1 partitions the grid; FD2 makes views; FD3 computes attributes region by region.
The Amazon is cut and merged into 11 regions, numbered so every flow goes to a larger number.
git clone https://github.com/hellolulujiang/flowdivide.git
cd flowdivide
conda create -n flowdivide -c conda-forge python=3.11 numpy numba rasterio gdal pandas geopandas pyogrio pyarrow shapely scipy matplotlib
conda activate flowdivideSet the input paths as described in Running, then:
python flowdivide.py run south-america --out-root out
python flowdivide.py run south-america --out-root out --steps fd3 --capacity 2^31Each region fits the chosen capacity. One value crosses each cut; results match a whole-grid run pixel for pixel.
User guide: inputs, options, outputs, memory, checks and custom attributes.
FullDivide partitions: HydroSHEDS v2.0, 30 m over North and South America; MERIT Hydro, 90 m globally.
Jiang, L., Chen, W. FlowDivide: a standard workflow for hydrographic attributes from flow-direction grids that outgrow a computer's memory. Submitted to Environmental Modelling & Software.
Cite this repository with the release used. Paper figures and archive.
MIT; see LICENSE. Input data retain their producers' terms; see DATA_NOTICE.md.

