Skip to main content

ValidityFailure

Enum ValidityFailure 

Source
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

Source

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

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 Display for ValidityFailure

Source§

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

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

impl Eq for ValidityFailure

Source§

impl Error for ValidityFailure

Available on crate feature std only.
1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.