title: How to get a polygon from boost::geometry::model::polygon?
body: <p>I'm trying to calculate a difference of two polygons using <code>boost::geometry::difference</code> with <code>boost::geometry::model::polygon</code> representing my polygons.</p>
  
  <p>In case when the first polygon contains the second one result of the operation is a single <code>boost::geometry::model::polygon</code> with the inner and outer rings populated with coordinates of the source polygons.</p>
  
  <p>How do I get a polygon (<a href="https://en.wikipedia.org/wiki/Polygon" rel="nofollow noreferrer">in the elementary geometry sense</a>) from <code>boost::geometry::model::polygon</code>?</p>
  
  <p><strong>Clarification:</strong></p>
  
  <blockquote>
    <p>In elementary geometry, a polygon is a plane figure that is bounded by a finite chain of straight line segments closing in a loop to form a closed chain or circuit.</p>
  </blockquote>
  
  <p>The outer ring of <code>boost::geometry::model::polygon</code> is a polygon, the inner rings are polygons too. As a whole <code>boost::geometry::model::polygon</code> is not a polygon.</p>
  
  <p>So, what I'm asking: How to convert <code>boost::geometry::model::polygon</code> to a <em>normal</em> polygon (having a single chain of straight line segments), which represents the same area on a plane.</p>
  
  <p><strong>Here's what I'm trying to achieve:</strong></p>
  
  <pre><code>polygon1   = (0,0), (0,8), (8,8), (8,0), (0,0)
  polygon2   = (2,2), (2,6), (6,6), (6,2), (2,2)
  </code></pre>
  
  <p>Polygons 1 &amp; 2 in green / oker: <img src="https://i.stack.imgur.com/rh89N.png" width="150"/> </p>
  
  <pre><code>difference = (0,0), (0,4), (2,4), (2,2), (6,2), (6,6), (2,6), (2,4), (0,4), (0,8), (8,8), (8,0), (0,0)
  </code></pre>
  
  <p>Expected difference in grey: <img src="https://i.stack.imgur.com/akxtv.png" width="150"/> </p>
  
  <p>I know the same <code>boost::geometry::model::polygon</code> having inner rings could be represented by infinitely many different <em>normal</em> polygons. I don't care which one I get.</p>