Where to Cut? Partitioning Branching Shapes in River Floodplains
2026-11-03 , Compagno

Although branching shapes appear frequently in nature, effective partitioning of these shapes remains hard. Our open-source python package, ramify, partitions binary masks into labeled branches by stream order. The resulting partitions provide a foundational layer for characterizing the shape.


Many naturally occurring fluvial landscape features, such as river deltas, floodplains, and valley floors appear as branching shapes in GIS data. These shapes are usually characterized by their centerlines (the medial axis), which capture properties like length, width, and branch count, but say little about the area each branch actually covers. Centerlines also make it hard to assign properties to things inside that branched shape: if a river runs through a floodplain, what is the floodplain's width at that river?

A general solution to this problem is to apply Voronoi partitioning to the space, assigning pixels to the nearest centerline in Euclidean space. While this efficiently segments the space, it fails to realistically represent the actual structure that we want to preserve. Where a tributary crosses the mainstems floodplain it claims the pixels adjacent to it, which arbitrarily narrows the mainstem's floodplain at the confluence. In practice this is avoided using heuristics for detecting junctions and filtering out minor branches, but this preprocessing is hard to automate.

In this talk, we present our novel free and open-source method, a python package called ramify, that solves this problem in branching shapes. We start with a toy example: pruning the branches on a tree and use this example to build an intuition about the method: what assumptions does it make about the problem? What is an ideal solution? and what are the limitations? Then, we apply the method to the analysis of river floodplains. We work through the method step by step and finally demonstrate how the partitioned floodplain can be analyzed.

The first step of the algorithm is to identify the centerlines of the shape and constrain those centerlines to known branch tips; in the floodplain example these are the channel heads. We derive the centerlines by applying a computer vision based skeletonization method of iterative thinning of the shape. Then we trace paths from each of the branch tips to and through the centerline segments. We build a graph from the paths, identifying all junctions and reconstructing the topology.

With this graph we can assign stream order labels and apply a mainstem ordering algorithms which results in an ordered set of all the unique paths through the network ordered by the number of upstream branches. For each path we then claim space within the shape by growing a region outward from the path centerline segments up to a max distance set by the centerline’s distance to the nearest boundary. We repeat this step for each path in the ordered list, enforcing that already claimed pixels are not overwritten. This results in a full partitioning of the space to each centerline.

Our case study is composed of a set of coalescing rivers and their floodplains (delineated from relative elevation model analysis). We apply our method to the floodplain mask partitioning the space into distinct floodplain segments. We then compute the widths and elevation range of each segment. Finally, we demonstrate how these computed widths can be assigned to the reaches of the stream network an important feature of flood risk analysis.


Topics: Select 1–3 areas of interest that best describe your proposal.: Disaster Response & Resilience, Environment, Climate & Sustainability, Raster & Remote Sensing