Boost C++ Libraries: Ticket #8380: sym_difference yields bad result for large numbers https://svn.boost.org/trac10/ticket/8380 <p> Here is an example where using a relatively small number yields the correct result whereas using <em>boost::numeric::bounds&lt;int&gt;::highest()/2</em> yields a bad result when calling boost::geometry::sym_difference. </p> <p> My polygon type is <strong>oriented counter-clockwise</strong> and <strong>not closed</strong>, my point type is based on <strong>int</strong>. Based on using int, can you offer any guidance about the largest possible numbers ("domain of definition") that yield correct results in the boost geometry algorithms? </p> <p> Here is our conversation on the geometry mailing list regarding this issue in 1.48.0:<br /> <a class="ext-link" href="http://lists.boost.org/geometry/2012/02/1849.php"><span class="icon">​</span>http://lists.boost.org/geometry/2012/02/1849.php</a> </p> <p> For readability, I use the <code>^</code> operator to denote the call to sym_difference below. </p> <pre class="wiki">MULTIPOLYGON(((564 2394,1548 2850,2526 2916,2526 32767,564 32767))) ^ MULTIPOLYGON(((564 3252,2526 3252,2526 32767,564 32767))) correct result: MULTIPOLYGON(((564 3252,564 2394,1548 2850,2526 2916,2526 3252))) MULTIPOLYGON(((564 2394,1548 2850,2526 2916,2526 1073741823,564 1073741823))) ^ MULTIPOLYGON(((564 3252,2526 3252,2526 1073741823,564 1073741823))) bad result: MULTIPOLYGON(((564 3252,564 2394,1548 2850,2526 2916,2526 333411))) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8380 Trac 1.4.3 Volker Schöch <vschoech@…> Thu, 14 Nov 2013 12:03:28 GMT <link>https://svn.boost.org/trac10/ticket/8380#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8380#comment:1</guid> <description> <p> I cannot reproduce this problem in neither boost 1.52.0 not boost 1.55.0. The original reproduction was based on boost 1.48.0. Has this issue been fixed? </p> </description> <category>Ticket</category> </item> <item> <author>Volker Schöch <vschoech@…></author> <pubDate>Wed, 15 Oct 2014 15:29:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8380#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8380#comment:2</guid> <description> <p> A related issue came up in boost 1.56.0, see Ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/10658" title="#10658: Bugs: sym_difference yields bad result for int polygons (closed: fixed)">#10658</a>. </p> </description> <category>Ticket</category> </item> <item> <author>vschoech@…</author> <pubDate>Mon, 21 Sep 2015 14:37:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8380#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8380#comment:3</guid> <description> <p> A related issue came up in boost 1.59.0, see Ticket <a class="new ticket" href="https://svn.boost.org/trac10/ticket/11675" title="#11675: Bugs: sym_difference yields bad result for int polygons (new)">#11675</a>. </p> </description> <category>Ticket</category> </item> </channel> </rss>