Skip to main content

ValidityFailure

Enum ValidityFailure 

Source
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

Source§

fn clone(&self) -> ValidityFailure

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ValidityFailure

Source§

impl Debug for ValidityFailure

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ValidityFailure

Source§

impl PartialEq for ValidityFailure

Source§

fn eq(&self, other: &ValidityFailure) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ValidityFailure

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SameAs<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.