#[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 covers structurally malformed
bodies and the non-linear curve types (CIRCULARSTRING,
CURVEPOLYGON, …) that the wkb crate does not yet support.
Code that reads a body through the wkb reader, such as
GpbGeometry, returns this variant. encode_gpb_from_wkb reads
bodies with crate::curve instead, and reports structural problems
with that scanner’s variants.
NonLinearMember
A body of a core type that contains a non-linear member, such as a
GEOMETRYCOLLECTION containing a CIRCULARSTRING.
The byte scanner can read such a body. Reading it back as a geometry
goes through the wkb reader, which is chosen by the body’s own type
code and cannot read the member. Writing one would produce a blob that
this crate’s own read path cannot return, so the write path rejects it.
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 georust wkb writer could not encode the geometry, for example
because it has a coordinate dimension the writer 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()