From da02dc40c2331c16c02d87567e068293ff6d359a Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 16 Jan 2015 17:19:59 +0100 Subject: [PATCH] sort index array by offsets --- plugins/input/large_geojson/large_geojson_datasource.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/input/large_geojson/large_geojson_datasource.cpp b/plugins/input/large_geojson/large_geojson_datasource.cpp index 3f873fc4a..4b5f418be 100644 --- a/plugins/input/large_geojson/large_geojson_datasource.cpp +++ b/plugins/input/large_geojson/large_geojson_datasource.cpp @@ -25,6 +25,7 @@ #include #include +#include // boost @@ -314,10 +315,14 @@ mapnik::featureset_ptr large_geojson_datasource::features(mapnik::query const& q { #if BOOST_VERSION >= 105600 large_geojson_featureset::array_type index_array; + using item_type = large_geojson_featureset::array_type::value_type; if (tree_) { tree_->query(boost::geometry::index::intersects(box),std::back_inserter(index_array)); std::cerr << "Query size=" << index_array.size() << std::endl; + std::cerr << "Sort index_array by offsets" << std::endl; + std::sort(index_array.begin(),index_array.end(), [](item_type const& item0, item_type const& item1) {return item0.second < item1.second;}); + std::cerr << "Done" << std::endl; return std::make_shared(filename_, std::move(index_array)); } #else