Opened 10 years ago
Last modified 7 years ago
#8380 new Bugs
sym_difference yields bad result for large numbers
Reported by: | Owned by: | Barend Gehrels | |
---|---|---|---|
Milestone: | To Be Determined | Component: | geometry |
Version: | Boost 1.52.0 | Severity: | Problem |
Keywords: | sym_difference, polygon, large numbers, domain of definition | Cc: |
Description
Here is an example where using a relatively small number yields the correct result whereas using boost::numeric::bounds<int>::highest()/2 yields a bad result when calling boost::geometry::sym_difference.
My polygon type is oriented counter-clockwise and not closed, my point type is based on int. 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?
Here is our conversation on the geometry mailing list regarding this issue in 1.48.0:
http://lists.boost.org/geometry/2012/02/1849.php
For readability, I use the ^
operator to denote the call to sym_difference below.
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)))
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?