7

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.

  • 2
    I'm going to be impolite and plink @BarendGehrels and @ AdamWulkiewicz - I think the question is likely simple to answer for some of you. Perhaps information could be added to the documentation :) Cheers – sehe Jan 23 '17 at 11:36
  • There is information about it in the docs regarding the iterative query (cited below in the answer) but sure I may put there something regarding non-iterative one. – Adam Wulkiewicz Mar 04 '17 at 01:12

1 Answers1

5

[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

marli
  • 425
  • 9
  • 16
user3853544
  • 573
  • 3
  • 9
  • Yes, in case of iterative queries it's guaranteed to get the closest values first. In case of the non-iterative query the values may be not sorted. – Adam Wulkiewicz Mar 04 '17 at 01:03