Skip to main content

Crate geometry_tag

Crate geometry_tag 

Source
Expand description

Geometry kind tags and the tag-hierarchy marker traits.

Eleven empty tag types identify each OGC geometry kind, and a set of marker traits (Single, Multi, Pointlike, Linear, Polylinear, Areal, Polygonal, Volumetric) reproduce the C++ struct-inheritance hierarchy at the Rust trait-bound level. Together they let downstream crates dispatch on tag identity (one impl per tag) and tag category (one impl that covers every linear tag, every areal tag, etc.) — the Rust analogue of tag_cast<Tag, Stops...>.

References:

  • boost/geometry/core/tags.hpp — tag hierarchy declarations.
  • boost/geometry/core/tag.hpp — the traits::tag<G>::type metafunction.
  • boost/geometry/core/tag_cast.hpp — base-tag walking, replaced here by Rust trait super-bounds.

§Examples

Category dispatch — one impl covers every linear tag:

use geometry_tag::{Linear, LinestringTag, MultiLinestringTag, SegmentTag};

fn accepts_linear<T: Linear>() {}
accepts_linear::<SegmentTag>();
accepts_linear::<LinestringTag>();
accepts_linear::<MultiLinestringTag>();

Structs§

BoxTag
2D or 3D axis-aligned box (mbr / aabb) identifying tag — boost/geometry/core/tags.hpp:103.
DynamicGeometryTag
Runtime-tagged (variant) geometry identifying tag — boost/geometry/core/tags.hpp:124 (dynamic_geometry_tag). Marks a value whose OGC kind is decided at runtime, e.g. DynGeometry.
GeometryCollectionTag
OGC Geometry Collection identifying tag — boost/geometry/core/tags.hpp:122.
LinestringTag
OGC Linestring identifying tag — boost/geometry/core/tags.hpp:94.
MultiLinestringTag
OGC MultiLinestring identifying tag — boost/geometry/core/tags.hpp:116.
MultiPointTag
OGC MultiPoint identifying tag — boost/geometry/core/tags.hpp:113.
MultiPolygonTag
OGC MultiPolygon identifying tag — boost/geometry/core/tags.hpp:119.
PointTag
OGC Point identifying tag — boost/geometry/core/tags.hpp:91.
PolygonTag
OGC Polygon identifying tag — boost/geometry/core/tags.hpp:97.
PolyhedralSurfaceTag
OGC Polyhedral surface identifying tag — boost/geometry/core/tags.hpp:109.
RingTag
Convenience linear ring identifying tag — boost/geometry/core/tags.hpp:100.
SegmentTag
Convenience segment (2-points) identifying tag — boost/geometry/core/tags.hpp:106.

Traits§

Areal
Areal category marker — counterpart of areal_tag (boost/geometry/core/tags.hpp:75).
Linear
Linear category marker — counterpart of linear_tag (boost/geometry/core/tags.hpp:69).
Multi
Multi-geometry marker — counterpart of multi_tag (boost/geometry/core/tags.hpp:63).
Pointlike
Point-like category marker — counterpart of pointlike_tag (boost/geometry/core/tags.hpp:66).
Polygonal
Polygonal category marker — counterpart of polygonal_tag : areal_tag (boost/geometry/core/tags.hpp:78). The C++ inheritance is expressed as a Rust super-trait bound, so T: Polygonal automatically implies T: Areal.
Polylinear
Polylinear category marker — counterpart of polylinear_tag : linear_tag (boost/geometry/core/tags.hpp:72). The C++ inheritance is expressed as a Rust super-trait bound, so T: Polylinear automatically implies T: Linear.
SameAs
T: SameAs<U> holds iff T and U are the same type.
Single
Single-geometry marker — counterpart of single_tag (boost/geometry/core/tags.hpp:59).
Volumetric
Volumetric category marker — counterpart of volumetric_tag (boost/geometry/core/tags.hpp:81).