• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>buffer (with strategies)</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="../buffer.html" title="buffer">
9<link rel="prev" href="buffer_4.html" title="buffer">
10<link rel="next" href="return_buffer.html" title="return_buffer">
11</head>
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>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="buffer_4.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../buffer.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="return_buffer.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h5 class="title">
27<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies"></a><a class="link" href="buffer_7_with_strategies.html" title="buffer (with strategies)">buffer
28          (with strategies)</a>
29</h5></div></div></div>
30<p>
31            <a class="indexterm" name="idm45635706289920"></a>
32Calculates the buffer of a geometry.
33          </p>
34<h6>
35<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h0"></a>
36            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.description"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.description">Description</a>
37          </h6>
38<p>
39            The free function buffer calculates the buffer (a polygon being the spatial
40            point set collection within a specified maximum distance from a geometry)
41            of a geometry.
42          </p>
43<h6>
44<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h1"></a>
45            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.synopsis"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.synopsis">Synopsis</a>
46          </h6>
47<p>
48</p>
49<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">GeometryIn</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">MultiPolygon</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">DistanceStrategy</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">SideStrategy</span><span class="special">,</span>
50         <span class="keyword">typename</span> <span class="identifier">JoinStrategy</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">EndStrategy</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">PointStrategy</span><span class="special">&gt;</span>
51<span class="keyword">void</span> <span class="identifier">buffer</span><span class="special">(</span><span class="identifier">GeometryIn</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">geometry_in</span><span class="special">,</span> <span class="identifier">MultiPolygon</span> <span class="special">&amp;</span> <span class="identifier">geometry_out</span><span class="special">,</span> <span class="identifier">DistanceStrategy</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">distance_strategy</span><span class="special">,</span>
52            <span class="identifier">SideStrategy</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">side_strategy</span><span class="special">,</span> <span class="identifier">JoinStrategy</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">join_strategy</span><span class="special">,</span> <span class="identifier">EndStrategy</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">end_strategy</span><span class="special">,</span>
53            <span class="identifier">PointStrategy</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">point_strategy</span><span class="special">)</span></pre>
54<p>
55          </p>
56<h6>
57<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h2"></a>
58            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.parameters"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.parameters">Parameters</a>
59          </h6>
60<div class="informaltable"><table class="table">
61<colgroup>
62<col>
63<col>
64<col>
65<col>
66</colgroup>
67<thead><tr>
68<th>
69                    <p>
70                      Type
71                    </p>
72                  </th>
73<th>
74                    <p>
75                      Concept
76                    </p>
77                  </th>
78<th>
79                    <p>
80                      Name
81                    </p>
82                  </th>
83<th>
84                    <p>
85                      Description
86                    </p>
87                  </th>
88</tr></thead>
89<tbody>
90<tr>
91<td>
92                    <p>
93                      GeometryIn const &amp;
94                    </p>
95                  </td>
96<td>
97                    <p>
98                      Any type fulfilling a Geometry Concept
99                    </p>
100                  </td>
101<td>
102                    <p>
103                      geometry_in
104                    </p>
105                  </td>
106<td>
107                    <p>
108                      A model of the specified concept
109                    </p>
110                  </td>
111</tr>
112<tr>
113<td>
114                    <p>
115                      MultiPolygon &amp;
116                    </p>
117                  </td>
118<td>
119                    <p>
120                      A type fulfilling the MultiPolygon Concept
121                    </p>
122                  </td>
123<td>
124                    <p>
125                      geometry_out
126                    </p>
127                  </td>
128<td>
129                    <p>
130                      output multi polygon (or std:: collection of polygons), will
131                      contain a buffered version of the input geometry
132                    </p>
133                  </td>
134</tr>
135<tr>
136<td>
137                    <p>
138                      DistanceStrategy const &amp;
139                    </p>
140                  </td>
141<td>
142                    <p>
143                      A strategy defining distance (or radius)
144                    </p>
145                  </td>
146<td>
147                    <p>
148                      distance_strategy
149                    </p>
150                  </td>
151<td>
152                    <p>
153                      The distance strategy to be used
154                    </p>
155                  </td>
156</tr>
157<tr>
158<td>
159                    <p>
160                      SideStrategy const &amp;
161                    </p>
162                  </td>
163<td>
164                    <p>
165                      A strategy defining creation along sides
166                    </p>
167                  </td>
168<td>
169                    <p>
170                      side_strategy
171                    </p>
172                  </td>
173<td>
174                    <p>
175                      The side strategy to be used
176                    </p>
177                  </td>
178</tr>
179<tr>
180<td>
181                    <p>
182                      JoinStrategy const &amp;
183                    </p>
184                  </td>
185<td>
186                    <p>
187                      A strategy defining creation around convex corners
188                    </p>
189                  </td>
190<td>
191                    <p>
192                      join_strategy
193                    </p>
194                  </td>
195<td>
196                    <p>
197                      The join strategy to be used
198                    </p>
199                  </td>
200</tr>
201<tr>
202<td>
203                    <p>
204                      EndStrategy const &amp;
205                    </p>
206                  </td>
207<td>
208                    <p>
209                      A strategy defining creation at linestring ends
210                    </p>
211                  </td>
212<td>
213                    <p>
214                      end_strategy
215                    </p>
216                  </td>
217<td>
218                    <p>
219                      The end strategy to be used
220                    </p>
221                  </td>
222</tr>
223<tr>
224<td>
225                    <p>
226                      PointStrategy const &amp;
227                    </p>
228                  </td>
229<td>
230                    <p>
231                      A strategy defining creation around points
232                    </p>
233                  </td>
234<td>
235                    <p>
236                      point_strategy
237                    </p>
238                  </td>
239<td>
240                    <p>
241                      The point strategy to be used
242                    </p>
243                  </td>
244</tr>
245</tbody>
246</table></div>
247<h6>
248<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h3"></a>
249            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.header"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.header">Header</a>
250          </h6>
251<p>
252            Either
253          </p>
254<p>
255            <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span></code>
256          </p>
257<p>
258            Or
259          </p>
260<p>
261            <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special">&lt;</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">buffer</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
262          </p>
263<h6>
264<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h4"></a>
265            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.strategies"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.strategies">Strategies</a>
266          </h6>
267<p>
268            The 5 strategies give the user control to the generated buffer
269          </p>
270<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
271<li class="listitem">
272                convex corners can be rounded or sharp
273              </li>
274<li class="listitem">
275                line-ends can be rounded or flat
276              </li>
277<li class="listitem">
278                distance can be symmetric or assymetric, and positive or negative
279              </li>
280<li class="listitem">
281                around points the shape can be circular or square
282              </li>
283<li class="listitem">
284                the sides can be controlled (currently there is only one option provided)
285              </li>
286</ul></div>
287<p>
288            By specifying a negative distance for the distance_strategy, for the
289            (multi) polygon case, the polygon will be smaller (also known as deflate).
290            The distance cannot be 0.
291          </p>
292<p>
293            The next figure shows where in the generated buffer the strategies have
294            effect
295          </p>
296<p>
297            <span class="inlinemediaobject"><img src="../../../../img/algorithms/buffer_strategies.png" alt="buffer_strategies"></span>
298          </p>
299<h6>
300<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h5"></a>
301            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.conformance"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.conformance">Conformance</a>
302          </h6>
303<p>
304            The function buffer implements function Buffer from the <a href="http://www.opengeospatial.org/standards/sfa" target="_top">OGC
305            Simple Feature Specification</a>.
306          </p>
307<p>
308            It is conformant if used with the following combination of strategies:
309            <a class="link" href="../../strategies/strategy_buffer_join_round.html" title="strategy::buffer::join_round">join_round</a>,
310            <a class="link" href="../../strategies/strategy_buffer_end_round.html" title="strategy::buffer::end_round">end_round</a>,
311            <a class="link" href="../../strategies/strategy_buffer_distance_symmetric.html" title="strategy::buffer::distance_symmetric">distance_symmetric</a>,
312            <a class="link" href="../../strategies/strategy_buffer_point_circle.html" title="strategy::buffer::point_circle">point_circle</a>,
313            side_straight
314          </p>
315<h6>
316<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h6"></a>
317            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.supported_geometries"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.supported_geometries">Supported
318            geometries</a>
319          </h6>
320<div class="informaltable"><table class="table">
321<colgroup>
322<col>
323<col>
324<col>
325</colgroup>
326<thead><tr>
327<th>
328                  </th>
329<th>
330                    <p>
331                      2D Cartesian
332                    </p>
333                  </th>
334<th>
335                    <p>
336                      Geographic
337                    </p>
338                  </th>
339</tr></thead>
340<tbody>
341<tr>
342<td>
343                    <p>
344                      Point
345                    </p>
346                  </td>
347<td>
348                    <p>
349                      <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
350                    </p>
351                  </td>
352<td>
353                    <p>
354                      <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
355                    </p>
356                  </td>
357</tr>
358<tr>
359<td>
360                    <p>
361                      Segment
362                    </p>
363                  </td>
364<td>
365                    <p>
366                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
367                    </p>
368                  </td>
369<td>
370                    <p>
371                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
372                    </p>
373                  </td>
374</tr>
375<tr>
376<td>
377                    <p>
378                      Box
379                    </p>
380                  </td>
381<td>
382                    <p>
383                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
384                    </p>
385                  </td>
386<td>
387                    <p>
388                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
389                    </p>
390                  </td>
391</tr>
392<tr>
393<td>
394                    <p>
395                      Linestring
396                    </p>
397                  </td>
398<td>
399                    <p>
400                      <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
401                    </p>
402                  </td>
403<td>
404                    <p>
405                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
406                    </p>
407                  </td>
408</tr>
409<tr>
410<td>
411                    <p>
412                      Ring
413                    </p>
414                  </td>
415<td>
416                    <p>
417                      <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
418                    </p>
419                  </td>
420<td>
421                    <p>
422                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
423                    </p>
424                  </td>
425</tr>
426<tr>
427<td>
428                    <p>
429                      Polygon
430                    </p>
431                  </td>
432<td>
433                    <p>
434                      <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
435                    </p>
436                  </td>
437<td>
438                    <p>
439                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
440                    </p>
441                  </td>
442</tr>
443<tr>
444<td>
445                    <p>
446                      MultiPoint
447                    </p>
448                  </td>
449<td>
450                    <p>
451                      <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
452                    </p>
453                  </td>
454<td>
455                    <p>
456                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
457                    </p>
458                  </td>
459</tr>
460<tr>
461<td>
462                    <p>
463                      MultiLinestring
464                    </p>
465                  </td>
466<td>
467                    <p>
468                      <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
469                    </p>
470                  </td>
471<td>
472                    <p>
473                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
474                    </p>
475                  </td>
476</tr>
477<tr>
478<td>
479                    <p>
480                      MultiPolygon
481                    </p>
482                  </td>
483<td>
484                    <p>
485                      <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span>
486                    </p>
487                  </td>
488<td>
489                    <p>
490                      <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span>
491                    </p>
492                  </td>
493</tr>
494</tbody>
495</table></div>
496<h6>
497<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h7"></a>
498            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.examples"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.examples">Examples</a>
499          </h6>
500<p>
501            Shows how the buffer algorithm can be used to create a buffer of a linestring,
502            a multi point, a multi polygon
503          </p>
504<p>
505</p>
506<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
507<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">point_xy</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
508<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
509
510
511<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
512<span class="special">{</span>
513    <span class="keyword">typedef</span> <span class="keyword">double</span> <span class="identifier">coordinate_type</span><span class="special">;</span>
514    <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">d2</span><span class="special">::</span><span class="identifier">point_xy</span><span class="special">&lt;</span><span class="identifier">coordinate_type</span><span class="special">&gt;</span> <span class="identifier">point</span><span class="special">;</span>
515    <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">polygon</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;</span> <span class="identifier">polygon</span><span class="special">;</span>
516
517    <span class="comment">// Declare strategies</span>
518    <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">buffer_distance</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span>
519    <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">points_per_circle</span> <span class="special">=</span> <span class="number">36</span><span class="special">;</span>
520    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">distance_symmetric</span><span class="special">&lt;</span><span class="identifier">coordinate_type</span><span class="special">&gt;</span> <span class="identifier">distance_strategy</span><span class="special">(</span><span class="identifier">buffer_distance</span><span class="special">);</span>
521    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">join_round</span> <span class="identifier">join_strategy</span><span class="special">(</span><span class="identifier">points_per_circle</span><span class="special">);</span>
522    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">end_round</span> <span class="identifier">end_strategy</span><span class="special">(</span><span class="identifier">points_per_circle</span><span class="special">);</span>
523    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">point_circle</span> <span class="identifier">circle_strategy</span><span class="special">(</span><span class="identifier">points_per_circle</span><span class="special">);</span>
524    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">side_straight</span> <span class="identifier">side_strategy</span><span class="special">;</span>
525
526    <span class="comment">// Declare output</span>
527    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">multi_polygon</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;</span> <span class="identifier">result</span><span class="special">;</span>
528
529    <span class="comment">// Declare/fill a linestring</span>
530    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">linestring</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;</span> <span class="identifier">ls</span><span class="special">;</span>
531    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">read_wkt</span><span class="special">(</span><span class="string">"LINESTRING(0 0,4 5,7 4,10 6)"</span><span class="special">,</span> <span class="identifier">ls</span><span class="special">);</span>
532
533    <span class="comment">// Create the buffer of a linestring</span>
534    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">(</span><span class="identifier">ls</span><span class="special">,</span> <span class="identifier">result</span><span class="special">,</span>
535                <span class="identifier">distance_strategy</span><span class="special">,</span> <span class="identifier">side_strategy</span><span class="special">,</span>
536                <span class="identifier">join_strategy</span><span class="special">,</span> <span class="identifier">end_strategy</span><span class="special">,</span> <span class="identifier">circle_strategy</span><span class="special">);</span>
537
538
539    <span class="comment">// Declare/fill a multi point</span>
540    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">multi_point</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;</span> <span class="identifier">mp</span><span class="special">;</span>
541    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">read_wkt</span><span class="special">(</span><span class="string">"MULTIPOINT((3 3),(4 4),(6 2))"</span><span class="special">,</span> <span class="identifier">mp</span><span class="special">);</span>
542
543    <span class="comment">// Create the buffer of a multi point</span>
544    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">(</span><span class="identifier">mp</span><span class="special">,</span> <span class="identifier">result</span><span class="special">,</span>
545                <span class="identifier">distance_strategy</span><span class="special">,</span> <span class="identifier">side_strategy</span><span class="special">,</span>
546                <span class="identifier">join_strategy</span><span class="special">,</span> <span class="identifier">end_strategy</span><span class="special">,</span> <span class="identifier">circle_strategy</span><span class="special">);</span>
547
548
549    <span class="comment">// Declare/fill a multi_polygon</span>
550    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">multi_polygon</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;</span> <span class="identifier">mpol</span><span class="special">;</span>
551    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">read_wkt</span><span class="special">(</span><span class="string">"MULTIPOLYGON(((0 1,2 5,5 3,0 1)),((1 1,5 2,5 0,1 1)))"</span><span class="special">,</span> <span class="identifier">mpol</span><span class="special">);</span>
552
553    <span class="comment">// Create the buffer of a multi polygon</span>
554    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">(</span><span class="identifier">mpol</span><span class="special">,</span> <span class="identifier">result</span><span class="special">,</span>
555                <span class="identifier">distance_strategy</span><span class="special">,</span> <span class="identifier">side_strategy</span><span class="special">,</span>
556                <span class="identifier">join_strategy</span><span class="special">,</span> <span class="identifier">end_strategy</span><span class="special">,</span> <span class="identifier">circle_strategy</span><span class="special">);</span>
557
558
559    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
560<span class="special">}</span>
561</pre>
562<p>
563          </p>
564<h6>
565<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h8"></a>
566            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.the_linestring_case"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.the_linestring_case">The
567            linestring case</a>
568          </h6>
569<p>
570            <span class="inlinemediaobject"><img src="../../../../img/algorithms/buffer_linestring.png" alt="buffer_linestring"></span>
571          </p>
572<h6>
573<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h9"></a>
574            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.the_multi_point_case"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.the_multi_point_case">The
575            multi_point case</a>
576          </h6>
577<p>
578            <span class="inlinemediaobject"><img src="../../../../img/algorithms/buffer_multi_point.png" alt="buffer_multi_point"></span>
579          </p>
580<h6>
581<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h10"></a>
582            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.the_multi_polygon_case"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.the_multi_polygon_case">The
583            multi_polygon case</a>
584          </h6>
585<p>
586            <span class="inlinemediaobject"><img src="../../../../img/algorithms/buffer_multi_polygon.png" alt="buffer_multi_polygon"></span>
587          </p>
588<h6>
589<a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.h11"></a>
590            <span class="phrase"><a name="geometry.reference.algorithms.buffer.buffer_7_with_strategies.available_strategies"></a></span><a class="link" href="buffer_7_with_strategies.html#geometry.reference.algorithms.buffer.buffer_7_with_strategies.available_strategies">Available
591            Strategies</a>
592          </h6>
593<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
594<li class="listitem">
595                JoinStrategy: <a class="link" href="../../strategies/strategy_buffer_join_round.html" title="strategy::buffer::join_round">join_round
596                (cartesian)</a>
597              </li>
598<li class="listitem">
599                JoinStrategy: <a class="link" href="../../strategies/strategy_buffer_join_miter.html" title="strategy::buffer::join_miter">join_miter
600                (cartesian)</a>
601              </li>
602<li class="listitem">
603                EndStrategy: <a class="link" href="../../strategies/strategy_buffer_end_round.html" title="strategy::buffer::end_round">end_round
604                (cartesian)</a>
605              </li>
606<li class="listitem">
607                EndStrategy: <a class="link" href="../../strategies/strategy_buffer_end_flat.html" title="strategy::buffer::end_flat">end_flat
608                (cartesian)</a>
609              </li>
610<li class="listitem">
611                DistanceStrategy: <a class="link" href="../../strategies/strategy_buffer_distance_symmetric.html" title="strategy::buffer::distance_symmetric">distance_symmetric</a>
612              </li>
613<li class="listitem">
614                DistanceStrategy: <a class="link" href="../../strategies/strategy_buffer_distance_asymmetric.html" title="strategy::buffer::distance_asymmetric">distance_asymmetric</a>
615              </li>
616<li class="listitem">
617                PointStrategy: <a class="link" href="../../strategies/strategy_buffer_point_circle.html" title="strategy::buffer::point_circle">point_circle
618                (cartesian)</a>
619              </li>
620<li class="listitem">
621                PointStrategy: <a class="link" href="../../strategies/strategy_buffer_point_square.html" title="strategy::buffer::point_square">point_square
622                (cartesian)</a>
623              </li>
624<li class="listitem">
625                PointStrategy: <a class="link" href="../../strategies/strategy_buffer_geographic_point_circle.html" title="strategy::buffer::geographic_point_circle">geographic_point_circle
626                (geographic)</a>
627              </li>
628<li class="listitem">
629                SideStrategy: <a class="link" href="../../strategies/strategy_buffer_side_straight.html" title="strategy::buffer::side_straight">side_straight
630                (cartesian)</a>
631              </li>
632</ul></div>
633</div>
634<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
635<td align="left"></td>
636<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam
637      Wulkiewicz, Oracle and/or its affiliates<p>
638        Distributed under the Boost Software License, Version 1.0. (See accompanying
639        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>)
640      </p>
641</div></td>
642</tr></table>
643<hr>
644<div class="spirit-nav">
645<a accesskey="p" href="buffer_4.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../buffer.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="return_buffer.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
646</div>
647</body>
648</html>
649