id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 11675,sym_difference yields bad result for int polygons,vschoech@…,Barend Gehrels,"My ""_TPolygon"" type is actually a '''multi-polygon''', based on a polygon type that is oriented '''counter-clockwise''' and '''open''' (not closed). Please consider the following example, which apparently works fine: {{{ tc::geo::polygon polygonA; // tc::geo::polygon<...> is actually a MULTIPOLYGON, with polygons oriented COUNTER-CLOCKWISE and OPEN (not closed). boost::geometry::read_wkt(""MULTIPOLYGON(((564 2394,1548 2850,2526 2916,2526 1073741823,564 1073741823,564 2394)))"", polygonA); // does not throw boost::geometry::is_valid(polygonA); // returns true tc::geo::polygon polygonB; boost::geometry::read_wkt(""MULTIPOLYGON(((564 3252,2526 3252,2526 1073741823,564 1073741823,564 3252)))"", polygonB); // does not throw boost::geometry::is_valid(polygonB); // returns true tc::geo::polygon polygonC; boost::geometry::sym_difference(polygonA, polygonB, polygonC); // does not throw boost::geometry::is_valid(polygonC); // returns true // polygonC is now ""MULTIPOLYGON(((564 3252,564 2394,1548 2850,2526 2916,2526 3252,564 3252)))"" }}} Note: ''std::numeric_limits::max()/2 == 1073741823'' Now, simply replace '''double''' by '''int''': {{{ tc::geo::polygon polygonA; // tc::geo::polygon<...> is actually a MULTIPOLYGON, with polygons oriented COUNTER-CLOCKWISE and OPEN (not closed). boost::geometry::read_wkt(""MULTIPOLYGON(((564 2394,1548 2850,2526 2916,2526 1073741823,564 1073741823,564 2394)))"", polygonA); // does not throw boost::geometry::is_valid(polygonA); // returns true tc::geo::polygon polygonB; boost::geometry::read_wkt(""MULTIPOLYGON(((564 3252,2526 3252,2526 1073741823,564 1073741823,564 3252)))"", polygonB); // does not throw boost::geometry::is_valid(polygonB); // returns true tc::geo::polygon polygonC; boost::geometry::sym_difference(polygonA, polygonB, polygonC); // does not throw boost::geometry::is_valid(polygonC); // returns true TRACE( ""===================== polygonC2="" << polygonC ); // polygonC is now ""MULTIPOLYGON(((564 3252,564 2394,1548 2850,2526 2916,2526 *!*333412*!*,564 3252)))"" }}} As you can see, one value is completely off. This seems to happen reliably whenever the input is based on int and contains large numbers. This issue may be related to Ticket #10658.",Bugs,new,To Be Determined,geometry,Boost 1.59.0,Problem,,"sym_difference, polygon, large numbers, domain of definition, integer",