Boost C++ Libraries: Ticket #9828: boost::geometry::union_(...) creates redundant closing point https://svn.boost.org/trac10/ticket/9828 <p> Polygons created by boost::geometry algorithms should conform to the same rules as the input. In the following example, boost::geometry::union_ takes two simple, non-empty rectangular polygons and creates a polygon with a redundant closing point. My polygon type is oriented <strong>counter-clockwise</strong> and <strong>not closed</strong>, my point type is based on <strong>int</strong>. </p> <p> This is the data used as input to union: </p> <pre class="wiki">_TPolygon&lt;int&gt; const polygon = _TPolygon&lt;int&gt;("MULTIPOLYGON(((3398 1759,3592 1759,3592 1893,3398 1893)))") | _TPolygon&lt;int&gt;( "MULTIPOLYGON(((3592 1893,3592 1759,3910 1759,3910 1893)))" ); </pre><p> This is the resulting multi-polygon with the redundant closing point: </p> <pre class="wiki">MULTIPOLYGON(((3592 1893,3398 1893,3398 1759,3592 1759,3910 1759,3910 1893,3592 1893))) </pre><p> This is my code that wraps boost::geometry to implement the operator used above: </p> <pre class="wiki">template&lt;typename T&gt; template&lt;typename Geometry&gt; _TPolygon&lt; T &gt; _TPolygon&lt; T &gt;::operator|(Geometry const&amp; geometry) const { _TPolygon&lt; T &gt; polygonOut; boost::geometry::union_(*this, geometry, polygonOut); // the following line fixes the problem but should not be necessary //boost::geometry::correct( polygonOut ); return polygonOut; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9828 Trac 1.4.3 mkaravel Fri, 01 Aug 2014 12:20:56 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9828#comment:1 https://svn.boost.org/trac10/ticket/9828#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> See attached file ticket_9828.cpp and its output in file ticket_9828.out. </p> <p> The output polygon is indeed open as you can see from the dsv output of the result, as well as from the number of points that I also print out. The WKT output/description (in develop branch or in the upcoming boost 1.56) "closes" the polygon by default, so it is not a safe way for determining whether polygons are closed or not. </p> Ticket mkaravel Fri, 01 Aug 2014 12:21:18 GMT cc set https://svn.boost.org/trac10/ticket/9828#comment:2 https://svn.boost.org/trac10/ticket/9828#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">mkaravel</span> added </li> </ul> Ticket mkaravel Fri, 01 Aug 2014 13:52:09 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/9828#comment:3 https://svn.boost.org/trac10/ticket/9828#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">invalid</span> </li> </ul> Ticket mkaravel Fri, 01 Aug 2014 13:52:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9828#comment:4 https://svn.boost.org/trac10/ticket/9828#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> Ticket mkaravel Fri, 01 Aug 2014 13:57:09 GMT attachment set https://svn.boost.org/trac10/ticket/9828 https://svn.boost.org/trac10/ticket/9828 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ticket_9828.cpp</span> </li> </ul> <p> stand-along program for reproducing the ticket </p> Ticket mkaravel Fri, 01 Aug 2014 13:58:53 GMT attachment set https://svn.boost.org/trac10/ticket/9828 https://svn.boost.org/trac10/ticket/9828 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ticket_9828.out</span> </li> </ul> <p> output of the ticket_9828.cpp program (corrected) </p> Ticket mkaravel Tue, 05 Aug 2014 06:58:59 GMT milestone changed https://svn.boost.org/trac10/ticket/9828#comment:5 https://svn.boost.org/trac10/ticket/9828#comment:5 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> Ticket mkaravel Tue, 05 Aug 2014 06:59:10 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/9828#comment:6 https://svn.boost.org/trac10/ticket/9828#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">worksforme</span> </li> </ul> Ticket mkaravel Tue, 05 Aug 2014 06:59:16 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9828#comment:7 https://svn.boost.org/trac10/ticket/9828#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket