pub enum ValidityFailure {
Show 20 variants
FewPoints,
DuplicatePoints,
NotClosed,
SelfIntersection,
InvalidCoordinate,
InteriorRingOutside,
CoordinateOutOfRange,
Spikes,
WrongOrientation,
NestedInteriorRings,
DisconnectedInterior,
IntersectingInteriors,
WrongTopologicalDimension,
WrongCornerOrder,
CollinearPointsOnFace,
NonCoplanarPointsOnFace,
FewPointsOnFace,
InconsistentOrientation,
InvalidIntersection,
DisconnectedSurface,
}Expand description
Why a geometry failed is_valid_ring / is_valid_polygon.
Mirrors Boost’s complete validity_failure_type taxonomy
(algorithms/validity_failure_type.hpp:33-113). The current areal
validator produces the relevant ring/polygon variants; retaining the
remaining categories keeps reporting stable as kind dispatch expands.
Variants§
FewPoints
Fewer than the 4 points a closed ring needs (3 distinct + the
repeated closing vertex). Boost’s failure_few_points.
DuplicatePoints
Two consecutive vertices are equal. Boost’s
failure_duplicate_points.
NotClosed
The ring’s first and last vertices differ — it is not closed.
Boost’s failure_not_closed.
SelfIntersection
Two non-adjacent edges of the ring cross, or an edge touches a
non-adjacent vertex. Boost’s failure_self_intersections.
InvalidCoordinate
A coordinate is NaN or infinite. Boost’s
failure_invalid_coordinate.
InteriorRingOutside
An interior ring is not contained in the exterior ring. Boost’s
failure_interior_rings_outside.
CoordinateOutOfRange
A coordinate lies outside the safe arithmetic range
(SAFE_ABS_MAX).
Past that magnitude the segment-intersection kernel yields
OutOfRange and the self-intersection test would silently miss a
real crossing, so validity cannot be confirmed. Reported as a
distinct failure rather than a bogus “valid” (there is no Boost
analogue — Boost’s rescaling policy sidesteps the range limit this
no-rescale port trades for).
Spikes
A vertex triple folds back on itself along one line — the ring
carries a spike. Boost’s failure_spikes.
WrongOrientation
The ring’s stored vertex order contradicts its declared
PointOrder (or the ring has zero
area, which admits no orientation). Exterior rings must traverse
in their declared order (strategy-level signed area positive);
interior rings the opposite. Boost’s failure_wrong_orientation.
NestedInteriorRings
One interior ring is contained by another interior ring. Boost’s
failure_nested_interior_rings.
DisconnectedInterior
Ring contacts split the polygon’s filled interior into disconnected
pieces. Boost’s failure_disconnected_interior.
IntersectingInteriors
Distinct multi-polygon members overlap in area or share a boundary
curve. Boost’s failure_intersecting_interiors.
WrongTopologicalDimension
The geometry collapses below its declared topological dimension.
Boost’s failure_wrong_topological_dimension.
WrongCornerOrder
A box’s maximum corner is lexicographically before its minimum corner.
Boost’s failure_wrong_corner_order.
CollinearPointsOnFace
Collinear vertices occur on one polyhedral-surface face. Boost’s
failure_collinear_points_on_face.
NonCoplanarPointsOnFace
Vertices of one polyhedral-surface face are not coplanar. Boost’s
failure_non_coplanar_points_on_face.
FewPointsOnFace
A polyhedral-surface face contains too few vertices. Boost’s
failure_few_points_on_face.
InconsistentOrientation
A polyhedral-surface edge has inconsistent face orientation. Boost’s
failure_inconsistent_orientation.
InvalidIntersection
Polyhedral-surface faces intersect away from a shared edge. Boost’s
failure_invalid_intersection.
DisconnectedSurface
Polyhedral-surface faces do not form a connected surface. Boost’s
failure_disconnected_surface.
Implementations§
Source§impl ValidityFailure
impl ValidityFailure
Sourcepub const fn message(self) -> &'static str
pub const fn message(self) -> &'static str
Return the stable reason prefix for this failure.
The areal, linear, box, and coordinate strings are byte-for-byte the
messages returned by validity_failure_type_message in
policies/is_valid/failing_reason_policy.hpp:32-63. Surface messages
extend that table for the surface failure values added later in
algorithms/validity_failure_type.hpp:91-113.
Trait Implementations§
Source§impl Clone for ValidityFailure
impl Clone for ValidityFailure
Source§fn clone(&self) -> ValidityFailure
fn clone(&self) -> ValidityFailure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ValidityFailure
Source§impl Debug for ValidityFailure
impl Debug for ValidityFailure
Source§impl Display for ValidityFailure
impl Display for ValidityFailure
impl Eq for ValidityFailure
Source§impl Error for ValidityFailure
Available on crate feature std only.
impl Error for ValidityFailure
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()