[index] Update description and parameters names of nearest() predicate

This commit is contained in:
Adam Wulkiewicz
2014-05-15 03:21:38 +02:00
parent 8aa3ef425e
commit f41ef36258

View File

@@ -2,7 +2,7 @@
//
// Spatial query predicates
//
// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
//
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -269,13 +269,15 @@ satisfies(UnaryPredicate const& pred)
\brief Generate nearest() predicate.
When nearest predicate is passed to the query, k-nearest neighbour search will be performed.
\c nearest() predicate takes a \c Point from which distance to \c Values is calculated
and the maximum number of \c Values that should be returned.
\c nearest() predicate takes a \c Geometry from which distances to \c Values are calculated
and the maximum number of \c Values that should be returned. Internally
boost::geometry::comparable_distance() is used to perform the calculation.
\par Example
\verbatim
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));
\endverbatim
\warning
@@ -283,14 +285,14 @@ Only one \c nearest() predicate may be used in a query.
\ingroup predicates
\param point The point from which distance is calculated.
\param geometry The geometry from which distance is calculated.
\param k The maximum number of values to return.
*/
template <typename Point> inline
detail::nearest<Point>
nearest(Point const& point, unsigned k)
template <typename Geometry> inline
detail::nearest<Geometry>
nearest(Geometry const& geometry, unsigned k)
{
return detail::nearest<Point>(point, k);
return detail::nearest<Geometry>(geometry, k);
}
#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL