oxscape

Crates.iooxscape
lib.rsoxscape
version0.1.1
created_at2025-12-31 11:48:27.739618+00
updated_at2025-12-31 22:35:20.857016+00
descriptionOxscape enables parallel flow graph (D8, Dinf) traversal in Digital Elevation Models
homepagehttps://codeberg.org/feefladder/oxscape/
repositoryhttps://codeberg.org/feefladder/oxscape/
max_upload_size
id2014519
size59,501
Fee Fladder (feefladder)

documentation

README

Oxscape

An Ox pulling the word "oxscape" left over soil that is (left-to-right) tilled, mulched and grows grass.

Oxscape (oxidized FastScape) is rust port and abstraction of Barnes' parallel flow graph traversal algorithm (2019) DOI. Oxscape is the ox that pulls your landscape evolution models.

use oxscape::GridMeta;
use oxscape::order_sflow::{Order, D8};

let dem: Vec<f64> = (0..1000*1000).iter().map(|v| f64::from(v)).collect()
let order = Order::from_dem_metric(GridMeta::new(1000,1000), &dem, D8);

// write your own algorithms
pub fn accum(order: &Order, cell_area: f64, accum: &mut [f64]) {
    accum.fill(cell_area);
    order.for_lvls_top_down(accum, |a| {
        *a.cell() += a.donors().iter().sum::<f64>();
    });
}

let mut flow_accumulation = vec![0.0;order.meta().size();]
// compute flow accumulation
accum(&order, 10_000.0, &mut flow_accumulation);

references

Barnes, R. (2019). Accelerating a fluvial incision and landscape evolution model with parallelism. Geomorphology, 330, 28–39. https://doi.org/10.1016/j.geomorph.2019.01.002

Commit count: 0

cargo fmt