diff --git a/plugins/input/geojson/geojson_datasource.cpp b/plugins/input/geojson/geojson_datasource.cpp index 065226f01..246172865 100644 --- a/plugins/input/geojson/geojson_datasource.cpp +++ b/plugins/input/geojson/geojson_datasource.cpp @@ -27,8 +27,8 @@ #include // boost - #include +#include // mapnik #include @@ -45,8 +45,7 @@ #include #include #include - -#include +#include // boost::geometry - register box2d using mapnik::datasource; using mapnik::parameters; @@ -158,7 +157,7 @@ void geojson_datasource::parse_geojson(T const& buffer) } #if BOOST_VERSION >= 105600 - using values_container = std::vector< std::pair >; + using values_container = std::vector< std::pair>>; values_container values; values.reserve(features_.size()); #else @@ -187,9 +186,9 @@ void geojson_datasource::parse_geojson(T const& buffer) } } #if BOOST_VERSION >= 105600 - values.emplace_back(box_type(point_type(box.minx(),box.miny()),point_type(box.maxx(),box.maxy())), geometry_index); + values.emplace_back(box, std::make_pair(geometry_index,0)); #else - tree_->insert(box_type(point_type(box.minx(),box.miny()),point_type(box.maxx(),box.maxy())),geometry_index); + tree_->insert(box, std::make_pair(geometry_index)); #endif ++geometry_index; } @@ -248,10 +247,9 @@ mapnik::layer_descriptor geojson_datasource::get_descriptor() const mapnik::featureset_ptr geojson_datasource::features(mapnik::query const& q) const { // if the query box intersects our world extent then query for features - mapnik::box2d const& b = q.get_bbox(); - if (extent_.intersects(b)) + mapnik::box2d const& box = q.get_bbox(); + if (extent_.intersects(box)) { - box_type box(point_type(b.minx(),b.miny()),point_type(b.maxx(),b.maxy())); #if BOOST_VERSION >= 105600 geojson_featureset::array_type index_array; if (tree_) diff --git a/plugins/input/geojson/geojson_datasource.hpp b/plugins/input/geojson/geojson_datasource.hpp index c7a492a1a..859415091 100644 --- a/plugins/input/geojson/geojson_datasource.hpp +++ b/plugins/input/geojson/geojson_datasource.hpp @@ -88,14 +88,12 @@ struct options_type > class geojson_datasource : public mapnik::datasource { public: - using point_type = boost::geometry::model::point; - using box_type = boost::geometry::model::box; - + using box_type = mapnik::box2d; #if BOOST_VERSION >= 105600 - using item_type = std::pair; + using item_type = std::pair >; using spatial_index_type = boost::geometry::index::rtree >; #else - using item_type = std::size_t; + using item_type = std::pair; using spatial_index_type = boost::geometry::index::rtree; #endif diff --git a/plugins/input/geojson/geojson_featureset.cpp b/plugins/input/geojson/geojson_featureset.cpp index 3254cb2e8..3883c1c52 100644 --- a/plugins/input/geojson/geojson_featureset.cpp +++ b/plugins/input/geojson/geojson_featureset.cpp @@ -44,9 +44,9 @@ mapnik::feature_ptr geojson_featureset::next() { #if BOOST_VERSION >= 105600 geojson_datasource::item_type const& item = *index_itr_++; - std::size_t index = item.second; + std::size_t index = item.second.first; #else - std::size_t index = *index_itr_++; + std::size_t index = (*index_itr_++).second; #endif if ( index < features_.size()) {