Click here to Skip to main content
15,893,722 members
Articles / Web Development / HTML

Polyline Simplification

Rate me:
Please Sign up or sign in to vote.
4.93/5 (97 votes)
25 Jun 2011MPL28 min read 260.7K   12.4K   185  
A generic C++ implementation for n-dimensional Douglas-Peucker approximation
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>psimpl: psimpl Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">psimpl&#160;<span id="projectnumber">7</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="namespaces.html"><span>Namespace&#160;List</span></a></li>
      <li><a href="namespacemembers.html"><span>Namespace&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('namespacepsimpl.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">psimpl Namespace Reference</div>  </div>
</div>
<div class="contents">

<p>Root namespace of the polyline simplification library.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html">math</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Contains functions for calculating statistics and distances between various geometric entities. </p>
<br/></td></tr>
</p>
<tr><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1util.html">util</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Contains utility functions and classes. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpsimpl_1_1_polyline_simplification.html">PolylineSimplification</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides various simplification algorithms for n-dimensional simple polylines.  <a href="classpsimpl_1_1_polyline_simplification.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#a1a805a9e3eef7ca46bffae71a8b49dc0">simplify_nth_point</a> (ForwardIterator first, ForwardIterator last, unsigned n, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the nth point routine (NP).  <a href="#a1a805a9e3eef7ca46bffae71a8b49dc0"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#a12f4b63e11188c5293fe3effabbfba31">simplify_radial_distance</a> (ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the (radial) distance between points routine (RD).  <a href="#a12f4b63e11188c5293fe3effabbfba31"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#aa8c86b0f1529d529fc2ff84d09b00101">simplify_perpendicular_distance</a> (ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, unsigned repeat, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Repeatedly performs the perpendicular distance routine (PD).  <a href="#aa8c86b0f1529d529fc2ff84d09b00101"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#a71a8cbb4f1ebd41a5897c8174bdf8617">simplify_perpendicular_distance</a> (ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the perpendicular distance routine (PD).  <a href="#a71a8cbb4f1ebd41a5897c8174bdf8617"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#a0ae1a1e3ada43f9791ac6ac36df5fdf7">simplify_reumann_witkam</a> (ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs Reumann-Witkam polyline simplification (RW).  <a href="#a0ae1a1e3ada43f9791ac6ac36df5fdf7"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#a433d47ec86872f64bdc2bc792e6444ca">simplify_opheim</a> (ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type min_tol, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type max_tol, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs Opheim polyline simplification (OP).  <a href="#a433d47ec86872f64bdc2bc792e6444ca"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class BidirectionalIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#a241debcb1ad56aa1046f4a4996922411">simplify_lang</a> (BidirectionalIterator first, BidirectionalIterator last, typename std::iterator_traits&lt; BidirectionalIterator &gt;::value_type tol, unsigned look_ahead, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs Lang polyline simplification (LA).  <a href="#a241debcb1ad56aa1046f4a4996922411"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#ab71cedd762eee4006a85f4321fca6cad">simplify_douglas_peucker</a> (ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs Douglas-Peucker polyline simplification (DP).  <a href="#ab71cedd762eee4006a85f4321fca6cad"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#aeff1b138293ca9cfb855d7e1f69dacf5">simplify_douglas_peucker_n</a> (ForwardIterator first, ForwardIterator last, unsigned count, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a variant of Douglas-Peucker polyline simplification (DPn).  <a href="#aeff1b138293ca9cfb855d7e1f69dacf5"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#a187709033361ba469a60c3a848328118">compute_positional_errors2</a> (ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, OutputIterator result, bool *valid=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the squared positional error between a polyline and its simplification.  <a href="#a187709033361ba469a60c3a848328118"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class ForwardIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="structpsimpl_1_1math_1_1_statistics.html">math::Statistics</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl.html#a16418e391940b20609bc48289e7222a4">compute_positional_error_statistics</a> (ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, bool *valid=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes statistics for the positional errors between a polyline and its simplification.  <a href="#a16418e391940b20609bc48289e7222a4"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Root namespace of the polyline simplification library. </p>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a16418e391940b20609bc48289e7222a4"></a><!-- doxytag: member="psimpl::compute_positional_error_statistics" ref="a16418e391940b20609bc48289e7222a4" args="(ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, bool *valid=0)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structpsimpl_1_1math_1_1_statistics.html">math::Statistics</a> psimpl::compute_positional_error_statistics </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>original_first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>original_last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>simplified_first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>simplified_last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>valid</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Computes statistics for the positional errors between a polyline and its simplification. </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#a10af204d445105a8a4cbc81bd0563cb1" title="Computes statistics for the positional errors between a polyline and its simplification.">PolylineSimplification::ComputePositionalErrorStatistics</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">original_first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">original_last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">simplified_first</td><td>the first coordinate of the first simplified polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">simplified_last</td><td>one beyond the last coordinate of the last simplified polyline point </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">valid</td><td>[optional] indicates if the computed statistics are valid </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the computed statistics </dd></dl>

</div>
</div>
<a class="anchor" id="a187709033361ba469a60c3a848328118"></a><!-- doxytag: member="psimpl::compute_positional_errors2" ref="a187709033361ba469a60c3a848328118" args="(ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, OutputIterator result, bool *valid=0)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::compute_positional_errors2 </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>original_first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>original_last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>simplified_first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>simplified_last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool *&#160;</td>
          <td class="paramname"><em>valid</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Computes the squared positional error between a polyline and its simplification. </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#a6b3ed5157f5bf51ef7be179896cd2903" title="Computes the squared positional error between a polyline and its simplification.">PolylineSimplification::ComputePositionalErrors2</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">original_first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">original_last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">simplified_first</td><td>the first coordinate of the first simplified polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">simplified_last</td><td>one beyond the last coordinate of the last simplified polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the squared positional errors </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">valid</td><td>[optional] indicates if the computed positional errors are valid </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last computed positional error </dd></dl>

</div>
</div>
<a class="anchor" id="ab71cedd762eee4006a85f4321fca6cad"></a><!-- doxytag: member="psimpl::simplify_douglas_peucker" ref="ab71cedd762eee4006a85f4321fca6cad" args="(ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::simplify_douglas_peucker </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::iterator_traits&lt; ForwardIterator &gt;::value_type&#160;</td>
          <td class="paramname"><em>tol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Performs Douglas-Peucker polyline simplification (DP). </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#a75954f25bc0d99e0a756611ffa2b5fda" title="Performs Douglas-Peucker approximation (DP).">PolylineSimplification::DouglasPeucker</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tol</td><td>perpendicular (point-to-segment) distance tolerance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the simplified polyline </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the simplified polyline </dd></dl>

</div>
</div>
<a class="anchor" id="aeff1b138293ca9cfb855d7e1f69dacf5"></a><!-- doxytag: member="psimpl::simplify_douglas_peucker_n" ref="aeff1b138293ca9cfb855d7e1f69dacf5" args="(ForwardIterator first, ForwardIterator last, unsigned count, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::simplify_douglas_peucker_n </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Performs a variant of Douglas-Peucker polyline simplification (DPn). </p>
<p>This is a convenience function that provides template type deduction for PolylineSimplification::DouglasPeuckerAlt.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">count</td><td>the maximum number of points of the simplified polyline </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the simplified polyline </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the simplified polyline </dd></dl>

</div>
</div>
<a class="anchor" id="a241debcb1ad56aa1046f4a4996922411"></a><!-- doxytag: member="psimpl::simplify_lang" ref="a241debcb1ad56aa1046f4a4996922411" args="(BidirectionalIterator first, BidirectionalIterator last, typename std::iterator_traits&lt; BidirectionalIterator &gt;::value_type tol, unsigned look_ahead, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class BidirectionalIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::simplify_lang </td>
          <td>(</td>
          <td class="paramtype">BidirectionalIterator&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">BidirectionalIterator&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::iterator_traits&lt; BidirectionalIterator &gt;::value_type&#160;</td>
          <td class="paramname"><em>tol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>look_ahead</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Performs Lang polyline simplification (LA). </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#a34f6cdc9223e0e99c671e07a15086e3e" title="Performs Lang approximation (LA).">PolylineSimplification::Lang</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tol</td><td>perpendicular (point-to-segment) distance tolerance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">look_ahead</td><td>defines the size of the search region </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the simplified polyline </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the simplified polyline </dd></dl>

</div>
</div>
<a class="anchor" id="a1a805a9e3eef7ca46bffae71a8b49dc0"></a><!-- doxytag: member="psimpl::simplify_nth_point" ref="a1a805a9e3eef7ca46bffae71a8b49dc0" args="(ForwardIterator first, ForwardIterator last, unsigned n, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::simplify_nth_point </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Performs the nth point routine (NP). </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#ace21c52fe251f03dc87d17e2627f83ed" title="Performs the nth point routine (NP).">PolylineSimplification::NthPoint</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">n</td><td>specifies 'each nth point' </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the simplified polyline </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the simplified polyline </dd></dl>

</div>
</div>
<a class="anchor" id="a433d47ec86872f64bdc2bc792e6444ca"></a><!-- doxytag: member="psimpl::simplify_opheim" ref="a433d47ec86872f64bdc2bc792e6444ca" args="(ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type min_tol, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type max_tol, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::simplify_opheim </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::iterator_traits&lt; ForwardIterator &gt;::value_type&#160;</td>
          <td class="paramname"><em>min_tol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::iterator_traits&lt; ForwardIterator &gt;::value_type&#160;</td>
          <td class="paramname"><em>max_tol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Performs Opheim polyline simplification (OP). </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#a0b9bf4a27ef12a4eb103266f50c6eb7e" title="Performs Opheim approximation (OP).">PolylineSimplification::Opheim</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">min_tol</td><td>minimum distance tolerance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max_tol</td><td>maximum distance tolerance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the simplified polyline </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the simplified polyline </dd></dl>

</div>
</div>
<a class="anchor" id="a71a8cbb4f1ebd41a5897c8174bdf8617"></a><!-- doxytag: member="psimpl::simplify_perpendicular_distance" ref="a71a8cbb4f1ebd41a5897c8174bdf8617" args="(ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::simplify_perpendicular_distance </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::iterator_traits&lt; ForwardIterator &gt;::value_type&#160;</td>
          <td class="paramname"><em>tol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Performs the perpendicular distance routine (PD). </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#a2b10f2aeaec1cb48eb053b2b9f632c9c" title="Repeatedly performs the perpendicular distance routine (PD).">PolylineSimplification::PerpendicularDistance</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tol</td><td>perpendicular (segment-to-point) distance tolerance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the simplified polyline </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the simplified polyline </dd></dl>

</div>
</div>
<a class="anchor" id="aa8c86b0f1529d529fc2ff84d09b00101"></a><!-- doxytag: member="psimpl::simplify_perpendicular_distance" ref="aa8c86b0f1529d529fc2ff84d09b00101" args="(ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, unsigned repeat, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::simplify_perpendicular_distance </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::iterator_traits&lt; ForwardIterator &gt;::value_type&#160;</td>
          <td class="paramname"><em>tol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>repeat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Repeatedly performs the perpendicular distance routine (PD). </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#a2b10f2aeaec1cb48eb053b2b9f632c9c" title="Repeatedly performs the perpendicular distance routine (PD).">PolylineSimplification::PerpendicularDistance</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tol</td><td>perpendicular (segment-to-point) distance tolerance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">repeat</td><td>the number of times to successively apply the PD routine. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the simplified polyline </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the simplified polyline </dd></dl>

</div>
</div>
<a class="anchor" id="a12f4b63e11188c5293fe3effabbfba31"></a><!-- doxytag: member="psimpl::simplify_radial_distance" ref="a12f4b63e11188c5293fe3effabbfba31" args="(ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::simplify_radial_distance </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::iterator_traits&lt; ForwardIterator &gt;::value_type&#160;</td>
          <td class="paramname"><em>tol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Performs the (radial) distance between points routine (RD). </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#aa9f3491a3aa88e3b795705045053a649" title="Performs the (radial) distance between points routine (RD).">PolylineSimplification::RadialDistance</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tol</td><td>radial (point-to-point) distance tolerance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the simplified polyline </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the simplified polyline </dd></dl>

</div>
</div>
<a class="anchor" id="a0ae1a1e3ada43f9791ac6ac36df5fdf7"></a><!-- doxytag: member="psimpl::simplify_reumann_witkam" ref="a0ae1a1e3ada43f9791ac6ac36df5fdf7" args="(ForwardIterator first, ForwardIterator last, typename std::iterator_traits&lt; ForwardIterator &gt;::value_type tol, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class ForwardIterator , class OutputIterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">OutputIterator psimpl::simplify_reumann_witkam </td>
          <td>(</td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>first</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ForwardIterator&#160;</td>
          <td class="paramname"><em>last</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::iterator_traits&lt; ForwardIterator &gt;::value_type&#160;</td>
          <td class="paramname"><em>tol</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">OutputIterator&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Performs Reumann-Witkam polyline simplification (RW). </p>
<p>This is a convenience function that provides template type deduction for <a class="el" href="classpsimpl_1_1_polyline_simplification.html#ae938c132f029b4e8e828f5e6c7ee4b16" title="Performs Reumann-Witkam approximation (RW).">PolylineSimplification::ReumannWitkam</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first coordinate of the first polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last coordinate of the last polyline point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tol</td><td>perpendicular (point-to-line) distance tolerance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>destination of the simplified polyline </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the simplified polyline </dd></dl>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacepsimpl.html">psimpl</a>      </li>
      <li class="footer">Generated on Fri Jun 24 2011 14:56:29 for psimpl by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
    </ul>
  </div>

</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Mozilla Public License 1.1 (MPL 1.1)


Written By
Software Developer Optiver
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions