diff --git a/include/mapnik/util/spatial_index.hpp b/include/mapnik/util/spatial_index.hpp index c7d3fd145..3f4cc3fa9 100644 --- a/include/mapnik/util/spatial_index.hpp +++ b/include/mapnik/util/spatial_index.hpp @@ -41,7 +41,7 @@ struct index_record { std::uint64_t off; std::uint64_t size; - float box[4]; + box2d box; }; template diff --git a/plugins/input/csv/csv_index_featureset.cpp b/plugins/input/csv/csv_index_featureset.cpp index ff90be143..3b1c8a424 100644 --- a/plugins/input/csv/csv_index_featureset.cpp +++ b/plugins/input/csv/csv_index_featureset.cpp @@ -81,7 +81,7 @@ csv_index_featureset::csv_index_featureset(std::string const& filename, positions_.erase(std::remove_if(positions_.begin(), positions_.end(), [&](value_type const& pos) - { return !mapnik::box2d{pos.box[0], pos.box[1], pos.box[2], pos.box[3]}.intersects(filter.box_);}), + { return !pos.box.intersects(filter.box_);}), positions_.end()); std::sort(positions_.begin(), positions_.end(), [](value_type const& lhs, value_type const& rhs) { return lhs.off < rhs.off;}); diff --git a/plugins/input/geojson/geojson_datasource.cpp b/plugins/input/geojson/geojson_datasource.cpp index 71a7b1cf0..ea0af9317 100644 --- a/plugins/input/geojson/geojson_datasource.cpp +++ b/plugins/input/geojson/geojson_datasource.cpp @@ -210,9 +210,9 @@ void geojson_datasource::initialise_disk_index(std::string const& filename) std::ifstream index(filename_ + ".index", std::ios::binary); if (!index) throw mapnik::datasource_exception("GeoJSON Plugin: could not open: '" + filename_ + ".index'"); auto ext_f = mapnik::util::spatial_index, - std::ifstream, - mapnik::box2d>::bounding_box(index); + mapnik::bounding_box_filter, + std::ifstream, + mapnik::box2d>::bounding_box(index); extent_ = { ext_f.minx(), ext_f.miny(),ext_f.maxx(), ext_f.maxy() }; mapnik::bounding_box_filter filter(ext_f); std::vector positions; diff --git a/plugins/input/geojson/geojson_index_featureset.cpp b/plugins/input/geojson/geojson_index_featureset.cpp index e821d35fa..7f915fa18 100644 --- a/plugins/input/geojson/geojson_index_featureset.cpp +++ b/plugins/input/geojson/geojson_index_featureset.cpp @@ -72,7 +72,7 @@ geojson_index_featureset::geojson_index_featureset(std::string const& filename, positions_.erase(std::remove_if(positions_.begin(), positions_.end(), [&](value_type const& pos) - { return !mapnik::box2d{pos.box[0], pos.box[1], pos.box[2], pos.box[3]}.intersects(filter.box_);}), + { return !pos.box.intersects(filter.box_);}), positions_.end()); std::sort(positions_.begin(), positions_.end(), diff --git a/utils/mapnik-index/mapnik-index.cpp b/utils/mapnik-index/mapnik-index.cpp index 2f745b1a3..521c0316d 100644 --- a/utils/mapnik-index/mapnik-index.cpp +++ b/utils/mapnik-index/mapnik-index.cpp @@ -222,7 +222,7 @@ int main (int argc, char** argv) auto ext_f = std::get<0>(item); if (use_bbox && !bbox.intersects(ext_f)) continue; mapnik::util::index_record rec = - {std::get<1>(item).first, std::get<1>(item).second, {ext_f.minx(), ext_f.miny(), ext_f.maxx(), ext_f.maxy()}}; + {std::get<1>(item).first, std::get<1>(item).second, ext_f}; tree.insert(rec, ext_f); }