geo_traits/
lib.rs

1//! A trait-based interface for geospatial vector data interchange in Rust.
2//!
3//! This crate contains a set of traits based on the Simple Features standard for geospatial vector
4//! data. These traits are designed to make it easy to operate on and consume geometries throughout
5//! the Rust ecosystem without knowing library-specific APIs or memory layouts.
6//!
7//! It is expected that accessing any individual coordinate or value from a geometry is
8//! **constant-time**. This means that when implementing these traits on a format like WKB that
9//! requires linear-time search to locate coordinates, the WKB wrapper should have already
10//! undergone an initial pass to find the relevant byte offsets where coordinate sequences start
11//! and end.
12//!
13//! This interface will usually but not always be zero-copy. Coordinate access is expected to be
14//! constant-time but not necessarily _free_. For example, WKB is not aligned and may use a
15//! different endianness than the current machine, so individual values may need to be cloned on
16//! read.
17
18#![deny(missing_docs)]
19
20pub use coord::{CoordTrait, UnimplementedCoord};
21pub use dimension::Dimensions;
22pub use geometry::{GeometryTrait, GeometryType, UnimplementedGeometry};
23pub use geometry_collection::{GeometryCollectionTrait, UnimplementedGeometryCollection};
24pub use line::{LineTrait, UnimplementedLine};
25pub use line_string::{LineStringTrait, UnimplementedLineString};
26pub use multi_line_string::{MultiLineStringTrait, UnimplementedMultiLineString};
27pub use multi_point::{MultiPointTrait, UnimplementedMultiPoint};
28pub use multi_polygon::{MultiPolygonTrait, UnimplementedMultiPolygon};
29pub use point::{PointTrait, UnimplementedPoint};
30pub use polygon::{PolygonTrait, UnimplementedPolygon};
31pub use rect::{RectTrait, UnimplementedRect};
32pub use triangle::{TriangleTrait, UnimplementedTriangle};
33
34mod coord;
35mod dimension;
36mod geometry;
37mod geometry_collection;
38mod iterator;
39mod line;
40mod line_string;
41mod multi_line_string;
42mod multi_point;
43mod multi_polygon;
44mod point;
45mod polygon;
46mod rect;
47#[cfg(feature = "geo-types")]
48pub mod to_geo;
49mod triangle;