Crate geo_traits

Source
Expand description

A trait-based interface for geospatial vector data interchange in Rust.

This crate contains a set of traits based on the Simple Features standard for geospatial vector data. These traits are designed to make it easy to operate on and consume geometries throughout the Rust ecosystem without knowing library-specific APIs or memory layouts.

It is expected that accessing any individual coordinate or value from a geometry is constant-time. This means that when implementing these traits on a format like WKB that requires linear-time search to locate coordinates, the WKB wrapper should have already undergone an initial pass to find the relevant byte offsets where coordinate sequences start and end.

This interface will usually but not always be zero-copy. Coordinate access is expected to be constant-time but not necessarily free. For example, WKB is not aligned and may use a different endianness than the current machine, so individual values may need to be cloned on read.

Modules§

to_geo
Convert structs that implement geo-traits to [geo-types] objects.

Structs§

UnimplementedCoord
An empty struct that implements CoordTrait.
UnimplementedGeometry
An empty struct that implements GeometryTrait.
UnimplementedGeometryCollection
An empty struct that implements GeometryCollectionTrait.
UnimplementedLine
An empty struct that implements LineTrait.
UnimplementedLineString
An empty struct that implements LineStringTrait.
UnimplementedMultiLineString
An empty struct that implements MultiLineStringTrait.
UnimplementedMultiPoint
An empty struct that implements MultiPointTrait.
UnimplementedMultiPolygon
An empty struct that implements MultiPolygonTrait.
UnimplementedPoint
An empty struct that implements PointTrait.
UnimplementedPolygon
An empty struct that implements PolygonTrait.
UnimplementedRect
An empty struct that implements RectTrait.
UnimplementedTriangle
An empty struct that implements TriangleTrait.

Enums§

Dimensions
The logical dimension of the geometry.
GeometryType
An enumeration of all geometry types that can be contained inside a GeometryTrait. This is used for extracting concrete geometry types out of a GeometryTrait.

Traits§

CoordTrait
A trait for accessing data from a generic Coord.
GeometryCollectionTrait
A trait for accessing data from a generic GeometryCollection.
GeometryTrait
A trait for accessing data from a generic Geometry.
LineStringTrait
A trait for accessing data from a generic LineString.
LineTrait
A trait for accessing data from a generic Line.
MultiLineStringTrait
A trait for accessing data from a generic MultiLineString.
MultiPointTrait
A trait for accessing data from a generic MultiPoint.
MultiPolygonTrait
A trait for accessing data from a generic MultiPolygon.
PointTrait
A trait for accessing data from a generic Point.
PolygonTrait
A trait for accessing data from a generic Polygon.
RectTrait
A trait for accessing data from a generic Rect.
TriangleTrait
A trait for accessing data from a generic Triangle.