#[non_exhaustive]pub enum GeometryError {
Header(GpbError),
Body(WkbError),
NonLinearMember {
container: GeometryType,
member: GeometryType,
},
TruncatedWkb,
UnknownWkbType(u32),
AbstractWkbType(u32),
TruncatedAt {
offset: usize,
},
InvalidByteOrder {
offset: usize,
},
NestingTooDeep,
EncodeWkb(WkbError),
}Expand description
Errors from constructing or reading a GpbGeometry.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Header(GpbError)
The GPB header could not be parsed.
Body(WkbError)
The ISO WKB body could not be read. This includes non-linear curve
types (CIRCULARSTRING, CURVEPOLYGON, …) that the wkb crate does
not yet support, as well as structurally malformed bodies.
encode_gpb_from_wkb separates the one case where those two are
confusable: see Self::NonLinearMember.
NonLinearMember
A body whose own type is one of the core ones but which contains a
non-linear member, such as a GEOMETRYCOLLECTION containing a
CIRCULARSTRING.
Reading a non-linear geometry goes through crate::curve rather than
the wkb reader, and which reader a body gets is decided from its own
type code. A core-typed container therefore reaches the wkb reader,
which cannot read the member. Reported separately from Self::Body
because the body is not malformed and the distinction is not one a
caller can otherwise draw.
Fields
container: GeometryTypeThe body’s own type.
member: GeometryTypeThe first non-linear type found inside it.
TruncatedWkb
The WKB body was too short to contain the one-byte order marker and four-byte geometry type code.
UnknownWkbType(u32)
The WKB geometry type code is not one of the GeoPackage geometry types (Annex G).
AbstractWkbType(u32)
The WKB body declares one of the abstract supertypes (GEOMETRY,
CURVE, SURFACE), which cannot be instantiated and so cannot appear
as a body.
TruncatedAt
The WKB body ended before a count, coordinate, or nested geometry its structure requires.
InvalidByteOrder
A WKB geometry opened with a byte-order marker that is neither 0 (big endian) nor 1 (little endian).
NestingTooDeep
Nested geometry containers exceeded the walk’s depth limit.
EncodeWkb(WkbError)
The geometry could not be encoded to WKB: the georust wkb writer
rejected it (for example a coordinate dimension it cannot serialise).
Trait Implementations§
Source§impl Debug for GeometryError
impl Debug for GeometryError
Source§impl Display for GeometryError
impl Display for GeometryError
Source§impl Error for GeometryError
impl Error for GeometryError
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()