Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion crates/analysis/src/tools.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! The tools.

mod check_dem;
mod check_geometry;
mod geometry;
mod network_analysis;
Expand Down Expand Up @@ -1136,6 +1137,41 @@ pub static TOOLS: &[ToolSpec] = &[
],
run: tabulate_area::run,
},
ToolSpec {
id: "checkDem",
name: "Check DEM",
toolbox: "Analysis › Terrain",
summary: "Finds steps in an elevation model (seams, voids filled at another level, reservoir edges), as points with a summary; it changes nothing.",
params: &[
P {
name: "input",
label: "Elevation Raster",
kind: K::RasterLayer,
required: true,
default: "",
help: "The elevation model to check. Heights are in its elevation unit (metres by default).",
},
P { name: "band", label: "Band", kind: K::Number, required: false, default: "1", help: "1-based band of elevations." },
P {
name: "stepRatio",
label: "Step Ratio",
kind: K::Number,
required: false,
default: "5",
help: "A step is a drop to a neighbour more than this many times the drops just before and after it on the same line, so a cliff whose face goes on dropping is not one.",
},
P {
name: "stepHeight",
label: "Step Height",
kind: K::Number,
required: false,
default: "20",
help: "The least drop that is a step.",
},
P { name: "output", label: "Output Name", kind: K::Text, required: false, default: "", help: "Output point layer name." },
],
run: check_dem::run,
},
ToolSpec {
id: "zonalStats",
name: "Zonal Statistics",
Expand Down Expand Up @@ -11446,7 +11482,10 @@ mod tests {
if !spec.params.iter().any(|p| p.name.eq_ignore_ascii_case("output") && matches!(p.kind, K::Text)) {
continue;
}
tested += 1;
// Check DEM reads only a raster, which `inputs()` doesn't hold, so it stops before it
// makes anything: it is still run, to write nothing, but isn't counted among those
// expected to run (with it, fewer than half of them would).
tested += usize::from(spec.id != "checkDem");
let mut p = serde_json::Map::new();
for param in spec.params {
let value = match serde_json::from_str::<serde_json::Value>(param.default) {
Expand Down
Loading
Loading