Template Class rtree

Inheritance Relationships

Base Type

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

using coord_type = typename spec_type::coord_type
using element_type = typename spec_type::element_type
using geometry_type = typename spec_type::geometry_type
using spec_type = TSpecType
using value_type = typename spec_type::value_type

Public Functions

rtree(const rtree&) = delete
rtree(rtree&&) = delete
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 by ll, 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 to point.

const rtree &operator=(const rtree&) = delete
rtree &operator=(rtree&&) = delete
RCPPSW_WRAP_DECLDEF(insert)
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).