id summary reporter owner description type status milestone component version severity resolution keywords cc 10421 Wrong Pt/Box distance/comparable_distance results in spherical CS awulkiew Barend Gehrels "distance(Pt, Box) and comparable_distance(Pt, Box) returns invalid results in some cases, or at least not-corresponding to the Pt/Pt versions. E.g. for: {{{ point target(10.932501600000000, 59.922640600000001); point pt(10.7535660, 59.9131705); point pmin(10.187599199999999, 59.747306700000003); point pmax(10.753619700000000, 59.917844000000002); box bounding_box(pmin, pmax); bool target_inside_box = bg::covered_by(target, bounding_box); bool point_inside_box = bg::covered_by(pt, bounding_box); // the same for bg::comparable_distance() double dp = bg::distance(target, pt); double db = bg::distance(target, bounding_box); double dm = bg::distance(target, pmax); }}} The results are: {{{ target inside box = FALSE point inside box = TRUE target to point = 0.00157408 target to box = 0.178946 target to max = 0.00156704 }}} Since the point lies inside the box and target outside the box the distance from target to box should be smaller than from target to point. This bug affects the R-tree and is related with this ticket: [https://svn.boost.org/trac/boost/ticket/9759 boost::geometry::index::rtree does not work properly spherical_equatorial]. EDIT: The algorithm uses the cartesian pythagoras_point_box strategy to calculate the distance." Bugs closed Boost 1.57.0 geometry Boost 1.56.0 Problem fixed