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.