diff --git a/include/boost/geometry/extensions/index/pushable_array.hpp b/include/boost/geometry/extensions/index/pushable_array.hpp index f1bd18e33..538a6f0f6 100644 --- a/include/boost/geometry/extensions/index/pushable_array.hpp +++ b/include/boost/geometry/extensions/index/pushable_array.hpp @@ -46,7 +46,7 @@ public: m_size = s; } - inline void reserve(size_type s) + inline void reserve(size_type /*s*/) { //BOOST_GEOMETRY_INDEX_ASSERT(s <= Capacity, "size too big"); // do nothing diff --git a/include/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp b/include/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp index 85aa5eb05..77fdb782a 100644 --- a/include/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp +++ b/include/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp @@ -27,11 +27,11 @@ class are_boxes_ok typedef typename rtree::leaf::type leaf; public: - inline are_boxes_ok(Translator const& tr) - : result(false), m_tr(tr), m_is_root(true) + are_boxes_ok(Translator const& tr, bool exact_match) + : result(false), m_tr(tr), m_is_root(true), m_exact_match(exact_match) {} - inline void operator()(internal_node const& n) + void operator()(internal_node const& n) { typedef typename rtree::elements_type::type elements_type; elements_type const& elements = rtree::elements(n); @@ -69,10 +69,13 @@ public: geometry::expand(box_exp, it->first); } - result = m_is_root || geometry::equals(box_exp, m_box); + if ( m_exact_match ) + result = m_is_root || geometry::equals(box_exp, m_box); + else + result = m_is_root || geometry::covered_by(box_exp, m_box); } - inline void operator()(leaf const& n) + void operator()(leaf const& n) { typedef typename rtree::elements_type::type elements_type; elements_type const& elements = rtree::elements(n); @@ -94,7 +97,10 @@ public: geometry::expand(box_exp, m_tr(*it)); } - result = geometry::equals(box_exp, m_box); + if ( m_exact_match ) + result = geometry::equals(box_exp, m_box); + else + result = geometry::covered_by(box_exp, m_box); } else result = true; @@ -106,12 +112,14 @@ private: Translator const& m_tr; Box m_box; bool m_is_root; + bool m_exact_match; }; }}} // namespace detail::rtree::visitors template -bool are_boxes_ok(rtree const& tree) +bool are_boxes_ok(rtree const& tree, + bool exact_match = true) { typedef rtree rt; detail::rtree::visitors::are_boxes_ok< @@ -120,7 +128,7 @@ bool are_boxes_ok(rtree const& tree) typename rt::translator_type, typename rt::box_type, typename rt::allocators_type - > v(tree.translator()); + > v(tree.translator(), exact_match); tree.apply_visitor(v);