Boost C++ Libraries: Ticket #8375: sym_difference of non-closed polygons returns closed polygon https://svn.boost.org/trac10/ticket/8375 <p> The output multi-polygon from boost::geometry::sym_difference should have the same orientation, closed-ness and underlying scalar data type, as the input (multi-)polygons. My polygon type is oriented <strong>counter-clockwise</strong> and <strong>not closed</strong>, my point type is based on <strong>int</strong>. Please find below some code that results in a <strong>closed</strong> polygon. </p> <p> This is the data used as input to sym_difference: </p> <pre class="wiki">_TPolygon&lt;int&gt; const polygonB = _TPolygon&lt;int&gt;("MULTIPOLYGON(((813 277,1341 319,1863 361,2391 571,2913 361,3441 319,3963 277,3963 32767,813 32767)))") ^ _TPolygon&lt;int&gt;("MULTIPOLYGON(((813 277,1341 319,1863 571,2391 571,2913 571,3441 319,3963 277,3963 32767,813 32767)))"); </pre><p> This is the resulting multi-polygon, consisting of two closed polygons: </p> <pre class="wiki">polygonB: MULTIPOLYGON(((2391 571,1863 571,1341 319,1863 361,2391 571)),((2391 571,2913 361,3441 319,2913 571,2391 571))) </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::sym_difference(*this, geometry, polygonOut); // 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/8375 Trac 1.4.3 Volker Schöch <vschoech@…> Wed, 03 Apr 2013 11:55:40 GMT <link>https://svn.boost.org/trac10/ticket/8375#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8375#comment:1</guid> <description> <p> Our conversation on the geometry mailing list regarding this issue in 1.48.0: <a class="ext-link" href="http://lists.boost.org/geometry/2012/02/1857.php"><span class="icon">​</span>http://lists.boost.org/geometry/2012/02/1857.php</a> </p> </description> <category>Ticket</category> </item> <item> <author>Volker Schöch <vschoech@…></author> <pubDate>Wed, 03 Apr 2013 13:14:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8375#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8375#comment:2</guid> <description> <p> The difference algorithm has the same problem which I filed as a separate ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8376" title="#8376: Bugs: difference of non-closed polygons returns closed polygon (closed: fixed)">#8376</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Barend Gehrels</dc:creator> <pubDate>Sat, 24 Aug 2013 23:00:02 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/8375#comment:3 https://svn.boost.org/trac10/ticket/8375#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket anonymous Thu, 14 Nov 2013 07:41:50 GMT version changed https://svn.boost.org/trac10/ticket/8375#comment:4 https://svn.boost.org/trac10/ticket/8375#comment:4 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.52.0</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> </ul> <p> Still reproducible with boost 1.55.0. </p> Ticket vschoech@… Thu, 14 Nov 2013 07:42:51 GMT <link>https://svn.boost.org/trac10/ticket/8375#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8375#comment:5</guid> <description> <p> Sorry for "anonymous" in the previous comment. That was me. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>mkaravel</dc:creator> <pubDate>Fri, 01 Aug 2014 14:05:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8375#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8375#comment:6</guid> <description> <p> See attached test program and output, as well as comments in ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9828" title="#9828: Bugs: boost::geometry::union_(...) creates redundant closing point (closed: fixed)">#9828</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>mkaravel</dc:creator> <pubDate>Fri, 01 Aug 2014 14:05:48 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/8375 https://svn.boost.org/trac10/ticket/8375 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ticket_8375.cpp</span> </li> </ul> <p> stand-along program for reproducing ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8375" title="#8375: Bugs: sym_difference of non-closed polygons returns closed polygon (closed: fixed)">#8375</a> </p> Ticket mkaravel Fri, 01 Aug 2014 14:06:27 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8375#comment:7 https://svn.boost.org/trac10/ticket/8375#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</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 14:07:36 GMT attachment set https://svn.boost.org/trac10/ticket/8375 https://svn.boost.org/trac10/ticket/8375 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ticket_8375.out</span> </li> </ul> <p> output of test program for ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8375" title="#8375: Bugs: sym_difference of non-closed polygons returns closed polygon (closed: fixed)">#8375</a> (corrected) </p> Ticket mkaravel Tue, 05 Aug 2014 06:57:39 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/8375#comment:8 https://svn.boost.org/trac10/ticket/8375#comment:8 <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:57:57 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/8375#comment:9 https://svn.boost.org/trac10/ticket/8375#comment:9 <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> <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