Skip to main content

Module unique

Module unique 

Source
Expand description

unique(&mut g) — collapse consecutive duplicate points.

Mirrors boost::geometry::unique from boost/geometry/algorithms/unique.hpp. Boost uses std::unique and walks the same kind hierarchy as reverse. Per-kind:

  • Linestring, RingVec::dedup on the backing vec
  • Polygon → dedup outer + every inner ring
  • MultiLinestring → dedup each member
  • MultiPolygon → dedup each member polygon

Two points are equal iff every coordinate matches. Boost uses == on the coordinate type, which for floats is exact equality; we mirror that via Point::get per dimension, driven by geometry_trait::fold_dims.

Functions§

unique
Collapse runs of coordinate-equal consecutive points in g.