pub struct CatchmentUnit { /* private fields */ }Expand description
A single drainage unit in an HFX dataset.
Every field is validated at construction time via the primitive newtypes
(UnitId, Level, AreaKm2, OutletCoord, BoundingBox,
WkbGeometry); CatchmentUnit
itself performs no additional validation.
Implementations§
Source§impl CatchmentUnit
impl CatchmentUnit
Sourcepub fn new(
id: UnitId,
level: Level,
parent_id: Option<UnitId>,
area: AreaKm2,
upstream_area: Option<AreaKm2>,
outlet: OutletCoord,
bbox: BoundingBox,
geometry: WkbGeometry,
source_id: Option<String>,
level_label: Option<String>,
) -> Self
pub fn new( id: UnitId, level: Level, parent_id: Option<UnitId>, area: AreaKm2, upstream_area: Option<AreaKm2>, outlet: OutletCoord, bbox: BoundingBox, geometry: WkbGeometry, source_id: Option<String>, level_label: Option<String>, ) -> Self
Construct a CatchmentUnit from its constituent validated fields.
All arguments are already domain-typed, so no further validation is performed here — invalid states are unrepresentable by construction.
Sourcepub fn upstream_area(&self) -> Option<AreaKm2>
pub fn upstream_area(&self) -> Option<AreaKm2>
Return the total upstream contributing area in km², if known.
None indicates the value is absent in the source hydrofabric.
Sourcepub fn outlet(&self) -> OutletCoord
pub fn outlet(&self) -> OutletCoord
Return the unit outlet coordinate.
Sourcepub fn bbox(&self) -> &BoundingBox
pub fn bbox(&self) -> &BoundingBox
Return a reference to the axis-aligned bounding box of the catchment.
Sourcepub fn geometry(&self) -> &WkbGeometry
pub fn geometry(&self) -> &WkbGeometry
Return a reference to the WKB geometry of the catchment polygon.
Sourcepub fn level_label(&self) -> Option<&str>
pub fn level_label(&self) -> Option<&str>
Return the optional source-fabric level label.
Trait Implementations§
Source§impl Clone for CatchmentUnit
impl Clone for CatchmentUnit
Source§fn clone(&self) -> CatchmentUnit
fn clone(&self) -> CatchmentUnit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CatchmentUnit
impl Debug for CatchmentUnit
Source§impl HasBbox for CatchmentUnit
impl HasBbox for CatchmentUnit
Source§fn bbox(&self) -> &BoundingBox
fn bbox(&self) -> &BoundingBox
Source§impl HasUnitId for CatchmentUnit
impl HasUnitId for CatchmentUnit
Source§impl PartialEq for CatchmentUnit
impl PartialEq for CatchmentUnit
Source§fn eq(&self, other: &CatchmentUnit) -> bool
fn eq(&self, other: &CatchmentUnit) -> bool
self and other values to be equal, and is used by ==.