geoarrow_array/scalar/mod.rs
1//! Scalar references onto a parent GeoArrow array.
2//!
3//! For all "native" GeoArrow scalar types, (all types defined in this module) it is `O(1)` and
4//! allocation-free for any coordinate access.
5//!
6//! For "serialized" scalars emitted from the [`GenericWkbArray`][crate::array::GenericWkbArray],
7//! [`WkbViewArray`][crate::array::WkbViewArray],
8//! [`GenericWktArray`][crate::array::GenericWktArray], and
9//! [`WktViewArray`][crate::array::WktViewArray], there is an initial parsing step when accessing
10//! the scalar from the [`GeoArrowArrayAccessor`][crate::GeoArrowArrayAccessor] trait.
11//!
12//! All scalars implement [`geo_traits`]. You can iterate through geometry parts directly using the
13//! APIs exposed by [`geo_traits`]. Or, for simplicity at the cost of a memory copy, you can use
14//! the traits defined in [`geo_traits::to_geo`] to convert these scalars to [`geo_types`] objects
15//! (though keep in mind ).
16//!
17//! ## Converting to [`geo_types`]
18//!
19//! You can convert these scalars to [`geo_types`] objects using the [`geo_traits::to_geo`] traits.
20//!
21//! There are a couple drawbacks:
22//!
23//! - `geo_types` only supports 2D geometries. Any other dimensions will be dropped.
24//! - `geo_types` doesn't support empty points. This is why both
25//! [`ToGeoGeometry::to_geometry`][geo_traits::to_geo::ToGeoGeometry::to_geometry] and
26//! [`ToGeoGeometry::try_to_geometry`][geo_traits::to_geo::ToGeoGeometry::try_to_geometry] exist.
27//! The former will panic on any empty points.
28//!
29
30mod coord;
31mod geometry;
32mod geometrycollection;
33mod linestring;
34mod multilinestring;
35mod multipoint;
36mod multipolygon;
37mod point;
38mod polygon;
39mod rect;
40mod specialization;
41
42pub use coord::{Coord, InterleavedCoord, SeparatedCoord};
43pub use geometry::Geometry;
44pub use geometrycollection::GeometryCollection;
45pub use linestring::LineString;
46pub use multilinestring::MultiLineString;
47pub use multipoint::MultiPoint;
48pub use multipolygon::MultiPolygon;
49pub use point::Point;
50pub use polygon::Polygon;
51pub use rect::Rect;