Do Boost Geometry nearest queries always sort results ordered by smallest distance first?

888 views Asked by At

I have made a few simple Cartesian Point to Point tests:

rtree.qbegin(bgi::nearest(Point(4, 4), 2))

and they were sorted in Boost 1.61.

Now I'd like a documentation or source quote to confirm it.

If not, I will just sort the query output myself afterwards.

1

There are 1 answers

1
user3853544 On

[Note] In the case of iterative k-NN queries it is guaranteed to iterate over the closest Values first.

For K Nearest Neighbours boost::geometry guarantees to iterate over closest values first.

Source