Expand description
Adapt geo-types geometries to the geometry-trait concept
surface.
Mirrors the role of the Boost BOOST_GEOMETRY_REGISTER_* macros in
boost/geometry/geometries/adapted/ — those specialise the C++
traits::{tag, dimension, coordinate_type, coordinate_system, access} metafunctions (and, for containers, ring_const_type,
exterior_ring, interior_rings, …) for a foreign storage layout.
Rust has no specialisation and the orphan rule forbids implementing
a foreign concept trait for a foreign geo-types type, so — as with
geometry_adapt::Adapt and the
geometry_adapt_nalgebra
sibling — each foreign value is wrapped in a local newtype and the
geometry concepts hang off the wrapper.
§Point wrappers
GeoCoord—geo_types::Coord, the(x, y)ordinate pair.GeoPoint—geo_types::Point, the newtype around aCoord.
Both pin Cs = Cartesian, DIM = 2, and are read-write
(geometry_trait::PointMut).
§Container wrappers
GeoLineString—geo_types::LineStringas aLinestring.GeoRing—geo_types::LineStringas aRing(geo-typeshas no separate ring type; the caller asserts closure and orientation).GeoPolygon—geo_types::Polygon.GeoMultiPoint/GeoMultiLineString/GeoMultiPolygon.GeoLine—geo_types::Lineas aSegment.GeoRect—geo_types::Rectas aBox.GeoCollection—geo_types::GeometryCollection.
Because the container concepts yield their points by reference
(points() -> impl Iterator<Item = &Self::Point>) and this crate is
#![forbid(unsafe_code)], the container wrappers store their
vertices as the wrapped point type (GeoCoord / GeoPoint)
rather than re-casting the raw geo-types storage. Construction and
into_inner copy ordinates
element-by-element; both coordinate representations are Copy, so
the round trip is lossless.
§DynGeometry interop
crate::dyn_conversion provides
From<geo_types::Geometry<T>> ↔
DynGeometry<T, Cartesian> so a whole
geometry tree can move between the two ecosystems.
Modules§
- dyn_
conversion - Bidirectional conversion between
geo_types::Geometry<T>andDynGeometry<T, Cartesian>.
Structs§
- GeoCollection
- Shape-only adapter for
geo_types::GeometryCollection<T>. - GeoCoord
- Shape-only adapter for
geo_types::Coord<T>. - GeoLine
- Shape-only adapter for
geo_types::Line<T>. - GeoLine
String - Shape-only adapter for
geo_types::LineString<T>. - GeoMulti
Line String - Shape-only adapter for
geo_types::MultiLineString<T>. - GeoMulti
Point - Shape-only adapter for
geo_types::MultiPoint<T>. - GeoMulti
Polygon - Shape-only adapter for
geo_types::MultiPolygon<T>. - GeoPoint
- Shape-only adapter for
geo_types::Point<T>. - GeoPolygon
- Shape-only adapter for
geo_types::Polygon<T>. - GeoRect
- Shape-only adapter for
geo_types::Rect<T>. - GeoRing
- Shape-only adapter presenting a
geo_types::LineString<T>as aRing.