Boost logo

Geometry :

Subject: Re: [geometry] How could I get nodes(MBRs) of the R Tree
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2018-01-23 16:50:09


Hi Zhe,

Zhe Li Via Geometry wrote:
> Dear all,
>
> I'm currently doing some work related to spatial index. I'm going to use the
> generated MBRs of the R Tree to do some calculation. But in the official
> page there is not such interface. How could I extract these data?

Yes there is an interface but it is not "public". Have a look at this
directory:

https://github.com/boostorg/geometry/tree/develop/include/boost/geometry/index/detail/rtree/utilities

There is bg::index::detail::rtree::utilities::view<rtree> class allowing
you to access private members of the R-tree in order to use them with
your own node visitor. E.g. see how printing of the nodes is implemented
for debugging purposes:

visitor -
https://github.com/boostorg/geometry/blob/develop/include/boost/geometry/index/detail/rtree/utilities/print.hpp#L133
free function using the view and visitor -
https://github.com/boostorg/geometry/blob/develop/include/boost/geometry/index/detail/rtree/utilities/print.hpp#L200

Adam



Geometry list run by mateusz at loskot.net