boost::geometry::index::rtree
rtree.hpp
boost::geometry::index::rtree::members_holder
typename Value Value
typename Parameters Parameters
typename IndexableGetter IndexableGetter index::indexable<Value>
typename EqualTo EqualTo index::equal_to<Value>
typename Allocator Allocator std::allocator<Value>
Value typedef Value boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::value_type value_type

The type of Value stored in the container.

Parameters typedef Parameters boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::parameters_type parameters_type

R-tree parameters type.

IndexableGetter typedef IndexableGetter boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::indexable_getter indexable_getter

The function object extracting Indexable from Value.

EqualTo typedef EqualTo boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::value_equal value_equal

The function object comparing objects of type Value.

Allocator typedef Allocator boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::allocator_type allocator_type

The type of allocator used by the container.

index::detail::indexable_type< detail::translator< IndexableGetter, EqualTo > >::type typedef index::detail::indexable_type< detail::translator<IndexableGetter, EqualTo> >::type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::indexable_type indexable_type

The Indexable type to which Value is translated.

geometry::model::box< geometry::model::point< typename coordinate_type< indexable_type >::type, dimension< indexable_type >::value, typename coordinate_system< indexable_type >::type > > typedef geometry::model::box< geometry::model::point< typename coordinate_type<indexable_type>::type, dimension<indexable_type>::value, typename coordinate_system<indexable_type>::type > > boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::bounds_type bounds_type

The Box type used by the R-tree.

allocators_type::reference typedef allocators_type::reference boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::reference reference

Type of reference to Value.

allocators_type::const_reference typedef allocators_type::const_reference boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::const_reference const_reference

Type of reference to const Value.

allocators_type::pointer typedef allocators_type::pointer boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::pointer pointer

Type of pointer to Value.

allocators_type::const_pointer typedef allocators_type::const_pointer boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::const_pointer const_pointer

Type of pointer to const Value.

allocators_type::difference_type typedef allocators_type::difference_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::difference_type difference_type

Type of difference type.

allocators_type::size_type typedef allocators_type::size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::size_type size_type

Unsigned integral type used by the container.

index::detail::rtree::iterators::iterator< value_type, options_type, translator_type, box_type, allocators_type > typedef index::detail::rtree::iterators::iterator< value_type, options_type, translator_type, box_type, allocators_type > boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::const_iterator const_iterator

Type of const iterator, category ForwardIterator.

index::detail::rtree::iterators::query_iterator< value_type, allocators_type > typedef index::detail::rtree::iterators::query_iterator< value_type, allocators_type > boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::const_query_iterator const_query_iterator

Type of const query iterator, category ForwardIterator.

detail::translator< IndexableGetter, EqualTo > typedef detail::translator<IndexableGetter, EqualTo> boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::translator_type translator_type
bounds_type typedef bounds_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::box_type box_type
detail::rtree::options_type< Parameters >::type typedef detail::rtree::options_type<Parameters>::type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::options_type options_type
options_type::node_tag typedef options_type::node_tag boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::node_tag node_tag
detail::rtree::allocators< allocator_type, value_type, typename options_type::parameters_type, box_type, node_tag > typedef detail::rtree::allocators<allocator_type, value_type, typename options_type::parameters_type, box_type, node_tag> boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::allocators_type allocators_type
detail::rtree::node< value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag >::type typedef detail::rtree::node<value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag>::type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::node node
detail::rtree::internal_node< value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag >::type typedef detail::rtree::internal_node<value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag>::type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::internal_node internal_node
detail::rtree::leaf< value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag >::type typedef detail::rtree::leaf<value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag>::type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::leaf leaf
allocators_type::node_pointer typedef allocators_type::node_pointer boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::node_pointer node_pointer
::boost::container::allocator_traits< Allocator > typedef ::boost::container::allocator_traits<Allocator> boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::allocator_traits_type allocator_traits_type
detail::rtree::subtree_destroyer< value_type, options_type, translator_type, box_type, allocators_type > typedef detail::rtree::subtree_destroyer<value_type, options_type, translator_type, box_type, allocators_type> boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::subtree_destroyer subtree_destroyer
friend class friend class detail::rtree::utilities::view< rtree > detail::rtree::utilities::view< rtree >
members_holder members_holder boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::m_members m_members
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree
(parameters_type const &parameters=parameters_type(), indexable_getter const &getter=indexable_getter(), value_equal const &equal=value_equal())
rtree
parameters_type const & parameters parameters_type()
indexable_getter const & getter indexable_getter()
value_equal const & equal value_equal()

The constructor.

parameters

The parameters object.

getter

The function object extracting Indexable from Value.

equal

The function object comparing Values.

# Throws

If allocator default constructor throws.

boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree
(parameters_type const &parameters, indexable_getter const &getter, value_equal const &equal, allocator_type const &allocator)
rtree
parameters_type const & parameters
indexable_getter const & getter
value_equal const & equal
allocator_type const & allocator

The constructor.

parameters

The parameters object.

getter

The function object extracting Indexable from Value.

equal

The function object comparing Values.

allocator

The allocator object.

# Throws

If allocator copy constructor throws.

typename Iterator
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree
(Iterator first, Iterator last, parameters_type const &parameters=parameters_type(), indexable_getter const &getter=indexable_getter(), value_equal const &equal=value_equal(), allocator_type const &allocator=allocator_type())
rtree
Iterator first
Iterator last
parameters_type const & parameters parameters_type()
indexable_getter const & getter indexable_getter()
value_equal const & equal value_equal()
allocator_type const & allocator allocator_type()

The constructor.

The tree is created using packing algorithm.

first

The beginning of the range of Values.

last

The end of the range of Values.

parameters

The parameters object.

getter

The function object extracting Indexable from Value.

equal

The function object comparing Values.

allocator

The allocator object.

# Throws

- If allocator copy constructor throws.

- If Value copy constructor or copy assignment throws.

- If allocation throws or returns invalid value.

typename Range
boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree
(Range const &rng, parameters_type const &parameters=parameters_type(), indexable_getter const &getter=indexable_getter(), value_equal const &equal=value_equal(), allocator_type const &allocator=allocator_type())
rtree
Range const & rng
parameters_type const & parameters parameters_type()
indexable_getter const & getter indexable_getter()
value_equal const & equal value_equal()
allocator_type const & allocator allocator_type()

The constructor.

The tree is created using packing algorithm.

rng

The range of Values.

parameters

The parameters object.

getter

The function object extracting Indexable from Value.

equal

The function object comparing Values.

allocator

The allocator object.

# Throws

- If allocator copy constructor throws.

- If Value copy constructor or copy assignment throws.

- If allocation throws or returns invalid value.

boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::~rtree
()
~rtree

The destructor.

# Throws

Nothing.

boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree
(rtree const &src)
rtree
rtree const & src

The copy constructor.

It uses parameters, translator and allocator from the source tree.

src

The rtree which content will be copied.

# Throws

- If allocator copy constructor throws.

- If Value copy constructor throws.

- If allocation throws or returns invalid value.

boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree
(rtree const &src, allocator_type const &allocator)
rtree
rtree const & src
allocator_type const & allocator

The copy constructor.

It uses Parameters and translator from the source tree.

src

The rtree which content will be copied.

allocator

The allocator which will be used.

# Throws

- If allocator copy constructor throws.

- If Value copy constructor throws.

- If allocation throws or returns invalid value.

boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree
(rtree &&src)
rtree
rtree && src

The moving constructor.

It uses parameters, translator and allocator from the source tree.

src

The rtree which content will be moved.

# Throws

Nothing.

boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::rtree
(rtree &&src, allocator_type const &allocator)
rtree
rtree && src
allocator_type const & allocator

The moving constructor.

It uses parameters and translator from the source tree.

src

The rtree which content will be moved.

allocator

The allocator.

# Throws

- If allocator copy constructor throws.

- If Value copy constructor throws (only if allocators aren't equal).

- If allocation throws or returns invalid value (only if allocators aren't equal).

rtree & rtree& boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::operator= (rtree const &src) operator= rtree const & src

The assignment operator.

It uses parameters and translator from the source tree.

src

The rtree which content will be copied.

# Throws

- If Value copy constructor throws.

- If allocation throws.

- If allocation throws or returns invalid value.

rtree & rtree& boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::operator= (rtree &&src) operator= rtree && src

The moving assignment.

It uses parameters and translator from the source tree.

src

The rtree which content will be moved.

# Throws

Only if allocators aren't equal.

- If Value copy constructor throws.

- If allocation throws or returns invalid value.

void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::swap (rtree &other) swap rtree & other

Swaps contents of two rtrees.

Parameters, translator and allocators are swapped as well.

other

The rtree which content will be swapped with this rtree content.

# Throws

If allocators swap throws.

void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::insert (value_type const &value) insert value_type const & value

Insert a value to the index.

value

The value which will be stored in the container.

# Throws

- If Value copy constructor or copy assignment throws.

- If allocation throws or returns invalid value.

This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

typename Iterator
void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::insert (Iterator first, Iterator last) insert Iterator first Iterator last

Insert a range of values to the index.

first

The beginning of the range of values.

last

The end of the range of values.

# Throws

- If Value copy constructor or copy assignment throws.

- If allocation throws or returns invalid value.

This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

typename ConvertibleOrRange
void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::insert (ConvertibleOrRange const &conv_or_rng) insert ConvertibleOrRange const & conv_or_rng

Insert a value created using convertible object or a range of values to the index.

conv_or_rng

An object of type convertible to value_type or a range of values.

# Throws

- If Value copy constructor or copy assignment throws.

- If allocation throws or returns invalid value.

This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::remove (value_type const &value) remove value_type const & value

Remove a value from the container.

In contrast to the `std::set` or `std::map erase()` method this method removes only one value from the container.

value

The value which will be removed from the container.

1 if the value was removed, 0 otherwise.

# Throws

- If Value copy constructor or copy assignment throws.

- If allocation throws or returns invalid value.

This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

typename Iterator
size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::remove (Iterator first, Iterator last) remove Iterator first Iterator last

Remove a range of values from the container.

In contrast to the `std::set` or `std::map erase()` method it doesn't take iterators pointing to values stored in this container. It removes values equal to these passed as a range. Furthermore this method removes only one value for each one passed in the range, not all equal values.

first

The beginning of the range of values.

last

The end of the range of values.

The number of removed values.

# Throws

- If Value copy constructor or copy assignment throws.

- If allocation throws or returns invalid value.

This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

typename ConvertibleOrRange
size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::remove (ConvertibleOrRange const &conv_or_rng) remove ConvertibleOrRange const & conv_or_rng

Remove value corresponding to an object convertible to it or a range of values from the container.

In contrast to the `std::set` or `std::map erase()` method it removes values equal to these passed as a range. Furthermore, this method removes only one value for each one passed in the range, not all equal values.

conv_or_rng

The object of type convertible to value_type or a range of values.

The number of removed values.

# Throws

- If Value copy constructor or copy assignment throws.

- If allocation throws or returns invalid value.

This operation only guarantees that there will be no memory leaks. After an exception is thrown the R-tree may be left in an inconsistent state, elements must not be inserted or removed. Other operations are allowed however some of them may return invalid data.

typename Predicates
typename OutIter
size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::query (Predicates const &predicates, OutIter out_it) const query Predicates const & predicates OutIter out_it

Finds values meeting passed predicates e.g. nearest to some Point and/or intersecting some Box.

This query function performs spatial and k-nearest neighbor searches. It allows to pass a set of predicates. Values will be returned only if all predicates are met.

Spatial predicates

Spatial predicates may be generated by one of the functions listed below:

- `boost::geometry::index::contains()`,

- `boost::geometry::index::covered_by()`,

- `boost::geometry::index::covers()`,

- `boost::geometry::index::disjoint()`,

- `boost::geometry::index::intersects()`,

- `boost::geometry::index::overlaps()`,

- `boost::geometry::index::within()`,

It is possible to negate spatial predicates:

- `! boost::geometry::index::contains()`,

- `! boost::geometry::index::covered_by()`,

- `! boost::geometry::index::covers()`,

- `! boost::geometry::index::disjoint()`,

- `! boost::geometry::index::intersects()`,

- `! boost::geometry::index::overlaps()`,

- `! boost::geometry::index::within()`

Satisfies predicate

This is a special kind of predicate which allows to pass a user-defined function or function object which checks if Value should be returned by the query. It's generated by:

- `boost::geometry::index::satisfies()`.

Nearest predicate

If the nearest predicate is passed a k-nearest neighbor search will be performed. This query will result in returning k values to the output iterator. Only one nearest predicate may be passed to the query. It may be generated by:

- `boost::geometry::index::nearest()`.

Connecting predicates

Predicates may be passed together connected with `operator&&()`.

# Example

// return elements intersecting box tree.query(bgi::intersects(box), std::back_inserter(result)); // return elements intersecting poly but not within box tree.query(bgi::intersects(poly) && !bgi::within(box), std::back_inserter(result)); // return elements overlapping box and meeting my_fun unary predicate tree.query(bgi::overlaps(box) && bgi::satisfies(my_fun), std::back_inserter(result)); // return 5 elements nearest to pt and elements are intersecting box tree.query(bgi::nearest(pt, 5) && bgi::intersects(box), std::back_inserter(result)); // For each found value do_something (it is a type of function object) tree.query(bgi::intersects(box), boost::make_function_output_iterator(do_something())); // For each value stored in the rtree do_something // always_true is a type of function object always returning true tree.query(bgi::satisfies(always_true()), boost::make_function_output_iterator(do_something())); // C++11 (lambda expression) tree.query(bgi::intersects(box), boost::make_function_output_iterator([](value_type const& val){ // do something })); // C++14 (generic lambda expression) tree.query(bgi::intersects(box), boost::make_function_output_iterator([](auto const& val){ // do something }));

# Throws

If Value copy constructor or copy assignment throws. If predicates copy throws.

Only one `nearest()` perdicate may be passed to the query. Passing more of them results in compile-time error.

predicates

Predicates.

out_it

The output iterator, e.g. generated by std::back_inserter().

The number of values found.

typename Predicates
const_query_iterator const_query_iterator boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::qbegin (Predicates const &predicates) const qbegin Predicates const & predicates

Returns a query iterator pointing at the begin of the query range.

This method returns an iterator which may be used to perform iterative queries. For the information about predicates which may be passed to this method see query().

# Example

for ( Rtree::const_query_iterator it = tree.qbegin(bgi::nearest(pt, 10000)) ; it != tree.qend() ; ++it ) { // do something with value if ( has_enough_nearest_values() ) break; } // C++11 (auto) for ( auto it = tree.qbegin(bgi::nearest(pt, 3)) ; it != tree.qend() ; ++it ) { // do something with value } // C++14 (generic lambda expression) std::for_each(tree.qbegin(bgi::nearest(pt, 3)), tree.qend(), [](auto const& val){ // do something with value });

# Iterator category

ForwardIterator

# Throws

If predicates copy throws. If allocation throws.

The modification of the rtree may invalidate the iterators.

predicates

Predicates.

The iterator pointing at the begin of the query range.

const_query_iterator const_query_iterator boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::qend () const qend

Returns a query iterator pointing at the end of the query range.

This method returns an iterator which may be used to check if the query has ended.

# Example

for ( Rtree::const_query_iterator it = tree.qbegin(bgi::nearest(pt, 10000)) ; it != tree.qend() ; ++it ) { // do something with value if ( has_enough_nearest_values() ) break; } // C++11 (auto) for ( auto it = tree.qbegin(bgi::nearest(pt, 3)) ; it != tree.qend() ; ++it ) { // do something with value } // C++14 (generic lambda expression) std::for_each(tree.qbegin(bgi::nearest(pt, 3)), tree.qend(), [](auto const& val){ // do something with value });

# Iterator category

ForwardIterator

# Throws

Nothing

The modification of the rtree may invalidate the iterators.

The iterator pointing at the end of the query range.

const_iterator const_iterator boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::begin () const begin

Returns the iterator pointing at the begin of the rtree values range.

This method returns the iterator which may be used to iterate over all values stored in the rtree.

# Example

// Copy all values into the vector std::copy(tree.begin(), tree.end(), std::back_inserter(vec)); for ( Rtree::const_iterator it = tree.begin() ; it != tree.end() ; ++it ) { // do something with value } // C++11 (auto) for ( auto it = tree.begin() ; it != tree.end() ; ++it ) { // do something with value } // C++14 (generic lambda expression) std::for_each(tree.begin(), tree.end(), [](auto const& val){ // do something with value })

# Iterator category

ForwardIterator

# Throws

If allocation throws.

The modification of the rtree may invalidate the iterators.

The iterator pointing at the begin of the range.

const_iterator const_iterator boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::end () const end

Returns the iterator pointing at the end of the rtree values range.

This method returns the iterator which may be compared with the iterator returned by begin() in order to check if the iteration has ended.

# Example

for ( Rtree::const_iterator it = tree.begin() ; it != tree.end() ; ++it ) { // do something with value } // C++11 (lambda expression) std::for_each(tree.begin(), tree.end(), [](value_type const& val){ // do something with value })

# Iterator category

ForwardIterator

# Throws

Nothing.

The modification of the rtree may invalidate the iterators.

The iterator pointing at the end of the range.

size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::size () const size

Returns the number of stored values.

The number of stored values.

# Throws

Nothing.

bool bool boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::empty () const empty

Query if the container is empty.

true if the container is empty.

# Throws

Nothing.

void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::clear () clear

Removes all values stored in the container.

# Throws

Nothing.

bounds_type bounds_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::bounds () const bounds

Returns the box able to contain all values stored in the container.

Returns the box able to contain all values stored in the container. If the container is empty the result of `geometry::assign_inverse()` is returned.

The box able to contain all values stored in the container or an invalid box if there are no values in the container.

# Throws

Nothing.

typename ValueOrIndexable
size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::count (ValueOrIndexable const &vori) const count ValueOrIndexable const & vori

Count Values or Indexables stored in the container.

For indexable_type it returns the number of values which indexables equals the parameter. For value_type it returns the number of values which equals the parameter.

vori

The value or indexable which will be counted.

The number of values found.

# Throws

Nothing.

parameters_type parameters_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::parameters () const parameters

Returns parameters.

The parameters object.

# Throws

Nothing.

indexable_getter indexable_getter boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::indexable_get () const indexable_get

Returns function retrieving Indexable from Value.

The indexable_getter object.

# Throws

Nothing.

value_equal value_equal boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::value_eq () const value_eq

Returns function comparing Values.

The value_equal function.

# Throws

Nothing.

allocator_type allocator_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::get_allocator () const get_allocator

Returns allocator used by the rtree.

The allocator.

# Throws

If allocator copy constructor throws.

typename Predicates
boost::mpl::if_c< detail::predicates_count_distance< Predicates >::value==0, detail::rtree::iterators::spatial_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates >, detail::rtree::iterators::distance_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates, detail::predicates_find_distance< Predicates >::value > >::type boost::mpl::if_c< detail::predicates_count_distance<Predicates>::value == 0, detail::rtree::iterators::spatial_query_iterator<value_type, options_type, translator_type, box_type, allocators_type, Predicates>, detail::rtree::iterators::distance_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates, detail::predicates_find_distance<Predicates>::value > >::type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::qbegin_ (Predicates const &predicates) const qbegin_ Predicates const & predicates

Returns a query iterator pointing at the begin of the query range.

This method returns an iterator which may be used to perform iterative queries. For the information about predicates which may be passed to this method see query().

The type of the returned iterator depends on the type of passed Predicates but the iterator of this type may be assigned to the variable of const_query_iterator type. If you'd like to use the type of the iterator returned by this method you may get the type e.g. by using C++11 decltype or Boost.Typeof library. This iterator may be compared with iterators returned by both versions of qend() method.

# Example

// Store the result in the container using std::copy() - it requires both iterators of the same type std::copy(tree.qbegin_(bgi::intersects(box)), tree.qend_(bgi::intersects(box)), std::back_inserter(result)); // Store the result in the container using std::copy() and type-erased iterators Rtree::const_query_iterator first = tree.qbegin_(bgi::intersects(box)); Rtree::const_query_iterator last = tree.qend_(); std::copy(first, last, std::back_inserter(result)); // Boost.Typeof typedef BOOST_TYPEOF(tree.qbegin(bgi::nearest(pt, 10000))) Iter; for ( Iter it = tree.qbegin_(bgi::nearest(pt, 10000)) ; it != tree.qend_() ; ++it ) { // do something with value if ( has_enough_nearest_values() ) break; } // C++11 (auto) for ( auto it = tree.qbegin_(bgi::nearest(pt, 10000)) ; it != tree.qend_() ; ++it ) { // do something with value if ( has_enough_nearest_values() ) break; }

# Iterator category

ForwardIterator

# Throws

If predicates copy throws. If allocation throws.

The modification of the rtree may invalidate the iterators.

predicates

Predicates.

The iterator pointing at the begin of the query range.

typename Predicates
boost::mpl::if_c< detail::predicates_count_distance< Predicates >::value==0, detail::rtree::iterators::spatial_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates >, detail::rtree::iterators::distance_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates, detail::predicates_find_distance< Predicates >::value > >::type boost::mpl::if_c< detail::predicates_count_distance<Predicates>::value == 0, detail::rtree::iterators::spatial_query_iterator<value_type, options_type, translator_type, box_type, allocators_type, Predicates>, detail::rtree::iterators::distance_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates, detail::predicates_find_distance<Predicates>::value > >::type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::qend_ (Predicates const &predicates) const qend_ Predicates const & predicates

Returns the query iterator pointing at the end of the query range.

This method returns the iterator which may be used to perform iterative queries. For the information about the predicates which may be passed to this method see query().

The type of the returned iterator depends on the type of passed Predicates but the iterator of this type may be assigned to the variable of const_query_iterator type. If you'd like to use the type of the iterator returned by this method you may get the type e.g. by using C++11 decltype or Boost.Typeof library.

The type of the iterator returned by this method is the same as the one returned by qbegin() to which the same predicates were passed.

# Example

// Store the result in the container using std::copy() - it requires both iterators of the same type std::copy(tree.qbegin_(bgi::intersects(box)), tree.qend_(bgi::intersects(box)), std::back_inserter(result));

# Iterator category

ForwardIterator

# Throws

If predicates copy throws.

The modification of the rtree may invalidate the iterators.

predicates

Predicates.

The iterator pointing at the end of the query range.

detail::rtree::iterators::end_query_iterator< value_type, allocators_type > detail::rtree::iterators::end_query_iterator<value_type, allocators_type> boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::qend_ () const qend_

Returns the query iterator pointing at the end of the query range.

This method returns the iterator which may be compared with the iterator returned by qbegin() in order to check if the query has ended.

The type of the returned iterator is different than the type returned by qbegin() but the iterator of this type may be assigned to the variable of const_query_iterator type. If you'd like to use the type of the iterator returned by this method, which most certainly will be faster than the type-erased iterator, you may get the type e.g. by using C++11 decltype or Boost.Typeof library.

The type of the iterator returned by this method is dfferent than the type returned by qbegin().

# Example

// Store the result in the container using std::copy() and type-erased iterators Rtree::const_query_iterator first = tree.qbegin_(bgi::intersects(box)); Rtree::const_query_iterator last = tree.qend_(); std::copy(first, last, std::back_inserter(result)); // Boost.Typeof typedef BOOST_TYPEOF(tree.qbegin(bgi::nearest(pt, 10000))) Iter; for ( Iter it = tree.qbegin_(bgi::nearest(pt, 10000)) ; it != tree.qend_() ; ++it ) { // do something with value if ( has_enough_nearest_values() ) break; } // C++11 (auto) for ( auto it = tree.qbegin_(bgi::nearest(pt, 10000)) ; it != tree.qend_() ; ++it ) { // do something with value if ( has_enough_nearest_values() ) break; }

# Iterator category

ForwardIterator

# Throws

Nothing

The modification of the rtree may invalidate the iterators.

The iterator pointing at the end of the query range.

translator_type translator_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::translator () const translator

Returns the translator object.

The translator object.

# Throws

Nothing.

typename Visitor
void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::apply_visitor (Visitor &visitor) const apply_visitor Visitor & visitor

Apply a visitor to the nodes structure in order to perform some operator.

This function is not a part of the 'official' interface. However it makes possible e.g. to pass a visitor drawing the tree structure.

visitor

The visitor object.

# Throws

If Visitor::operator() throws.

size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::depth () const depth

Returns the depth of the R-tree.

This function is not a part of the 'official' interface.

The depth of the R-tree.

# Throws

Nothing.

void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::raw_insert (value_type const &value) raw_insert value_type const & value

Insert a value to the index.

Root node must exist - m_root != 0.

value

The value which will be stored in the container.

# Exception-safety

basic

size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::raw_remove (value_type const &value) raw_remove value_type const & value

Remove the value from the container.

value

The value which will be removed from the container.

# Exception-safety

basic

void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::raw_create () raw_create

Create an empty R-tree i.e. new empty root node and clear other attributes.

# Exception-safety

strong

void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::raw_destroy (rtree &t) raw_destroy rtree & t

Destroy the R-tree i.e. all nodes and clear attributes.

t

The container which is going to be destroyed.

# Exception-safety

nothrow

void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::raw_copy (rtree const &src, rtree &dst, bool copy_tr_and_params) const raw_copy rtree const & src rtree & dst bool copy_tr_and_params

Copy the R-tree i.e. whole nodes structure, values and other attributes. It uses destination's allocators to create the new structure.

src

The source R-tree.

dst

The destination R-tree.

copy_tr_and_params

If true, translator and parameters will also be copied.

# Exception-safety

strong

typename ValueConvertible
void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::insert_dispatch (ValueConvertible const &val_conv, boost::mpl::bool_< true > const &) insert_dispatch ValueConvertible const & val_conv boost::mpl::bool_< true > const &

Insert a value corresponding to convertible object into the index.

val_conv

The object convertible to value.

# Exception-safety

basic

typename Range
void void boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::insert_dispatch (Range const &rng, boost::mpl::bool_< false > const &) insert_dispatch Range const & rng boost::mpl::bool_< false > const &

Insert a range of values into the index.

rng

The range of values.

# Exception-safety

basic

typename ValueConvertible
size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::remove_dispatch (ValueConvertible const &val_conv, boost::mpl::bool_< true > const &) remove_dispatch ValueConvertible const & val_conv boost::mpl::bool_< true > const &

Remove a value corresponding to convertible object from the index.

val_conv

The object convertible to value.

# Exception-safety

basic

typename Range
size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::remove_dispatch (Range const &rng, boost::mpl::bool_< false > const &) remove_dispatch Range const & rng boost::mpl::bool_< false > const &

Remove a range of values from the index.

rng

The range of values which will be removed from the container.

# Exception-safety

basic

typename Predicates
typename OutIter
size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::query_dispatch (Predicates const &predicates, OutIter out_it, boost::mpl::bool_< false > const &) const query_dispatch Predicates const & predicates OutIter out_it boost::mpl::bool_< false > const &

Return values meeting predicates.

# Exception-safety

strong

typename Predicates
typename OutIter
size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::query_dispatch (Predicates const &predicates, OutIter out_it, boost::mpl::bool_< true > const &) const query_dispatch Predicates const & predicates OutIter out_it boost::mpl::bool_< true > const &

Perform nearest neighbour search.

# Exception-safety

strong

typename ValueOrIndexable
size_type size_type boost::geometry::index::rtree< Value, Parameters, IndexableGetter, EqualTo, Allocator >::raw_count (ValueOrIndexable const &vori) const raw_count ValueOrIndexable const & vori

Count elements corresponding to value or indexable.

# Exception-safety

strong

The R-tree spatial index.

This is self-balancing spatial index capable to store various types of Values and balancing algorithms.

# Parameters

The user must pass a type defining the Parameters which will be used in rtree creation process. This type is used e.g. to specify balancing algorithm with specific parameters like min and max number of elements in node.

#

Predefined algorithms with compile-time parameters are:

- `boost::geometry::index::linear`,

- `boost::geometry::index::quadratic`,

- `boost::geometry::index::rstar`.

#

Predefined algorithms with run-time parameters are:

- `boost::geometry::index::dynamic_linear`,

- `boost::geometry::index::dynamic_quadratic`,

- `boost::geometry::index::dynamic_rstar`.

# IndexableGetter

The object of IndexableGetter type translates from Value to Indexable each time r-tree requires it. This means that this operation is done for each Value access. Therefore the IndexableGetter should return the Indexable by a reference type. The Indexable should not be calculated since it could harm the performance. The default IndexableGetter can translate all types adapted to Point, Box or Segment concepts (called Indexables). Furthermore, it can handle `std::pair<Indexable, T>`, `boost::tuple<Indexable, ...>` and `std::tuple<Indexable, ...>` when possible. For example, for Value of type `std::pair<Box, int>`, the default IndexableGetter translates from `std::pair<Box, int> const&` to `Box const&`.

# EqualTo

The object of EqualTo type compares Values and returns `true` if they are equal. It's similar to `std::equal_to<>`. The default EqualTo returns the result of `boost::geometry::equals()` for types adapted to some Geometry concept defined in Boost.Geometry and the result of `operator==` for other types. Components of Pairs and Tuples are compared left-to-right.

Value

The type of objects stored in the container.

Parameters

Compile-time parameters.

IndexableGetter

The function object extracting Indexable from Value.

EqualTo

The function object comparing objects of type Value.

Allocator

The allocator used to allocate/deallocate memory, construct/destroy nodes and Values.

- boost::geometry::index::rtree
  allocator_traits_type
- boost::geometry::index::rtree
  allocator_type
- boost::geometry::index::rtree
  allocators_type
- boost::geometry::index::rtree
  apply_visitor
- boost::geometry::index::rtree
  begin
- boost::geometry::index::rtree
  bounds
- boost::geometry::index::rtree
  bounds_type
- boost::geometry::index::rtree
  box_type
- boost::geometry::index::rtree
  clear
- boost::geometry::index::rtree
  const_iterator
- boost::geometry::index::rtree
  const_pointer
- boost::geometry::index::rtree
  const_query_iterator
- boost::geometry::index::rtree
  const_reference
- boost::geometry::index::rtree
  count
- boost::geometry::index::rtree
  depth
- boost::geometry::index::rtree
  detail::rtree::utilities::view< rtree >
- boost::geometry::index::rtree
  difference_type
- boost::geometry::index::rtree
  empty
- boost::geometry::index::rtree
  end
- boost::geometry::index::rtree
  get_allocator
- boost::geometry::index::rtree
  indexable_get
- boost::geometry::index::rtree
  indexable_getter
- boost::geometry::index::rtree
  indexable_type
- boost::geometry::index::rtree
  insert
- boost::geometry::index::rtree
  insert
- boost::geometry::index::rtree
  insert
- boost::geometry::index::rtree
  insert_dispatch
- boost::geometry::index::rtree
  insert_dispatch
- boost::geometry::index::rtree
  internal_node
- boost::geometry::index::rtree
  leaf
- boost::geometry::index::rtree
  m_members
- boost::geometry::index::rtree
  node
- boost::geometry::index::rtree
  node_pointer
- boost::geometry::index::rtree
  node_tag
- boost::geometry::index::rtree
  operator=
- boost::geometry::index::rtree
  operator=
- boost::geometry::index::rtree
  options_type
- boost::geometry::index::rtree
  parameters
- boost::geometry::index::rtree
  parameters_type
- boost::geometry::index::rtree
  pointer
- boost::geometry::index::rtree
  qbegin
- boost::geometry::index::rtree
  qbegin_
- boost::geometry::index::rtree
  qend
- boost::geometry::index::rtree
  qend_
- boost::geometry::index::rtree
  qend_
- boost::geometry::index::rtree
  query
- boost::geometry::index::rtree
  query_dispatch
- boost::geometry::index::rtree
  query_dispatch
- boost::geometry::index::rtree
  raw_copy
- boost::geometry::index::rtree
  raw_count
- boost::geometry::index::rtree
  raw_create
- boost::geometry::index::rtree
  raw_destroy
- boost::geometry::index::rtree
  raw_insert
- boost::geometry::index::rtree
  raw_remove
- boost::geometry::index::rtree
  reference
- boost::geometry::index::rtree
  remove
- boost::geometry::index::rtree
  remove
- boost::geometry::index::rtree
  remove
- boost::geometry::index::rtree
  remove_dispatch
- boost::geometry::index::rtree
  remove_dispatch
- boost::geometry::index::rtree
  rtree
- boost::geometry::index::rtree
  rtree
- boost::geometry::index::rtree
  rtree
- boost::geometry::index::rtree
  rtree
- boost::geometry::index::rtree
  rtree
- boost::geometry::index::rtree
  rtree
- boost::geometry::index::rtree
  rtree
- boost::geometry::index::rtree
  rtree
- boost::geometry::index::rtree
  size
- boost::geometry::index::rtree
  size_type
- boost::geometry::index::rtree
  subtree_destroyer
- boost::geometry::index::rtree
  swap
- boost::geometry::index::rtree
  translator
- boost::geometry::index::rtree
  translator_type
- boost::geometry::index::rtree
  value_eq
- boost::geometry::index::rtree
  value_equal
- boost::geometry::index::rtree
  value_type
- boost::geometry::index::rtree
  ~rtree