pub enum ValidityFailure {
FewPoints,
NotClosed,
SelfIntersection,
InvalidCoordinate,
InteriorRingOutside,
CoordinateOutOfRange,
Spikes,
WrongOrientation,
}Expand description
Why a geometry failed is_valid_ring / is_valid_polygon.
Mirrors the subset of Boost’s validity_failure_type
(algorithms/validity_failure_type.hpp) that the v1 areal validator
can produce. The numeric groupings (few-points, not-closed,
self-intersections, …) match Boost’s categories.
Variants§
FewPoints
Fewer than the 4 points a closed ring needs (3 distinct + the
repeated closing vertex). Boost’s failure_few_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.
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 more