3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>return_centroid (with strategy)</title>
5 <link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../../index.html" title="Chapter 1. Geometry">
8 <link rel="up" href="../centroid.html" title="centroid">
9 <link rel="prev" href="return_centroid_1.html" title="return_centroid">
10 <link rel="next" href="../clear.html" title="clear">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="return_centroid_1.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../centroid.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../clear.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h5 class="title">
27 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy"></a><a class="link" href="return_centroid_2_with_strategy.html" title="return_centroid (with strategy)">return_centroid
29 </h5></div></div></div>
31 <a class="indexterm" name="idm46187006950608"></a>
32 Calculates the centroid of a geometry using the specified strategy.
35 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h0"></a>
36 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.description"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.description">Description</a>
39 The free function centroid calculates the geometric center (or: center
40 of mass) of a geometry. This version with the return_ prefix returns
41 the centroid, and a template parameter must therefore be specified in
42 the call.. Reasons to specify a strategy include: use another coordinate
43 system for calculations; construct the strategy beforehand (e.g. with
44 the radius of the Earth); select a strategy when there are more than
45 one available for a calculation.
48 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h1"></a>
49 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.synopsis"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.synopsis">Synopsis</a>
53 <pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Point</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Geometry</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Strategy</span><span class="special">></span>
54 <span class="identifier">Point</span> <span class="identifier">return_centroid</span><span class="special">(</span><span class="identifier">Geometry</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">geometry</span><span class="special">,</span> <span class="identifier">Strategy</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">strategy</span><span class="special">)</span></pre>
58 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h2"></a>
59 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.parameters"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.parameters">Parameters</a>
61 <div class="informaltable"><table class="table">
99 Any type fulfilling a Point Concept
121 Any type fulfilling a Geometry Concept
131 A model of the specified concept
143 Any type fulfilling a centroid Strategy Concept
153 The strategy which will be used for centroid calculations
160 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h3"></a>
161 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.returns"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.returns">Returns</a>
164 The calculated centroid
167 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h4"></a>
168 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.header"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.header">Header</a>
174 <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
180 <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">algorithms</span><span class="special">/</span><span class="identifier">centroid</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
183 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h5"></a>
184 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.conformance"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.conformance">Conformance</a>
187 The function centroid implements function Centroid from the <a href="http://www.opengeospatial.org/standards/sfa" target="_top">OGC
188 Simple Feature Specification</a>.
191 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h6"></a>
192 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.behavior"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.behavior">Behavior</a>
194 <div class="informaltable"><table class="table">
220 Returns the point itself as the centroid
232 Calculates centroid (based on average)
239 linear (e.g. linestring)
244 Calculates centroid (based on weighted length)
263 Empty (e.g. polygon without points)
268 Throws a <a class="link" href="../../exceptions/centroid_exception.html" title="centroid_exception">centroid_exception</a>
292 Calculates the centroid as if based on Cartesian coordinates
299 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h7"></a>
300 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.supported_geometries"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.supported_geometries">Supported
303 <div class="informaltable"><table class="table">
332 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
337 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
349 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
354 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
366 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
371 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
383 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
388 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
400 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
405 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
417 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
422 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
434 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
439 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
451 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
456 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
468 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
473 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
480 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h8"></a>
481 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.complexity"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.complexity">Complexity</a>
487 <a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.h9"></a>
488 <span class="phrase"><a name="geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.available_strategies"></a></span><a class="link" href="return_centroid_2_with_strategy.html#geometry.reference.algorithms.centroid.return_centroid_2_with_strategy.available_strategies">Available
491 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
492 <a class="link" href="../../strategies/strategy_centroid_bashein_detmer.html" title="strategy::centroid::bashein_detmer">Bashein
493 Detmer (cartesian)</a>
496 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
497 <td align="left"></td>
498 <td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
499 Wulkiewicz, Oracle and/or its affiliates<p>
500 Distributed under the Boost Software License, Version 1.0. (See accompanying
501 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
506 <div class="spirit-nav">
507 <a accesskey="p" href="return_centroid_1.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../centroid.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../clear.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>