Boost C++ Libraries: Ticket #12929: linestring with zero points or a single point is not equal to itself https://svn.boost.org/trac10/ticket/12929 <p> I expect a linestring with zero points or a single point is equal to itself. However, this is not the case for <code>boost::geometry::equals</code> even though the documentation says </p> <blockquote> <p> Checks if a geometry are spatially equal. </p> </blockquote> <blockquote> <p> Spatially equal means that the same point set is included. </p> </blockquote> <p> I expect a linestring with zero points to be equal to all empty point sets. I expect a linestring with a single point to be equal to all single point sets where the single points are equal. </p> <div class="wikipage" style="font-size: 80%"><p> Example: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;iostream&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/geometry.hpp&gt;</span><span class="cp"></span> <span class="k">namespace</span> <span class="n">bg</span> <span class="o">=</span> <span class="n">boost</span><span class="o">::</span><span class="n">geometry</span><span class="p">;</span> <span class="k">using</span> <span class="n">point</span> <span class="o">=</span> <span class="n">bg</span><span class="o">::</span><span class="n">model</span><span class="o">::</span><span class="n">point</span><span class="o">&lt;</span><span class="kt">double</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="n">bg</span><span class="o">::</span><span class="n">cs</span><span class="o">::</span><span class="n">cartesian</span><span class="o">&gt;</span><span class="p">;</span> <span class="k">using</span> <span class="n">linestring</span> <span class="o">=</span> <span class="n">bg</span><span class="o">::</span><span class="n">model</span><span class="o">::</span><span class="n">linestring</span><span class="o">&lt;</span><span class="n">point</span><span class="o">&gt;</span><span class="p">;</span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="n">linestring</span> <span class="n">empty</span><span class="p">;</span> <span class="n">linestring</span> <span class="n">single_point_linestring</span> <span class="p">{{</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">}};</span> <span class="n">linestring</span> <span class="n">single_point_linestring_2</span> <span class="p">{{</span><span class="mf">0.0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">}};</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;empty == empty := &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">bg</span><span class="o">::</span><span class="n">equals</span><span class="p">(</span><span class="n">empty</span><span class="p">,</span> <span class="n">empty</span><span class="p">)</span> <span class="o">&lt;&lt;</span> <span class="sc">&#39;\n&#39;</span><span class="p">;</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;single_point_linestring == single_point_linestring := &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">bg</span><span class="o">::</span><span class="n">equals</span><span class="p">(</span><span class="n">single_point_linestring</span><span class="p">,</span> <span class="n">single_point_linestring</span><span class="p">)</span> <span class="o">&lt;&lt;</span> <span class="sc">&#39;\n&#39;</span><span class="p">;</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;single_point_linestring == single_point_linestring_2 := &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">bg</span><span class="o">::</span><span class="n">equals</span><span class="p">(</span><span class="n">single_point_linestring</span><span class="p">,</span> <span class="n">single_point_linestring_2</span><span class="p">)</span> <span class="o">&lt;&lt;</span> <span class="sc">&#39;\n&#39;</span><span class="p">;</span> <span class="p">}</span> </pre></div></div></div><div class="wikipage" style="font-size: 80%"><p> Output: </p> <pre class="wiki">empty == empty := 0 single_point_linestring == single_point_linestring := 0 single_point_linestring == single_point_linestring_2 := 0 </pre></div><div class="wikipage" style="font-size: 80%"><p> Expected: </p> <pre class="wiki">empty == empty := 1 single_point_linestring == single_point_linestring := 1 single_point_linestring == single_point_linestring_2 := 1 </pre></div> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12929 Trac 1.4.3