• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[/============================================================================
2  Boost.Geometry (aka GGL, Generic Geometry Library)
3
4  Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands.
5  Copyright (c) 2008-2013 Bruno Lalande, Paris, France.
6  Copyright (c) 2009-2013 Mateusz Loskot, London, UK.
7
8  Use, modification and distribution is subject to the Boost Software License,
9  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
10  http://www.boost.org/LICENSE_1_0.txt)
11=============================================================================/]
12
13
14[/ Generated by doxygen_xml2qbk 1.1.1, don't change, will be overwritten automatically]
15[/ Generated from doxy/doxygen_output/xml/group__area.xml]
16[section:area_1 area]
17
18'''<indexterm><primary>area</primary></indexterm>'''
19Calculates the area of a geometry.
20
21[heading Description]
22The free function area calculates the area of a geometry. It uses the default strategy, based on the coordinate system of the geometry.
23
24The 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.
25
26The area calculation can be done in all three common coordinate systems, Cartesian, Spherical and Geographic as well.
27
28[heading Synopsis]
29``template<typename Geometry>
30area_result<Geometry>::type area(Geometry const & geometry)``
31
32[heading Parameters]
33
34[table
35[[Type] [Concept] [Name] [Description] ]
36[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
37]
38
39
40[heading Returns]
41The calculated area
42
43[heading Header]
44Either
45
46`#include <boost/geometry.hpp>`
47
48
49Or
50
51`#include <boost/geometry/algorithms/area.hpp>`
52
53[include reference/algorithms/area.qbk]
54[heading Examples]
55[area] [area_output]
56
57
58[endsect]
59
60[section:area_2_with_strategy area (with strategy)]
61
62'''<indexterm><primary>area</primary></indexterm>'''
63Calculates the area of a geometry using the specified strategy.
64
65[heading Description]
66The 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.
67
68[heading Synopsis]
69``template<typename Geometry, typename Strategy>
70area_result<Geometry, Strategy>::type area(Geometry const & geometry, Strategy const & strategy)``
71
72[heading Parameters]
73
74[table
75[[Type] [Concept] [Name] [Description] ]
76[[Geometry const &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
77[[Strategy const &] [Any type fulfilling a Area Strategy Concept ] [strategy] [The strategy which will be used for area calculations ]]
78]
79
80
81[heading Returns]
82The calculated area
83
84[heading Header]
85Either
86
87`#include <boost/geometry.hpp>`
88
89
90Or
91
92`#include <boost/geometry/algorithms/area.hpp>`
93
94[include reference/algorithms/area.qbk]
95
96[heading Available Strategies]
97* [link geometry.reference.strategies.strategy_area_cartesian Cartesian]
98* [link geometry.reference.strategies.strategy_area_spherical Spherical]
99* [link geometry.reference.strategies.strategy_area_geographic Geographic]
100
101[heading Example]
102[area_with_strategy]
103[area_with_strategy_output]
104
105
106[endsect]
107
108