diff --git a/include/boost/geometry/index/predicates.hpp b/include/boost/geometry/index/predicates.hpp index e03c9ce5a..10033abff 100644 --- a/include/boost/geometry/index/predicates.hpp +++ b/include/boost/geometry/index/predicates.hpp @@ -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 inline -detail::nearest -nearest(Point const& point, unsigned k) +template inline +detail::nearest +nearest(Geometry const& geometry, unsigned k) { - return detail::nearest(point, k); + return detail::nearest(geometry, k); } #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL