Boost.Geometry    Boost C++ Libraries
Classes | Functions
length: calculate length of a linear geometry

Classes

struct  boost::geometry::default_length_result< Geometry >
 Meta-function defining return type of length function. More...
 

Functions

template<typename Geometry >
default_length_result
< Geometry >::type 
boost::geometry::length (Geometry const &geometry)
 Calculates the length of a geometry. More...
 
template<typename Geometry , typename Strategy >
default_length_result
< Geometry >::type 
boost::geometry::length (Geometry const &geometry, Strategy const &strategy)
 Calculates the length of a geometry using the specified strategy. More...
 

Detailed Description

Function Documentation

template<typename Geometry >
default_length_result<Geometry>::type boost::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.

Template Parameters
GeometryAny type fulfilling a Geometry Concept
Parameters
geometryA model of the specified concept
Returns
The calculated length
Examples:
02_linestring_example.cpp, 07_a_graph_route_example.cpp, 07_b_graph_route_example.cpp, and c05_custom_point_pointer_example.cpp.
template<typename Geometry , typename Strategy >
default_length_result<Geometry>::type boost::geometry::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.

Template Parameters
GeometryAny type fulfilling a Geometry Concept
StrategyAny type fulfilling a distance Strategy Concept
Parameters
geometryA model of the specified concept
strategyThe strategy which will be used for distance calculations
Returns
The calculated length

April 2, 2011

Copyright © 2007-2011 Barend Gehrels, Amsterdam, the Netherlands
Copyright © 2008-2011 Bruno Lalande, Paris, France
Copyright © 2009-2010 Mateusz Loskot, London, UK
Documentation is generated by Doxygen