![]() |
Home | Libraries | People | FAQ | More |
The R-tree spatial index. 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: bgi::linear<MinElements, MaxElements>, bgi::quadratic<MinElements, MaxElements>, bgi::rstar<MinElements, MaxElements, OverlapCostThreshold = 0, ReinsertedElements = MaxElements * 0.3>. Predefined algorithms with run-time parameters are: bgi::runtime::linear, bgi::runtime::quadratic, bgi::runtime::rstar.
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 (which are Indexables). It also handles std::pair<Indexable, T>, pointers, smart pointers, and iterators. E.g. If std::pair<Box, int> is stored, the default translator translates from std::pair<Box, int> const& to Box const&.
#include <.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. |
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. |
If allocator copy constructor throws. If Value copy constructor or copy assignment throws. When nodes allocation fails.
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. |
If allocator copy constructor throws. If Value copy constructor or copy assignment throws. When nodes allocation fails.
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. |
If allocator copy constructor throws. If Value copy constructor throws. When nodes allocation fails.
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. |
If allocator copy constructor throws. If Value copy constructor throws. When nodes allocation fails.
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. |
If allocator move constructor throws.
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. |
If Value copy constructor throws. When nodes allocation fails.
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. If Value copy constructor throws. When nodes allocation fails.
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. |
If Value copy constructor or copy assignment throws. When nodes allocation fails.
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. |
If Value copy constructor or copy assignment throws. When nodes allocation fails.
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. |
If Value copy constructor or copy assignment throws. When nodes allocation fails.
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 STL set/map erase() method this method removes only one value from the container.
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.
If Value copy constructor or copy assignment throws. When nodes allocation fails.
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 STL set/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.
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.
If Value copy constructor or copy assignment throws. When nodes allocation fails.
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 STL set/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.
template<typename Range> size_type remove(Range const & rng)
Type |
Name |
Description |
---|---|---|
|
|
The range of values. |
The number of removed values.
If Value copy constructor or copy assignment throws. When nodes allocation fails.
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 Geometry (in this case default predicate - intersects is used) or generated by bgi::covered_by(geometry), bgi::disjoint(geometry), bgi::intersects(geometry), bgi::overlaps(geometry), bgi::within(geometry), !bgi::covered_by(geometry), !bgi::disjoint(geometry), !bgi::intersects(geometry), !bgi::overlaps(geometry), !bgi::within(geometry) or bgi::value(func). Those predicates may be passed together in std::pair or 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.
If Value copy constructor or copy assignment throws. If OutIter dereference or increment throws.
Finds one value meeting distances predicates, e.g. nearest to some Point.
The distances predicates may be a Point. This is default case where Value which nearest point is closest to Point is returned. May be a PointRelation which define how distance to Value is calculated. This may be generated by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point). DistancesPredicates may also define distances bounds. E.g. that some distance must be between min_distance and max_distance. This may be generated by bgi::unbounded(PointRelation) - default case, bgi::min_bounded(PointRelation, MinRelation), bgi::max_bounded(PointRelation, MaxRelation), bgi::bounded(PointRelation, MinRelation, MaxRelation). MinRelation and MaxRelation describes bounds and may be generated by bgi::to_nearest(dist_bound), bgi::to_centroid(dist_bound) or bgi::to_furthest(dist_bound).
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.
The distances predicates may be a Point. This is default case where Value which nearest point is closest to Point is returned. May be a PointRelation which define how distance to Value is calculated. This may be generated by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point). DistancesPredicates may also define distances bounds. E.g. that some distance must be between min_distance and max_distance. This may be generated by bgi::unbounded(PointRelation) - default case, bgi::min_bounded(PointRelation, MinRelation), bgi::max_bounded(PointRelation, MaxRelation), bgi::bounded(PointRelation, MinRelation, MaxRelation). MinRelation and MaxRelation describes bounds and may be generated by bgi::to_nearest(dist_bound), bgi::to_centroid(dist_bound) or bgi::to_furthest(dist_bound).
The spatial predicates. May be a Geometry (in this case default predicate - intersects is used) or generated by bgi::covered_by(geometry), bgi::disjoint(geometry), bgi::intersects(geometry), bgi::overlaps(geometry), bgi::within(geometry), !bgi::covered_by(geometry), !bgi::disjoint(geometry), !bgi::intersects(geometry), !bgi::overlaps(geometry), !bgi::within(geometry) or bgi::value(func). Those predicates may be passed together in std::pair or 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.
The distances predicates. May be a Point. This is default case where Value which nearest point is closest to Point is returned. May be a PointRelation which define how distance to Value is calculated. This may be generated by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point). DistancesPredicates may also define distances bounds. E.g. that some distance must be between min_distance and max_distance. This may be generated by bgi::unbounded(PointRelation) - default case, bgi::min_bounded(PointRelation, MinRelation), bgi::max_bounded(PointRelation, MaxRelation), bgi::bounded(PointRelation, MinRelation, MaxRelation). MinRelation and MaxRelation describes bounds and may be generated by bgi::to_nearest(dist_bound), bgi::to_centroid(dist_bound) or bgi::to_furthest(dist_bound).
template<typename DistancesPredicates, typename OutIter> size_type nearest_query(DistancesPredicates const & dpred, size_t 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.
The distances predicates may be a Point. This is default case where Value which nearest point is closest to Point is returned. May be a PointRelation which define how distance to Value is calculated. This may be generated by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point). DistancesPredicates may also define distances bounds. E.g. that some distance must be between min_distance and max_distance. This may be generated by bgi::unbounded(PointRelation) - default case, bgi::min_bounded(PointRelation, MinRelation), bgi::max_bounded(PointRelation, MaxRelation), bgi::bounded(PointRelation, MinRelation, MaxRelation). MinRelation and MaxRelation describes bounds and may be generated by bgi::to_nearest(dist_bound), bgi::to_centroid(dist_bound) or bgi::to_furthest(dist_bound).
The spatial predicates. May be a Geometry (in this case default predicate - intersects is used) or generated by bgi::covered_by(geometry), bgi::disjoint(geometry), bgi::intersects(geometry), bgi::overlaps(geometry), bgi::within(geometry), !bgi::covered_by(geometry), !bgi::disjoint(geometry), !bgi::intersects(geometry), !bgi::overlaps(geometry), !bgi::within(geometry) or bgi::value(func). Those predicates may be passed together in std::pair or boost::tuple.
template<typename DistancesPredicates, typename Predicates, typename OutIter> size_type nearest_query(DistancesPredicates const & dpred, size_t 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 geometry::assign_inverse() is returned.
box_type 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.
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.
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.
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 STL set/map erase() method this function removes only one value from the container.
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 STL set/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 function removes only one value for each one passed in the range, not all equal values.
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 STL set/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.
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.
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.
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.
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.
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, size_t 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.
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, size_t 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.
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.
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.
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.
template<typename Value, typename Options, typename Translator, typename Allocator> rtree<Value, Options, Translator, Allocator>::box_type 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.
Function |
Description |
---|---|
Generate empty predicate. |
|
Generate value predicate. |
|
Generate covered_by() predicate. |
|
Generate disjoint() predicate. |
|
Generate intersects() predicate. |
|
Generate overlaps() predicate. |
|
Generate within() predicate. |
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)
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 bg::covered_by(Indexable, Geometry) returns true.
template<typename Geometry> detail::covered_by<Geometry> boost::geometry::index::covered_by(Geometry const & g)
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 bg::disjoint(Indexable, Geometry) returns true.
template<typename Geometry> detail::disjoint<Geometry> boost::geometry::index::disjoint(Geometry const & g)
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 bg::intersects(Indexable, Geometry) returns true.
template<typename Geometry> detail::intersects<Geometry> boost::geometry::index::intersects(Geometry const & g)
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 bg::overlaps(Indexable, Geometry) returns true.
template<typename Geometry> detail::overlaps<Geometry> boost::geometry::index::overlaps(Geometry const & g)
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 bg::within(Indexable, Geometry) returns true.
template<typename Geometry> detail::within<Geometry> boost::geometry::index::within(Geometry const & g)
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)
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)
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)
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)
Type |
Name |
Description |
---|---|---|
|
|
The point relation. This may be generated by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point). |
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)
Type |
Name |
Description |
---|---|---|
|
|
The point relation. This may be generated by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point). |
|
|
The minimum bound relation. This may be generated by bgi::to_nearest(min_distance), bgi::to_centroid(min_distance) or bgi::to_furthest(min_distance). |
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)
Type |
Name |
Description |
---|---|---|
|
|
The point relation. This may be generated by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point). |
|
|
The maximum bound relation. This may be generated by bgi::to_nearest(max_distance), bgi::to_centroid(max_distance) or bgi::to_furthest(max_distance). |
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)
Type |
Name |
Description |
---|---|---|
|
|
The point relation. This may be generated by bgi::to_nearest(Point), bgi::to_centroid(Point) or bgi::to_furthest(Point). |
|
|
The minimum bound relation. This may be generated by bgi::to_nearest(min_distance), bgi::to_centroid(min_distance) or bgi::to_furthest(min_distance). |
|
|
The maximum bound relation. This may be generated by bgi::to_nearest(max_distance), bgi::to_centroid(max_distance) or bgi::to_furthest(max_distance). |
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 <.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 <.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.