Hi to all I'm using the rtree* to load 1M > data points . Then I use the rtree query to different intersection query like
found +=rtree.query(bgi::intersects(qbox), std::back_inserter(result));
currently I'm interested in getting the count of results rather than inserting into the result vector
I have to two question
1. is possible to skip std::back_inserter step and do a query that finds the count only.2. How can improve the performance of the std::back_inserter methods as my results are N^2 where N > 1M usually . ( check this post https://pkisensee.wordpress.com/2011/06/02/efficient-stl-insertion-tip-of-the-month/)
boost::function_output_iterator
2. query iterator
size_t counter = 0;
// using C++11 lambda expression, in C++98 you can pass a function object
rtree.query(bgi::intersects(box), boost::make_function_output_iterator( [&](Value const&) { counter++; }));
size_t count =
std::distance(tree.qbegin(intersects(box)), tree.qend())
;