length

# length: calculate length of a linear geometry

boost::geometry::default_length_result
typename Geometry
default_length_result< Geometry >::type default_length_result<Geometry>::type boost::geometry::length (Geometry const &geometry) length Geometry const & geometry

Calculates the length of a geometry.

The free function length calculates the length (the sum of distances between consecutive points) of a geometry. It uses the default strategy, based on the coordinate system of the geometry. Geometry

Any type fulfilling a Geometry Concept

geometry

A model of the specified concept

The calculated \1

[include reference/algorithms/length.qbk] [length] [length_output]
typename Geometry
typename Strategy
default_length_result< Geometry >::type default_length_result<Geometry>::type boost::geometry::length (Geometry const &geometry, Strategy const &strategy) length Geometry const & geometry Strategy const & strategy

Calculates the length of a geometry using the specified strategy.

The free function length calculates the length (the sum of distances between consecutive points) of a geometry using the specified strategy. Reasons to specify a strategy include: use another coordinate system for calculations; construct the strategy beforehand (e.g. with the radius of the Earth); select a strategy when there are more than one available for a calculation. Geometry

Any type fulfilling a Geometry Concept

Strategy

Any type fulfilling a distance Strategy Concept

geometry

A model of the specified concept

strategy

The strategy which will be used for distance calculations

The calculated \1

with strategy [include reference/algorithms/length.qbk] [length_with_strategy] [length_with_strategy_output]