Skip to main content

num_points

Function num_points 

Source
pub fn num_points<G>(g: &G) -> usize
where G: Geometry, G::Kind: NumPointsStrategyForKind, <G::Kind as NumPointsStrategyForKind>::S: NumPointsStrategy<G>,
Expand description

Total number of points in g.

  • Point1
  • Segment2 (the two endpoints)
  • Box2^D corner points (num_points.hpp:100-101) — 4 in 2D
  • Linestring / Ring → length of the stored point sequence
  • Polygon → exterior + Σ interior ring point counts
  • Multi* → sum over members

Mirrors boost::geometry::num_points(g) from boost/geometry/algorithms/num_points.hpp. The per-kind body is selected by the tag-keyed [NumPointsStrategyForKind] picker, so any concept-adapted foreign type resolves through the same path as the equivalent geometry-model value.