id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 13072,boost::geometry::intersection different results for CCW and CW,kle@…,Barend Gehrels,"Hello,[[BR]] when calculating the intersection between these two polygons the results differ dependent on the orientation (CW vs CCW). {{{ #include #include #include int main(int argc, char* argv[]) { typedef boost::geometry::model::polygon, true, false > boost_polygon_CW_Open; typedef boost::geometry::model::polygon, false, false > boost_polygon_CCW_Open; const std::string strPoly1( ""POLYGON((986.53314901320903 603.61376367962623, 1014.6804499149767 602.74037774442763, 1018.1411735073581 623.97665453539310, 990.14493850604447 624.49725628790509))"" ); const std::string strPoly2( ""POLYGON((986.77183669558929 603.60635741124452, 998.79457181965154 603.23330253835934, 1002.2613711877982 623.79581100129735, 990.30090761267468 624.02156931285253))"" ); boost_polygon_CW_Open p1_cw_open, p2_cw_open; boost::geometry::read_wkt(strPoly1, p1_cw_open); boost::geometry::read_wkt(strPoly2, p2_cw_open); boost::geometry::correct(p1_cw_open); // reverts order of points boost::geometry::correct(p2_cw_open); // reverts order of points std::vector output_cw; boost::geometry::intersection(p1_cw_open, p2_cw_open, output_cw); // correct: output_cw.front equals poly2 boost_polygon_CCW_Open p1_ccw_open, p2_ccw_open; boost::geometry::read_wkt(strPoly1, p1_ccw_open); boost::geometry::read_wkt(strPoly2, p2_ccw_open); boost::geometry::correct(p1_ccw_open); // no modification boost::geometry::correct(p2_ccw_open); // no modification std::vector output_ccw; boost::geometry::intersection(p1_ccw_open, p2_ccw_open, output_ccw); // incorrect: output_cw is empty!!! return 0; } }}} ",Bugs,assigned,To Be Determined,geometry,Boost 1.64.0,Problem,,,