From f40b7975f2e5af4a198971d4b831c405d2ead3db Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Wed, 16 Aug 2017 14:48:04 +0200 Subject: [PATCH] Change from rtree.q{begin,end} to rtree.query (Boost 1.55 support) --- src/extractor/location_dependent_data.cpp | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/extractor/location_dependent_data.cpp b/src/extractor/location_dependent_data.cpp index bb337cdf1..001ee0b08 100644 --- a/src/extractor/location_dependent_data.cpp +++ b/src/extractor/location_dependent_data.cpp @@ -8,7 +8,9 @@ #include #include +#include +#include #include namespace osrm @@ -125,21 +127,19 @@ sol::table LocationDependentData::operator()(sol::state &state, const osmium::Wa const point_t point(location.lon(), location.lat()); auto table = sol::table(state, sol::create); + auto merger = [this, &table](const rtree_t::value_type &rtree_entry) { + for (const auto &key_value : polygons[rtree_entry.second].second) + { + boost::apply_visitor(table_setter(table, key_value.first), key_value.second); + } + }; // Search the R-tree and collect a Lua table of tags that correspond to the location - for (auto it = rtree.qbegin( - boost::geometry::index::intersects(point) && - boost::geometry::index::satisfies([this, &point](const rtree_t::value_type &v) { - return boost::geometry::within(point, polygons[v.second].first); - })); - it != rtree.qend(); - ++it) - { - for (const auto &pair : polygons[it->second].second) - { - boost::apply_visitor(table_setter(table, pair.first), pair.second); - } - } + rtree.query(boost::geometry::index::intersects(point) && + boost::geometry::index::satisfies([this, &point](const rtree_t::value_type &v) { + return boost::geometry::within(point, polygons[v.second].first); + }), + boost::make_function_output_iterator(std::ref(merger))); return table; }