oxigdal_terrain/lib.rs
1//! Advanced terrain analysis and DEM processing for OxiGDAL.
2//!
3//! This crate provides comprehensive terrain analysis capabilities including:
4//! - **Derivatives**: slope, aspect, curvature, hillshade, TPI, TRI, roughness
5//! - **Hydrology**: flow direction, flow accumulation, watershed delineation, stream networks
6//! - **Visibility**: viewshed analysis, line of sight
7//! - **Geomorphometry**: landform classification, convergence, openness
8//!
9//! # Features
10//!
11//! - `derivatives`: Terrain derivatives (slope, aspect, etc.)
12//! - `hydrology`: Hydrological analysis
13//! - `visibility`: Viewshed and line of sight
14//! - `geomorphometry`: Landform classification
15//! - `parallel`: Parallel processing with Rayon
16//!
17//! # Examples
18//!
19//! ```rust,ignore
20//! use oxigdal_terrain::derivatives::{slope_horn, SlopeUnits};
21//! use scirs2_core::prelude::*;
22//!
23//! let dem = Array2::from_elem((100, 100), 100.0_f32);
24//! let slope = slope_horn(&dem, 10.0, SlopeUnits::Degrees, None)?;
25//! ```
26//!
27//! # Performance
28//!
29//! Most algorithms support optional parallelization through the `parallel` feature.
30//! For large DEMs, consider using parallel variants for improved performance.
31
32#![cfg_attr(not(feature = "std"), no_std)]
33#![warn(missing_docs)]
34
35pub mod error;
36
37#[cfg(feature = "derivatives")]
38pub mod derivatives;
39
40#[cfg(feature = "hydrology")]
41pub mod hydrology;
42
43#[cfg(feature = "visibility")]
44pub mod visibility;
45
46#[cfg(feature = "geomorphometry")]
47pub mod geomorphometry;
48
49// Re-exports
50pub use error::{Result, TerrainError};
51
52#[cfg(feature = "derivatives")]
53pub use derivatives::{
54 AspectAlgorithm, CurvatureType, HillshadeAlgorithm, RoughnessMethod, SlopeAlgorithm,
55 SlopeUnits, aspect, curvature, hillshade, roughness, slope, tpi, tri,
56};
57
58#[cfg(feature = "hydrology")]
59pub use hydrology::{
60 FlowAlgorithm, extract_streams, fill_sinks, flow_accumulation, flow_direction,
61 watershed_from_point,
62};
63
64#[cfg(feature = "visibility")]
65pub use visibility::{line_of_sight, viewshed_binary, viewshed_cumulative};
66
67#[cfg(feature = "geomorphometry")]
68pub use geomorphometry::{
69 LandformClass, classify_iwahashi_pike, classify_weiss, convergence_index, negative_openness,
70 positive_openness,
71};