Skip to main content

Module length

Module length 

Source
Expand description

length(&g) and perimeter(&p) — see boost/geometry/algorithms/{length,perimeter}.hpp.

length dispatches to the per-CS-family default strategy via geometry_strategy::DefaultLength — Cartesian linestrings resolve to geometry_strategy::CartesianLength, spherical to geometry_strategy::SphericalLength, geographic to geometry_strategy::GeographicLength. perimeter / ring_perimeter remain Cartesian-pinned (the spherical / geographic perimeter strategies are reachable directly via geometry_strategy::SphericalPerimeter / geometry_strategy::GeographicPerimeter).

Functions§

length
Sum the per-segment distance along a linestring using the default strategy for its coordinate-system family.
length_with
Length of a linestring using an explicitly supplied strategy.
perimeter
Perimeter of a polygon: length of the exterior ring plus the sum of the lengths of the interior rings.
ring_perimeter
Standalone helper to compute the perimeter of a Ring directly, without wrapping it in a polygon. Mirrors Boost’s perimeter(ring) overload which dispatches via the ring_tag arm of algorithms/perimeter.hpp.