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— thetraits::tag<G>::typemetafunction.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. - Dynamic
Geometry Tag - 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. - Geometry
Collection Tag - OGC Geometry Collection identifying tag —
boost/geometry/core/tags.hpp:122. - Linestring
Tag - OGC Linestring identifying tag —
boost/geometry/core/tags.hpp:94. - Multi
Linestring Tag - OGC
MultiLinestringidentifying tag —boost/geometry/core/tags.hpp:116. - Multi
Point Tag - OGC
MultiPointidentifying tag —boost/geometry/core/tags.hpp:113. - Multi
Polygon Tag - OGC
MultiPolygonidentifying tag —boost/geometry/core/tags.hpp:119. - Point
Tag - OGC Point identifying tag —
boost/geometry/core/tags.hpp:91. - Polygon
Tag - OGC Polygon identifying tag —
boost/geometry/core/tags.hpp:97. - Polyhedral
Surface Tag - OGC Polyhedral surface identifying tag —
boost/geometry/core/tags.hpp:109. - RingTag
- Convenience linear ring identifying tag —
boost/geometry/core/tags.hpp:100. - Segment
Tag - 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, soT: Polygonalautomatically impliesT: 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, soT: Polylinearautomatically impliesT: Linear. - SameAs
T: SameAs<U>holds iffTandUare 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).