Template Class rtree
Defined in File rtree.hpp
Inheritance Relationships
Base Type
private rcppsw::patterns::decorator::decorator< TSpecType::tree_type >
(Template Class decorator)
Class Documentation
-
template<typename TSpecType>
class rtree : private rcppsw::patterns::decorator::decorator<TSpecType::tree_type> Wrapper around boost::geometry::index::rtree to provide very fast queries of the form “How many things are in this area”, and reasonably fast tree build times as well. That is, this class is intended for applications in which large trees are built, queried frequently and updated relatively infrequently.
- Template Parameters:
TSpecType – The specification for the rtree of type rtree_spec.
Public Types
Public Functions
-
rtree(void) = default
-
inline bool contains(const value_type &key) const
Query the tree to see if
key
is found in the tree. This query does not take advantage of tree properties, and is O(N).
-
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
-
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
-
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
-
inline void insert(const value_type &value, const geometry_type &key)
Insert the
key
into the tree, which will be placed into the tree according to its rectangle defined byll
,ur
.
-
inline std::vector<value_type> intersections(const rtree_box<coord_type> &query) const
Query the tree to figure out how many objects intersect the rectangle
query
.
-
inline std::vector<value_type> nearest(const rtree_point<coord_type> &query, size_t k) const
Query the tree to find the
k
nearest objects topoint
.
-
inline size_t remove(const value_type &value)
Remove the
key
and its associated rectangle from the tree. Does not take advantage of tree properties, and therefore is O(N).- Returns:
The # of items removed (0 or 1).
-
inline size_t remove(const value_type &value, const geometry_type &key)
Remove the
key
and its associated rectangle from the tree.- Returns:
The # of items removed (0 or 1).