pub struct De9im { /* private fields */ }Expand description
A DE-9IM (Dimensionally Extended 9-Intersection Model) matrix.
The nine cells are stored in row-major order:
[II, IB, IE, BI, BB, BE, EI, EB, EE]where I = Interior, B = Boundary, E = Exterior,
and the first letter refers to geometry a, the second to geometry b.
Implementations§
Source§impl De9im
impl De9im
Sourcepub const fn new(cells: [Dimension; 9]) -> Self
pub const fn new(cells: [Dimension; 9]) -> Self
Create a matrix from an explicit 9-element array.
Sourcepub fn from_str(s: &str) -> Result<Self>
pub fn from_str(s: &str) -> Result<Self>
Parse a 9-character DE-9IM string such as "212101212".
Sourcepub fn to_string_repr(&self) -> String
pub fn to_string_repr(&self) -> String
Return the 9-character string form (e.g. "212101212").
Sourcepub fn matches(&self, pattern: &str) -> bool
pub fn matches(&self, pattern: &str) -> bool
Test whether this matrix matches a 9-character pattern string.
Pattern characters: T (non-empty), F (empty), * (any),
0 (Point), 1 (Line), 2 (Area).
Sourcepub fn is_equals(&self) -> bool
pub fn is_equals(&self) -> bool
OGC Equals: T*F**FFF*
Two geometries are topologically equal when their interiors intersect and no part of either geometry lies in the exterior of the other.
Sourcepub fn is_disjoint(&self) -> bool
pub fn is_disjoint(&self) -> bool
OGC Disjoint: FF*FF****
Two geometries are disjoint when they share no points in common.
Sourcepub fn is_intersects(&self) -> bool
pub fn is_intersects(&self) -> bool
OGC Intersects: NOT Disjoint.
Sourcepub fn is_touches(&self) -> bool
pub fn is_touches(&self) -> bool
OGC Touches: the geometries share boundary but not interior.
Matches FT******* OR F**T***** OR F***T****.
Sourcepub fn is_crosses(&self, dim_a: u8, dim_b: u8) -> bool
pub fn is_crosses(&self, dim_a: u8, dim_b: u8) -> bool
OGC Crosses (requires the topological dimensions of the two geometries).
- Point/Line, Point/Area, Line/Area (dim_a < dim_b): pattern
T*T****** - Line/Line (dim_a == dim_b == 1): pattern
0******** - Polygon/Polygon (dim_a == dim_b == 2): always
false(undefined)
Sourcepub fn is_within(&self) -> bool
pub fn is_within(&self) -> bool
OGC Within: T*F**F***
Geometry a is within geometry b when every point of a lies inside (interior or boundary of) b and the interiors intersect.
Sourcepub fn is_contains(&self) -> bool
pub fn is_contains(&self) -> bool
OGC Contains: T*****FF*
Geometry a contains geometry b when within(b, a) is true.
Sourcepub fn is_overlaps(&self, dim_a: u8, dim_b: u8) -> bool
pub fn is_overlaps(&self, dim_a: u8, dim_b: u8) -> bool
OGC Overlaps (requires the topological dimensions of the two geometries).
- Point/Point or Area/Area (dim_a == dim_b, both != 1):
T*T***T** - Line/Line (dim_a == dim_b == 1):
1*T***T** - Different dimensions: always
false
Sourcepub fn is_covers(&self) -> bool
pub fn is_covers(&self) -> bool
OGC Covers: T*****FF* OR *T****FF* OR ***T**FF* OR ****T*FF*
Geometry a covers geometry b when every point of b is a point of a.
Sourcepub fn is_covered_by(&self) -> bool
pub fn is_covered_by(&self) -> bool
OGC CoveredBy: T*F**F*** OR *TF**F*** OR **FT*F*** OR **F*TF***
Geometry a is covered by geometry b when every point of a is a point of b.
Trait Implementations§
impl Copy for De9im
impl Eq for De9im
impl StructuralPartialEq for De9im
Auto Trait Implementations§
impl Freeze for De9im
impl RefUnwindSafe for De9im
impl Send for De9im
impl Sync for De9im
impl Unpin for De9im
impl UnsafeUnpin for De9im
impl UnwindSafe for De9im
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more