-
I am looking for the boost tree's size after bulk loading my data into boost Rtree, and I found it is hard to traverse the whole tree to get the sizes I am looking for. So is there any possibility that can get the entire R-tree's size in bytes by traversing the whole tree ( all internal node and leaf node)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I don't know what would you like to do exactly and what do you mean by "sizes". But here is the general answer: The number of elements is returned by The bounding box enclosing all of the elements is returned by You can iterate through all of the elements stored in the rtree using The numbers of internal nodes, leafs and other statistics can be gathered using this utility: If you need something else you have to write your own visitor using the |
Beta Was this translation helpful? Give feedback.
I don't know what would you like to do exactly and what do you mean by "sizes". But here is the general answer:
The number of elements is returned by
rtree.size()
The bounding box enclosing all of the elements is returned by
rtree.bounds()
You can iterate through all of the elements stored in the rtree using
rtree.begin()
andrtree.end()
or just using the rtree in range for loop.The numbers of internal nodes, leafs and other statistics can be gathered using this utility:
https://github.com/boostorg/geometry/blob/develop/include/boost/geometry/index/detail/rtree/utilities/statistics.hpp#L91
If you need something else you have to write your own visitor using the
view
used by the utilities …