Expand description
correct(&mut g) — fix ring closure and orientation in place.
Mirrors boost::geometry::correct from
boost/geometry/algorithms/correct.hpp and the closure-fix helper
at algorithms/correct_closure.hpp.
Per-kind:
Ring<P, CW, true>→ push closing vertex if missingRing<P, CW, false>→ pop closing vertex if duplicated- exterior ring → reverse so its strategy-level signed
area (which already folds the declared
PointOrder) is positive — i.e. the stored order matches the declaration, for CW- and CCW-declared rings alike Polygonouter → as above; inners → opposite of outerMultiPolygon→ correct each member
Empty and 1-point rings are left unchanged (silent no-op, matching Boost). Cartesian-only: the orientation test uses the Cartesian shoelace area.
Functions§
- correct
- Fix closure and orientation of
gin place. - correct_
closure - Fix only ring closure, leaving orientation unchanged.