Expand description
convert(src) -> Dst — typed conversions between equivalent
geometry kinds.
Mirrors boost::geometry::convert(src, dst) from
boost/geometry/algorithms/convert.hpp. Boost writes the
destination through an out-parameter; the Rust port returns by
value. A dedicated [Convert] trait (rather than
core::convert::Into) keeps geometry conversions opt-in and
sidesteps the orphan-rule clash a blanket From/Into would hit
the moment a user adapts their own types.
Supported pairs:
Box→Polygon— the rectangle’s 5-point closed ringRing→Polygon— the ring becomes the exteriorRing→Linestring— copy the point sequenceSegment→Linestring— two-point(start, end)Point,Linestring,Polygon→ single-member multi
Linestring → Ring is intentionally NOT shipped — the caller
must assert closure and orientation for the destination, which
Boost forces through template arguments anyway. Use
Ring::from_vec(ls.0.clone()) (then correct)
if you need it.
Functions§
- convert
- Convert
srcinto the destination kindDst.