Boost.Geometry    Boost C++ Libraries
Classes | Functions
area: calculate area of a Geometry

Classes

class  boost::geometry::concept::AreaStrategy< Strategy >
 Checks strategy for area. More...
struct  boost::geometry::default_area_result< Geometry >
 Meta-function defining return type of area function, using the default strategy. More...
struct  boost::geometry::strategy::area::services::default_strategy< Tag, PointOfSegment >
 Traits class binding a default area strategy to a coordinate system. More...

Functions

template<typename Geometry >
default_area_result< Geometry >
::type 
boost::geometry::area (Geometry const &geometry)
 Calculates the area of a geometry.
template<typename Geometry , typename Strategy >
Strategy::return_type boost::geometry::area (Geometry const &geometry, Strategy const &strategy)
 Calculates the area of a geometry using the specified strategy.

Function Documentation

template<typename Geometry >
default_area_result<Geometry>::type boost::geometry::area ( Geometry const &  geometry)

Calculates the area of a geometry.

The free function area calculates the area of a geometry. It uses the default strategy, based on the coordinate system of the geometry.

The area algorithm calculates the surface area of all geometries having a surface, namely box, polygon, ring, multipolygon. The units are the square of the units used for the points defining the surface. If subject geometry is defined in meters, then area is calculated in square meters.

The area calculation can be done in all three common coordinate systems, Cartesian, Spherical and Geographic as well.

Template Parameters:
GeometryAny type fulfilling a Geometry Concept
Parameters:
geometryA model of the specified concept
Returns:
The calculated \1
Examples:
03_polygon_example.cpp, c04_a_custom_triangle_example.cpp, c04_b_custom_triangle_example.cpp, c06_custom_polygon_example.cpp, and x01_qt_example.cpp.
template<typename Geometry , typename Strategy >
Strategy::return_type boost::geometry::area ( Geometry const &  geometry,
Strategy const &  strategy 
)

Calculates the area of a geometry using the specified strategy.

The free function area calculates the area 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 Area Strategy Concept
Parameters:
geometryA model of the specified concept
strategyThe strategy which will be used for area calculations
Returns:
The calculated \1

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