title: An algorithm for inflating/deflating (offsetting, buffering) polylines
body: <p>Related Question:<br />
  <a href="https://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-buffering-polygons">An algorithm for inflating/deflating (offsetting, buffering) polygons</a></p>
  <p>The difference is that I'm searching for a way to inflate a given polyline into a polygon:</p>
  <p><img src="https://i.stack.imgur.com/pVkC9.png" alt="polyline with a box around" /></p>
  <p>I've got the following input:</p>
  <ul>
  <li>List of 2D Points which form the polyline (bright green in the sketch)</li>
  <li>Width of the line</li>
  </ul>
  <p>The output should be a polygon which shows how the line looks expanded by the width.</p>
  <p>I originally thought I could use <a href="https://www.boost.org/doc/libs/1_54_0/libs/geometry/doc/html/geometry/reference/algorithms/buffer/buffer.html" rel="nofollow noreferrer">Boost::Geometry::buffer</a> for that, unfortunately it just seems to support boxes for now. A solution using <a href="https://www.boost.org/doc/libs/1_54_0/libs/geometry/doc/html/index.html" rel="nofollow noreferrer">Boost::Geometry</a> or <a href="https://gdal.org/" rel="nofollow noreferrer">GDAL/OGR</a> would be preffered.</p>
  <p><strong>UPDATE:</strong><br />
  I chose to use the Clipper Library and its <a href="https://web.archive.org/web/20130913025704/http://www.angusj.com:80/delphi/clipper/documentation/Docs/Units/ClipperLib/Routines/OffsetPolyLines.htm" rel="nofollow noreferrer">OffsetPolyLines</a> function. As soon as Boost Geometry is released with Polyline-Buffer support I'll switch to Boost (as everything else runs with Boost in my software).</p>