area

# area: calculate area of a Geometry

boost::geometry::concept::AreaStrategy
boost::geometry::default_area_result
boost::geometry::strategy::area::services::default_strategy
typename Geometry
default_area_result< Geometry >::type default_area_result<Geometry>::type boost::geometry::area (Geometry const &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.

Geometry

Any type fulfilling a Geometry Concept

geometry

A model of the specified concept

The calculated \1

[include reference/algorithms/area.qbk] [heading Examples] [area] [area_output]
typename Geometry
typename Strategy
Strategy::return_type Strategy::return_type boost::geometry::area (Geometry const &geometry, Strategy const &strategy) 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. Geometry

Any type fulfilling a Geometry Concept

Strategy

Any type fulfilling a Area Strategy Concept

geometry

A model of the specified concept

strategy

The strategy which will be used for area calculations

The calculated \1

with strategy

[include reference/algorithms/area.qbk] [heading Example] [area_with_strategy] [area_with_strategy_output] [heading Available Strategies] \* [link geometry.reference.strategies.strategy_area_surveyor Surveyor (cartesian)] \* [link geometry.reference.strategies.strategy_area_huiller Huiller (spherical)]