'How to get all bounds from boost::rtree
I have a built boost rtree:
using CBGPoint3d = boost::geometry::model::point<float, 3, boost::geometry::cs::cartesian>;
using CBGBox3D = boost::geometry::model::box<CBGPoint3d>;
using CBGTreeItem = std::pair<CBGBox3D, CEntityLoaderBase*>;
boost::geometry::index::rtree<CBGTreeItem, boost::geometry::index::dynamic_rstar> m_tree;
I can iterate through leaf nodes:
for (auto const& v : m_tree)
//do something
I can get root bounds:
m_tree.bounds();
But how can I get other level bounds ? There is no bounds iterator....
Solution 1:[1]
This is not a part of the official interface but it is possible to traverse the R-tree manually. You have to implement your own node visitor and use bgi::detail::rtree::utilities::view<Rtree> to apply it to the root node. Have a look at the utilities in this directory:
in particular the one checking correctness of bounding boxes in the hierarchy:
and the one gathering statistics about the internal structure of the R-tree:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Adam Wulkiewicz |
