...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Generate nearest() predicate.
When nearest predicate is passed to the query, k-nearest neighbour search
will be performed. nearest()
predicate takes a
from which distance to Point
is calculated and the maximum number of Values
that should be returned.
Values
template<
typename Point
>
detail::nearest<Point> boost::geometry::index::nearest
(
Point const &
point
,
unsigned
k
)
Type |
Name |
Description |
---|---|---|
|
|
The point from which distance is calculated. |
|
|
The maximum number of values to return. |
bgi::query(spatial_index, bgi::nearest(pt, 5), std::back_inserter(result)); bgi::query(spatial_index, bgi::nearest(pt, 5) && bgi::intersects(box), std::back_inserter(result));
Warning | |
---|---|
Only one |