|  | Home | Libraries | People | FAQ | More | 
Generate nearest() predicate.
            When nearest predicate is passed to the query, k-nearest neighbour search
            will be performed. nearest()
            predicate takes a GeometryValuesValues
template<typename Geometry>unspecifiednearest(Geometry const &geometry,unsignedk)
| Type | Name | Description | 
|---|---|---|
| 
                       | 
                       | The geometry 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)); bgi::query(spatial_index, bgi::nearest(box, 5), std::back_inserter(result));
| ![[Warning]](../../../../../../../../doc/src/images/warning.png) | Warning | 
|---|---|
| 
              Only one  |