id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 10647,backlog in for_each_range.hpp causes incorrect result of disjoint,Petr Doubrava ,Barend Gehrels,"simple test program, Polygon poly2 is entirely within the hole in the polygon poly1, the result of disjonit may be true, but is false. {{{ #include #include #include #include void test_polygon_disjoint() { typedef boost::geometry::model::point Point; boost::geometry::model::polygon poly1, poly2; boost::geometry::read_wkt(""POLYGON((0.0 0.0, 0.0 5.0, 5.0 5.0, 5.0 0.0, 0.0 0.0)(1.0 1.0, 4.0 1.0, 4.0 4.0, 1.0 4.0, 1.0 1.0))"", poly1); boost::geometry::correct(poly1); boost::geometry::read_wkt(""POLYGON((2.0 2.0, 2.0 3.0, 3.0 3.0, 3.0 2.0, 2.0 2.0))"", poly2); boost::geometry::correct(poly2); bool res=boost::geometry::disjoint(poly1,poly2); assert(res==true); // res is false :-( } int main(int argc, char* argv[]) { test_polygon_disjoint(); return 0; } }}} The reason is probably this backlog in boost\geometry\algorithms\detail\for_each_range.hpp {{{ ... template struct fe_range_polygon { static inline void apply(Polygon & polygon, Actor & actor) { actor.apply(exterior_ring(polygon)); // TODO: If some flag says true, also do the inner rings. // for convex hull, it's not necessary } }; ... }}} I created this workaround and disjoint works correctly in this case. {{{ template struct fe_range_polygon { static inline void apply(Polygon & polygon, Actor & actor) { actor.apply(exterior_ring(polygon)); if (actor.has_within) { Polygon::inner_container_type::const_iterator it=interior_rings(polygon).begin(); for (;it!=interior_rings(polygon).end();++it) { actor.apply(*it); if (actor.has_within) { actor.has_within = false; break; } } } } }; }}}",Bugs,closed,To Be Determined,geometry,Boost 1.56.0,Problem,fixed,,