![]() |
Home | Libraries | People | FAQ | More |
This is self-balancing spatial index capable to store various types of Values and balancing algorithms.
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:
Predefined algorithms with run-time parameters are:
The Translator translates from Value to Indexable each time r-tree requires
it. Which means that this operation is done for each Value access. Therefore
the Translator should return the Indexable by const reference instead of
a value. Default translator can translate all types adapted to Point or
Box concepts (called Indexables). It also handles
and std::pair<Indexable,
T>
. For example,
if boost::tuple<Indexable,
...>
is stored in the container, the default translator translates from std::pair<Box, int>
to std::pair<Box, int> const&
.
Box const&
#include <boost/geometry/extensions/index/rtree.hpp>
template<
typename Value
,
typename Parameters
,
typename Translator
=translator::def
<Value>
,
typename Allocator
=std::allocator<Value>
>
class rtree
{
// ...
};
Parameter |
Description |
---|---|
|
The type of objects stored in the container. |
|
Compile-time parameters. |
|
The type of the translator which translates from Value to Indexable. |
|
The allocator used to allocate/deallocate memory, construct/destroy nodes and Values. |
Type |
Description |
---|---|
The type of Value stored in the container. |
|
R-tree parameters type. |
|
Value to Indexable Translator type. |
|
The type of allocator used by the container. |
|
Unsigned integral type used by the container. |
|
The Indexable type to which Value is translated. |
|
The Box type used by the R-tree. |
Function |
Description |
---|---|
The constructor. |
|
|
The constructor. |
The constructor. |
|
The constructor. |
|
The destructor. |
|
The copy constructor. |
|
The copy constructor. |
|
The moving constructor. |
|
The moving constructor. |
Function |
Description |
---|---|
The assignment operator. |
|
The moving assignment. |
|
Swaps contents of two rtrees. |
|
Insert a value to the index. |
|
Insert a range of values to the index. |
|
Insert a range of values to the index. |
|
Remove a value from the container. |
|
Remove a range of values from the container. |
|
Remove a range of values from the container. |
|
Finds values meeting spatial predicates, e.g. intersecting some Box. |
|
Finds one value meeting distances predicates, e.g. nearest to some Point. |
|
|
Finds one value meeting distances predicates and spatial predicates, e.g. nearest to some Point and intersecting some Box. |
|
Finds k values meeting distances predicates, e.g. k nearest values to some Point. |
|
Finds k values meeting distances predicates and spatial predicates, e.g. k nearest values to some Point and intersecting some Box. |
Returns the number of stored values. |
|
Query if the container is empty. |
|
Removes all values stored in the container. |
|
Returns the box containing all values stored in the container. |
|
Count Values or Indexables stored in the container. |
|
Returns parameters. |
|
Returns the translator object. |
|
Returns allocator used by the rtree. |
The constructor.
rtree
(
parameters_type
parameters
=parameters_type
()
,
translator_type
const &
translator
=translator_type
()
)
Type |
Name |
Description |
---|---|---|
|
The parameters object. |
|
|
|
The translator object. |
If allocator default constructor throws.
The constructor.
rtree
(
parameters_type
parameters
,
translator_type
const &
translator
,
allocator_type
allocator
)
Type |
Name |
Description |
---|---|---|
|
The parameters object. |
|
|
|
The translator object. |
|
The allocator object. |
If allocator copy constructor throws.
The constructor.
template<
typename Iterator
>
rtree
(
Iterator
first
,
Iterator
last
,
parameters_type
parameters
=parameters_type
()
,
translator_type
const &
translator
=translator_type
()
,
allocator_type
allocator
=allocator_type
()
)
Type |
Name |
Description |
---|---|---|
|
|
The beginning of the range of Values. |
|
|
The end of the range of Values. |
|
The parameters object. |
|
|
|
The translator object. |
|
The allocator object. |
The constructor.
template<
typename Range
>
rtree
(
Range const &
rng
,
parameters_type
parameters
=parameters_type
()
,
translator_type
const &
translator
=translator_type
()
,
allocator_type
allocator
=allocator_type
()
)
Type |
Name |
Description |
---|---|---|
|
|
The range of Values. |
|
The parameters object. |
|
|
|
The translator object. |
|
The allocator object. |
The copy constructor.
It uses parameters, translator and allocator from the source tree.
rtree
(
rtree
const &
src
)
Type |
Name |
Description |
---|---|---|
|
|
The rtree which content will be copied. |
The copy constructor.
It uses Parameters and translator from the source tree.
rtree
(
rtree
const &
src
,
allocator_type
const &
allocator
)
Type |
Name |
Description |
---|---|---|
|
|
The rtree which content will be copied. |
|
|
The allocator which will be used. |
The moving constructor.
It uses parameters, translator and allocator from the source tree.
rtree
(
rtree
&&
src
)
Type |
Name |
Description |
---|---|---|
|
|
The rtree which content will be moved. |
Nothing.
The moving constructor.
It uses parameters and translator from the source tree.
rtree
(
rtree
&&
src
,
allocator_type
const &
allocator
)
Type |
Name |
Description |
---|---|---|
|
|
The rtree which content will be moved. |
|
|
The allocator. |
The assignment operator.
It uses parameters and translator from the source tree.
rtree
&
operator=
(
const
rtree
&
src
)
Type |
Name |
Description |
---|---|---|
|
|
The rtree which content will be copied. |
The moving assignment.
It uses parameters and translator from the source tree.
rtree
&
operator=
(
rtree
&&
src
)
Type |
Name |
Description |
---|---|---|
|
|
The rtree which content will be moved. |
Only if allocators aren't equal.
Swaps contents of two rtrees.
Parameters, translator and allocators are swapped as well.
void
swap
(
rtree
&
other
)
Type |
Name |
Description |
---|---|---|
|
|
The rtree which content will be swapped with this rtree content. |
If allocators swap throws.
Insert a value to the index.
void
insert
(
value_type
const &
value
)
Type |
Name |
Description |
---|---|---|
|
|
The value which will be stored in the container. |
![]() |
Warning |
---|---|
This operation is not thread safe. If it throws, the R-tree may be left in an inconsistent state, elements must not be inserted or removed, methods may return invalid data. |
Insert a range of values to the index.
template<
typename Iterator
>
void
insert
(
Iterator
first
,
Iterator
last
)
Type |
Name |
Description |
---|---|---|
|
|
The beginning of the range of values. |
|
|
The end of the range of values. |
![]() |
Warning |
---|---|
This operation is not thread safe. If it throws, the R-tree may be left in an inconsistent state, elements must not be inserted or removed, methods may return invalid data. |
Insert a range of values to the index.
template<
typename Range
>
void
insert
(
Range const &
rng
)
Type |
Name |
Description |
---|---|---|
|
|
The range of values. |
![]() |
Warning |
---|---|
This operation is not thread safe. If it throws, the R-tree may be left in an inconsistent state, elements must not be inserted or removed, methods may return invalid data. |
Remove a value from the container.
In contrast to the
or std::set
method this method removes
only one value from the container.
std::map erase()
size_type
remove
(
value_type
const &
value
)
Type |
Name |
Description |
---|---|---|
|
|
The value which will be removed from the container. |
1 if the value was removed, 0 otherwise.
![]() |
Warning |
---|---|
This operation is not thread safe. If it throws, the R-tree may be left in an inconsistent state, elements must not be inserted or removed, methods may return invalid data. |
Remove a range of values from the container.
In contrast to the
or std::set
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.
std::map erase()
template<
typename Iterator
>
size_type
remove
(
Iterator
first
,
Iterator
last
)
Type |
Name |
Description |
---|---|---|
|
|
The beginning of the range of values. |
|
|
The end of the range of values. |
The number of removed values.
![]() |
Warning |
---|---|
This operation is not thread safe. If it throws, the R-tree may be left in an inconsistent state, elements must not be inserted or removed, methods may return invalid data. |
Remove a range of values from the container.
In contrast to the
or std::set
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.
std::map erase()
template<
typename Range
>
size_type
remove
(
Range const &
rng
)
Type |
Name |
Description |
---|---|---|
|
|
The range of values. |
The number of removed values.
![]() |
Warning |
---|---|
This operation is not thread safe. If it throws, the R-tree may be left in an inconsistent state, elements must not be inserted or removed, methods may return invalid data. |
Finds values meeting spatial predicates, e.g. intersecting some Box.
Spatial predicates may be a
. In this case Values
intersecting the Geometry
are returned.
Geometry
It may be generated by one of the functions listed below:
boost::geometry::index::covered_by()
,
boost::geometry::index::disjoint()
,
boost::geometry::index::intersects()
- default,
boost::geometry::index::overlaps()
,
boost::geometry::index::within()
,
!
boost::geometry::index::covered_by()
,
!
boost::geometry::index::disjoint()
,
!
boost::geometry::index::intersects()
,
!
boost::geometry::index::overlaps()
,
!
boost::geometry::index::within()
boost::geometry::index::value()
.
Those predicates may be passed together in
or std::pair
.
boost::tuple
template<
typename Predicates
,
typename OutIter
>
size_type
spatial_query
(
Predicates const &
pred
,
OutIter
out_it
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial predicates or a Geometry. |
|
|
The output iterator of the result range. E.g. an iterator generated by std::back_inserter(container) |
The number of values found.
Finds one value meeting distances predicates, e.g. nearest to some Point.
Distances predicates may be a
. In this the case the
Value closest to Point
is returned.
Point
It is possible to define how distance to Value is calculated. This is done by passing PointRelation. It can be generated by following functions:
It is possible to define define distances bounds, for example that some distance must be between min_distance and max_distance. This is done by passing DistancesPredicates which can be generated by following functions:
MinRelation and MaxRelation describes bounds and can be generated by following functions:
template<
typename DistancesPredicates
>
size_type
nearest_query
(
DistancesPredicates const &
dpred
,
value_type
&
v
)
Type |
Name |
Description |
---|---|---|
|
|
The distances predicates or a Point. |
|
The reference to the object which will contain the result. |
The number of values found.
If Value copy constructor or copy assignment throws.
Finds one value meeting distances predicates and spatial predicates, e.g. nearest to some Point and intersecting some Box.
Distances predicates may be a
. In this the case the
Value closest to Point
is returned.
Point
It is possible to define how distance to Value is calculated. This is done by passing PointRelation. It can be generated by following functions:
It is possible to define define distances bounds, for example that some distance must be between min_distance and max_distance. This is done by passing DistancesPredicates which can be generated by following functions:
MinRelation and MaxRelation describes bounds and can be generated by following functions:
Spatial predicates may be a
. In this case Values
intersecting the Geometry
are returned.
Geometry
It may be generated by one of the functions listed below:
boost::geometry::index::covered_by()
,
boost::geometry::index::disjoint()
,
boost::geometry::index::intersects()
- default,
boost::geometry::index::overlaps()
,
boost::geometry::index::within()
,
!
boost::geometry::index::covered_by()
,
!
boost::geometry::index::disjoint()
,
!
boost::geometry::index::intersects()
,
!
boost::geometry::index::overlaps()
,
!
boost::geometry::index::within()
boost::geometry::index::value()
.
Those predicates may be passed together in
or std::pair
.
boost::tuple
template<
typename DistancesPredicates
,
typename Predicates
>
size_type
nearest_query
(
DistancesPredicates const &
dpred
,
Predicates const &
pred
,
value_type
&
v
)
Type |
Name |
Description |
---|---|---|
|
|
The distances predicates or a Point. |
|
|
The spatial predicates or a Geometry |
|
The reference to the object which will contain the result. |
The number of values found.
If Value copy constructor or copy assignment throws.
Finds k values meeting distances predicates, e.g. k nearest values to some Point.
Distances predicates may be a
. In this the case the
Value closest to Point
is returned.
Point
It is possible to define how distance to Value is calculated. This is done by passing PointRelation. It can be generated by following functions:
It is possible to define define distances bounds, for example that some distance must be between min_distance and max_distance. This is done by passing DistancesPredicates which can be generated by following functions:
MinRelation and MaxRelation describes bounds and can be generated by following functions:
template<
typename DistancesPredicates
,
typename OutIter
>
size_type
nearest_query
(
DistancesPredicates const &
dpred
,
size_type
k
,
OutIter
out_it
)
Type |
Name |
Description |
---|---|---|
|
|
The distances predicates or a Point. |
|
The max number of values. |
|
|
|
The output iterator of the result range. E.g. a back_insert_iterator. |
The number of values found.
If Value copy constructor or copy assignment throws. If OutIter dereference or increment throws.
Finds k values meeting distances predicates and spatial predicates, e.g. k nearest values to some Point and intersecting some Box.
Distances predicates may be a
. In this the case the
Value closest to Point
is returned.
Point
It is possible to define how distance to Value is calculated. This is done by passing PointRelation. It can be generated by following functions:
It is possible to define define distances bounds, for example that some distance must be between min_distance and max_distance. This is done by passing DistancesPredicates which can be generated by following functions:
MinRelation and MaxRelation describes bounds and can be generated by following functions:
Spatial predicates may be a
. In this case Values
intersecting the Geometry
are returned.
Geometry
It may be generated by one of the functions listed below:
boost::geometry::index::covered_by()
,
boost::geometry::index::disjoint()
,
boost::geometry::index::intersects()
- default,
boost::geometry::index::overlaps()
,
boost::geometry::index::within()
,
!
boost::geometry::index::covered_by()
,
!
boost::geometry::index::disjoint()
,
!
boost::geometry::index::intersects()
,
!
boost::geometry::index::overlaps()
,
!
boost::geometry::index::within()
boost::geometry::index::value()
.
Those predicates may be passed together in
or std::pair
.
boost::tuple
template<
typename DistancesPredicates
,
typename Predicates
,
typename OutIter
>
size_type
nearest_query
(
DistancesPredicates const &
dpred
,
size_type
k
,
Predicates const &
pred
,
OutIter
out_it
)
Type |
Name |
Description |
---|---|---|
|
|
The distances predicates or a Point |
|
The max number of values. |
|
|
|
The spatial predicates or a Geometry. |
|
|
The output iterator of the result range. E.g. a back_insert_iterator. |
The number of values found.
If Value copy constructor or copy assignment throws. If OutIter dereference or increment throws.
Returns the number of stored values.
size_type
size
()
The number of stored values.
Nothing.
Query if the container is empty.
bool
empty
()
true if the container is empty.
Nothing.
Returns the box containing all values stored in the container.
Returns the box containing all values stored in the container. If the
container is empty the result of
is returned.
geometry::assign_inverse()
box_type
const &
box
()
The box containing all values stored in the container or an invalid box if there are no values in the container.
Nothing.
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.
template<
typename ValueOrIndexable
>
size_type
count
(
ValueOrIndexable const &
vori
)
Type |
Name |
Description |
---|---|---|
|
|
The value or indexable which will be counted. |
The number of values found.
Nothing.
Returns parameters.
parameters_type
const &
parameters
()
The parameters object.
Nothing.
Returns the translator object.
translator_type
const &
translator
()
The translator object.
Nothing.
Returns allocator used by the rtree.
allocator_type
get_allocator
()
The allocator.
If allocator copy constructor throws.
Function |
Description |
---|---|
Insert a value to the index. |
|
Insert a range of values to the index. |
|
Insert a range of values to the index. |
|
Remove a value from the container. |
|
Remove a range of values from the container. |
|
Remove a range of values from the container. |
|
|
Find values meeting spatial predicates. |
|
Find the value meeting distances predicates. |
|
Find the value meeting distances and spatial predicates. |
Find k values meeting distances predicates. |
|
Find k values meeting distances and spatial predicates. |
|
Remove all values from the index. |
|
Get the number of values stored in the index. |
|
Query if there are no values stored in the index. |
|
Get the box containing all stored values or an invalid box if the index has no values. |
Insert a value to the index.
It calls rtree::insert(value_type
const&)
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
>
void boost::geometry::index::insert
(
rtree< Value, Options, Translator, Allocator > &
tree
,
Value const &
v
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The value which will be stored in the index. |
Insert a range of values to the index.
It calls rtree::insert(Iterator,
Iterator)
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
,
typename Iterator
>
void boost::geometry::index::insert
(
rtree< Value, Options, Translator, Allocator > &
tree
,
Iterator
first
,
Iterator
last
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The beginning of the range of values. |
|
|
The end of the range of values. |
Insert a range of values to the index.
It calls rtree::insert(Range
const&)
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
,
typename Range
>
void boost::geometry::index::insert
(
rtree< Value, Options, Translator, Allocator > &
tree
,
Range const &
rng
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The range of values. |
Remove a value from the container.
Remove a value from the container. In contrast to the
or std::set
method this function removes
only one value from the container.
std::map erase()
It calls rtree::remove(value_type
const&)
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
>
rtree<Value, Options, Translator, Allocator>::size_type boost::geometry::index::remove
(
rtree< Value, Options, Translator, Allocator > &
tree
,
Value const &
v
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The value which will be removed from the index. |
1 if value was removed, 0 otherwise.
Remove a range of values from the container.
Remove a range of values from the container. In contrast to the
or std::set
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 function removes only one
value for each one passed in the range, not all equal values.
std::map erase()
It calls rtree::remove(Iterator,
Iterator)
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
,
typename Iterator
>
rtree<Value, Options, Translator, Allocator>::size_type boost::geometry::index::remove
(
rtree< Value, Options, Translator, Allocator > &
tree
,
Iterator
first
,
Iterator
last
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The beginning of the range of values. |
|
|
The end of the range of values. |
The number of removed values.
Remove a range of values from the container.
Remove a range of values from the container. In contrast to the
or std::set
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.
std::map erase()
It calls rtree::remove(Range
const&)
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
,
typename Range
>
rtree<Value, Options, Translator, Allocator>::size_type boost::geometry::index::remove
(
rtree< Value, Options, Translator, Allocator > &
tree
,
Range const &
rng
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The range of values. |
The number of removed values.
Find values meeting spatial predicates.
It calls rtree::spatial_query
with parameters
.
(Predicates const&, OutIter)
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
,
typename Predicates
,
typename OutIter
>
size_t boost::geometry::index::spatial_query
(
rtree< Value, Options, Translator, Allocator > const &
tree
,
Predicates const &
pred
,
OutIter
out_it
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The spatial predicates. |
|
|
The output iterator of the result range. |
The number of found values.
Find the value meeting distances predicates.
It calls rtree::nearest_query
with parameters
.
(DistancesPredicates const& dpred, value_type
& v)
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
,
typename DistancesPredicates
>
size_t boost::geometry::index::nearest_query
(
rtree< Value, Options, Translator, Allocator > const &
tree
,
DistancesPredicates const &
dpred
,
Value &
v
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The distances predicates. |
|
|
The result. |
The number of found values.
Find the value meeting distances and spatial predicates.
It calls rtree::nearest_query
with parameters
.
(DistancesPredicates const& dpred, Predicates
const&
pred,
value_type &
v)
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
,
typename DistancesPredicates
,
typename Predicates
>
size_t boost::geometry::index::nearest_query
(
rtree< Value, Options, Translator, Allocator > const &
tree
,
DistancesPredicates const &
dpred
,
Predicates const &
pred
,
Value &
v
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The distances predicates. |
|
|
The spatial predicates. |
|
|
The result. |
The number of found values.
Find k values meeting distances predicates.
It calls rtree::nearest_query
with parameters
.
(DistancesPredicates const
& dpred, size_type
k,
OutIter out_it)
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
,
typename DistancesPredicates
,
typename OutIter
>
size_t boost::geometry::index::nearest_query
(
rtree< Value, Options, Translator, Allocator > const &
tree
,
DistancesPredicates const &
dpred
,
typename rtree< Value, Options, Translator, Allocator >::size_type
k
,
OutIter
out_it
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The distances predicates. |
|
|
The max number of values. |
|
|
The output iterator of the result range. |
The number of found values.
Find k values meeting distances and spatial predicates.
It calls rtree::nearest_query
with parameters
.
(DistancesPredicates const
& dpred, size_type
k,
Predicates const
& pred, OutIter
out_it)
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
,
typename DistancesPredicates
,
typename Predicates
,
typename OutIter
>
size_t boost::geometry::index::nearest_query
(
rtree< Value, Options, Translator, Allocator > const &
tree
,
DistancesPredicates const &
dpred
,
typename rtree< Value, Options, Translator, Allocator >::size_type
k
,
Predicates const &
pred
,
OutIter
out_it
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
|
|
The distances predicates. |
|
|
The max number of values. |
|
|
The spatial predicates. |
|
|
The output iterator of the result range. |
The number of found values.
Remove all values from the index.
It calls rtree::clear()
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
>
void boost::geometry::index::clear
(
rtree< Value, Options, Translator, Allocator > &
tree
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
Get the number of values stored in the index.
It calls rtree::size()
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
>
size_t boost::geometry::index::size
(
rtree< Value, Options, Translator, Allocator > const &
tree
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
The number of values stored in the index.
Query if there are no values stored in the index.
It calls rtree::empty()
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
>
bool boost::geometry::index::empty
(
rtree< Value, Options, Translator, Allocator > const &
tree
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
true if there are no values in the index.
Get the box containing all stored values or an invalid box if the index has no values.
It calls rtree::box()
.
template<
typename Value
,
typename Options
,
typename Translator
,
typename Allocator
>
rtree<Value, Options, Translator, Allocator>::box_type const& boost::geometry::index::box
(
rtree< Value, Options, Translator, Allocator > const &
tree
)
Type |
Name |
Description |
---|---|---|
|
|
The spatial index. |
The box containing all stored values or an invalid box.
Linear r-tree creation algorithm parameters.
#include <boost/geometry/extensions/index/parameters.hpp>
template<
size_t MaxElements
,
size_t MinElements
>
struct linear
{
// ...
};
Parameter |
Description |
---|---|
|
Maximum number of elements in nodes. |
|
Minimum number of elements in nodes. |
Quadratic r-tree creation algorithm parameters.
#include <boost/geometry/extensions/index/parameters.hpp>
template<
size_t MaxElements
,
size_t MinElements
>
struct quadratic
{
// ...
};
Parameter |
Description |
---|---|
|
Maximum number of elements in nodes. |
|
Minimum number of elements in nodes. |
R*-tree creation algorithm parameters.
#include <boost/geometry/extensions/index/parameters.hpp>
template<
size_t MaxElements
,
size_t MinElements
,
size_t OverlapCostThreshold
=0
,
size_t ReinsertedElements
=detail::default_rstar_reinserted_elements_s
<MaxElements>::value
>
struct rstar
{
// ...
};
Parameter |
Description |
---|---|
|
Maximum number of elements in nodes. |
|
Minimum number of elements in nodes. |
|
The number of leaf node children elements above which nearly minimum overlap cost is calculated instead of minimum overlap cost. If 0 minimum overlap cost is always calculated. |
|
Number of elements reinserted by forced reinsertions algorithm. |
Linear r-tree creation algorithm parameters.
#include <boost/geometry/extensions/index/parameters.hpp>
class linear
{
// ...
};
Function |
Description |
---|---|
The constructor. |
The constructor.
linear
(
size_t
max_elements
,
size_t
min_elements
)
Type |
Name |
Description |
---|---|---|
|
|
Maximum number of elements in nodes. |
|
|
Minimum number of elements in nodes. |
Quadratic r-tree creation algorithm parameters.
#include <boost/geometry/extensions/index/parameters.hpp>
class quadratic
{
// ...
};
Function |
Description |
---|---|
The constructor. |
The constructor.
quadratic
(
size_t
max_elements
,
size_t
min_elements
)
Type |
Name |
Description |
---|---|---|
|
|
Maximum number of elements in nodes. |
|
|
Minimum number of elements in nodes. |
R*-tree creation algorithm parameters.
#include <boost/geometry/extensions/index/parameters.hpp>
class rstar
{
// ...
};
Function |
Description |
---|---|
The constructor. |
The constructor.
rstar
(
size_t
max_elements
,
size_t
min_elements
,
size_t
overlap_cost_threshold
=0
,
size_t
reinserted_elements
=detail::default_rstar_reinserted_elements_d()
)
Type |
Name |
Description |
---|---|---|
|
|
Maximum number of elements in nodes. |
|
|
Minimum number of elements in nodes. |
|
|
The number of leaf node children elements above which nearly minimum overlap cost is calculated instead of minimum overlap cost. If 0 minimum overlap cost is always calculated. |
|
|
Number of elements reinserted by forced reinsertions algorithm. |
Function |
Description |
---|---|
Generate empty predicate. |
|
Generate value predicate. |
|
Generate |
|
Generate |
|
Generate |
|
Generate |
|
Generate |
Generate value predicate.
A wrapper around user-defined functor describing if Value should be returned by spatial query.
template<
typename ValuePredicate
>
detail::value<ValuePredicate> boost::geometry::index::value
(
ValuePredicate const &
vpred
)
Parameter |
Description |
---|---|
|
Functor type. |
Type |
Name |
Description |
---|---|---|
|
|
The functor. |
Generate covered_by()
predicate.
Generate a predicate defining Value and Geometry relationship. Value
will be returned by the query if
returns true.
bg::covered_by(Indexable, Geometry)
template<
typename Geometry
>
detail::covered_by<Geometry> boost::geometry::index::covered_by
(
Geometry const &
g
)
Parameter |
Description |
---|---|
|
The Geometry type. |
Type |
Name |
Description |
---|---|---|
|
|
The Geometry object. |
Generate disjoint()
predicate.
Generate a predicate defining Value and Geometry relationship. Value
will be returned by the query if
returns true.
bg::disjoint(Indexable, Geometry)
template<
typename Geometry
>
detail::disjoint<Geometry> boost::geometry::index::disjoint
(
Geometry const &
g
)
Parameter |
Description |
---|---|
|
The Geometry type. |
Type |
Name |
Description |
---|---|---|
|
|
The Geometry object. |
Generate intersects()
predicate.
Generate a predicate defining Value and Geometry relationship. Value
will be returned by the query if
returns true.
bg::intersects(Indexable, Geometry)
template<
typename Geometry
>
detail::intersects<Geometry> boost::geometry::index::intersects
(
Geometry const &
g
)
Parameter |
Description |
---|---|
|
The Geometry type. |
Type |
Name |
Description |
---|---|---|
|
|
The Geometry object. |
Generate overlaps()
predicate.
Generate a predicate defining Value and Geometry relationship. Value
will be returned by the query if
returns true.
bg::overlaps(Indexable, Geometry)
template<
typename Geometry
>
detail::overlaps<Geometry> boost::geometry::index::overlaps
(
Geometry const &
g
)
Parameter |
Description |
---|---|
|
The Geometry type. |
Type |
Name |
Description |
---|---|---|
|
|
The Geometry object. |
Generate within()
predicate.
Generate a predicate defining Value and Geometry relationship. Value
will be returned by the query if
returns true.
bg::within(Indexable, Geometry)
template<
typename Geometry
>
detail::within<Geometry> boost::geometry::index::within
(
Geometry const &
g
)
Parameter |
Description |
---|---|
|
The Geometry type. |
Type |
Name |
Description |
---|---|---|
|
|
The Geometry object. |
Function |
Description |
---|---|
Generate to_nearest() Point-Indexable relationship. |
|
Generate to_centroid() Point-Indexable relationship. |
|
Generate to_furthest() Point-Indexable relationship. |
|
Generate unbounded() distance predicate. |
|
Generate min_bounded() distance predicate. |
|
Generate max_bounded() distance predicate. |
|
|
Generate bounded() distance predicate. |
Generate to_nearest() Point-Indexable relationship.
Generate a nearest query Point and Value's Indexable relationship while calculating distances. This function may be used to define that knn query should calculate distances as smallest as possible between query Point and Indexable's points. In other words it should be the distance to the nearest Indexable's point. This function may be also used to define distances bounds which indicates that Indexable's nearest point should be closer or further than value v. This is default relation.
template<
typename T
>
detail::to_nearest<T> boost::geometry::index::to_nearest
(
T const &
v
)
Parameter |
Description |
---|---|
|
Type of wrapped object. This may be a Point for PointRelation or some Value for MinRelation or MaxRelation |
Type |
Name |
Description |
---|---|---|
|
|
Point or bound value. |
Generate to_centroid() Point-Indexable relationship.
Generate a nearest query Point and Value's Indexable relationship while calculating distances. This function may be used to define that knn query should calculate distances between query Point and Indexable's centroid. This function may be also used to define distances bounds which indicates that Indexable's centroid should be closer or further than value v.
template<
typename T
>
detail::to_centroid<T> boost::geometry::index::to_centroid
(
T const &
v
)
Parameter |
Description |
---|---|
|
Type of wrapped object. This may be a Point for PointRelation or some Value for MinRelation or MaxRelation |
Type |
Name |
Description |
---|---|---|
|
|
Point or bound value. |
Generate to_furthest() Point-Indexable relationship.
Generate a nearest query Point and Value's Indexable relationship while calculating distances. This function may be used to define that knn query should calculate distances as biggest as possible between query Point and Indexable's points. In other words it should be the distance to the furthest Indexable's point. This function may be also used to define distances bounds which indicates that Indexable's furthest point should be closer or further than value v.
template<
typename T
>
detail::to_furthest<T> boost::geometry::index::to_furthest
(
T const &
v
)
Parameter |
Description |
---|---|
|
Type of wrapped object. This may be a Point for PointRelation or some Value for MinRelation or MaxRelation |
Type |
Name |
Description |
---|---|---|
|
|
Point or bound value. |
Generate unbounded() distance predicate.
Generate a distance predicate. This defines distances bounds which are used by knn query. This function indicates that there is no distance bounds and Values should be returned if distances between Point and Indexable are the smallest. Distance calculation is defined by PointRelation. This is default nearest predicate.
template<
typename PointRelation
>
detail::unbounded<PointRelation> boost::geometry::index::unbounded
(
PointRelation const &
pr
)
Parameter |
Description |
---|---|
|
PointRelation type. |
Type |
Name |
Description |
---|---|---|
|
|
The point relation. This may be generated by |
Generate min_bounded() distance predicate.
Generate a distance predicate. This defines distances bounds which are used by knn query. This function indicates that Values should be returned only if distances between Point and Indexable are greater or equal to some min_distance passed in MinRelation. Check for closest Value is defined by PointRelation. So it is possible e.g. to return Values with centroids closest to some Point but only if nearest points are further than some distance.
template<
typename PointRelation
,
typename MinRelation
>
detail::min_bounded<PointRelation, MinRelation> boost::geometry::index::min_bounded
(
PointRelation const &
pr
,
MinRelation const &
minr
)
Parameter |
Description |
---|---|
|
PointRelation type. |
|
MinRelation type. |
Type |
Name |
Description |
---|---|---|
|
|
The point relation. This may be generated by |
|
|
The minimum bound relation. This may be generated by |
Generate max_bounded() distance predicate.
Generate a distance predicate. This defines distances bounds which are used by knn query. This function indicates that Values should be returned only if distances between Point and Indexable are lesser or equal to some max_distance passed in MaxRelation. Check for closest Value is defined by PointRelation. So it is possible e.g. to return Values with centroids closest to some Point but only if nearest points are closer than some distance.
template<
typename PointRelation
,
typename MaxRelation
>
detail::max_bounded<PointRelation, MaxRelation> boost::geometry::index::max_bounded
(
PointRelation const &
pr
,
MaxRelation const &
maxr
)
Parameter |
Description |
---|---|
|
PointRelation type. |
|
MaxRelation type. |
Type |
Name |
Description |
---|---|---|
|
|
The point relation. This may be generated by |
|
|
The maximum bound relation. This may be generated by |
Generate bounded() distance predicate.
Generate a distance predicate. This defines distances bounds which are used by knn query. This function indicates that Values should be returned only if distances between Point and Indexable are greater or equal to some min_distance passed in MinRelation and lesser or equal to some max_distance passed in MaxRelation. Check for closest Value is defined by PointRelation. So it is possible e.g. to return Values with centroids closest to some Point but only if nearest points are further than some distance and closer than some other distance.
template<
typename PointRelation
,
typename MinRelation
,
typename MaxRelation
>
detail::bounded<PointRelation, MinRelation, MaxRelation> boost::geometry::index::bounded
(
PointRelation const &
pr
,
MinRelation const &
minr
,
MaxRelation const &
maxr
)
Parameter |
Description |
---|---|
|
PointRelation type. |
|
MinRelation type. |
|
MaxRelation type. |
Type |
Name |
Description |
---|---|---|
|
|
The point relation. This may be generated by |
|
|
The minimum bound relation. This may be generated by |
|
|
The maximum bound relation. This may be generated by |
Function |
Description |
---|---|
|
The nearest query index adaptor generator. |
The nearest query index adaptor generator. |
|
The spatial query index adaptor generator. |
The nearest query index adaptor generator.
template<
typename DistancesPredicates
,
typename Predicates
>
detail::nearest_query<DistancesPredicates, Predicates> boost::geometry::index::adaptors::nearest_queried
(
DistancesPredicates const &
dpred
,
size_t
k
,
Predicates const &
pred
)
Type |
Name |
Description |
---|---|---|
|
|
Distance predicates. |
|
|
The number of values to find. |
|
|
Spatial predicates. |
The nearest query index adaptor generator.
template<
typename DistancesPredicates
>
detail::nearest_query<DistancesPredicates, index::detail::empty> boost::geometry::index::adaptors::nearest_queried
(
DistancesPredicates const &
dpred
,
size_t
k
)
Type |
Name |
Description |
---|---|---|
|
|
Distance predicates. |
|
|
The number of values to find. |
The spatial query index adaptor generator.
template<
typename Predicates
>
detail::spatial_query<Predicates> boost::geometry::index::adaptors::spatial_queried
(
Predicates const &
pred
)
Type |
Name |
Description |
---|---|---|
|
|
Spatial predicates. |
It translates Value object to Indexable object. The default version handles Values which are Indexables. This translator is also specialized for std::pair<Indexable, Second> and boost::tuple<Indexable, ...>.
#include <boost/geometry/extensions/index/translator/def.hpp>
template<
typename Value
>
struct def
{
// ...
};
Parameter |
Description |
---|---|
|
The Value type which may be translated directly to the Indexable. |
This translator translates from index of an element in an external Container to the Indexable. The container should have operator[](size_type) defined. Index translator uses translator::def<...> to translate from Container::value_type to the Indexable which means that it can handle Indexables, std::pairs and boost::tuples stored in an external Container.
#include <boost/geometry/extensions/index/translator/index.hpp>
template<
typename Container
>
class index
{
// ...
};
Parameter |
Description |
---|---|
|
The Container type. |
Function |
Description |
---|---|
The constructor. |
The constructor.
index
(
Container const &
c
)
Type |
Name |
Description |
---|---|---|
|
|
The container which stores indexed values. |
Function |
Description |
---|---|
Insert iterator generator. |
Insert iterator generator.
Returns insert iterator capable to insert values to the container (spatial index) which has member function insert(value_type const&) defined.
template<
typename Container
>
insert_iterator<Container> boost::geometry::index::inserter
(
Container &
c
)
Type |
Name |
Description |
---|---|---|
|
|
The reference to the container (spatial index) to which values will be inserted. |
The insert iterator inserting values to the container.