diff --git a/plugins/input/topojson/topojson_datasource.cpp b/plugins/input/topojson/topojson_datasource.cpp index e7569d917..cd9c327b1 100644 --- a/plugins/input/topojson/topojson_datasource.cpp +++ b/plugins/input/topojson/topojson_datasource.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -218,7 +219,7 @@ void topojson_datasource::parse_topojson(T const& buffer) { extent_.expand_to_include(box); } - values.emplace_back(box_type(point_type(box.minx(),box.miny()),point_type(box.maxx(),box.maxy())), geometry_index); + values.emplace_back(box, geometry_index); ++geometry_index; } } @@ -278,10 +279,9 @@ mapnik::layer_descriptor topojson_datasource::get_descriptor() const mapnik::featureset_ptr topojson_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())); topojson_featureset::array_type index_array; if (tree_) { diff --git a/plugins/input/topojson/topojson_datasource.hpp b/plugins/input/topojson/topojson_datasource.hpp index 6b090e8f8..fff936d3a 100644 --- a/plugins/input/topojson/topojson_datasource.hpp +++ b/plugins/input/topojson/topojson_datasource.hpp @@ -39,8 +39,6 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" -#include -#include #include #include #include @@ -57,9 +55,7 @@ class topojson_datasource : public mapnik::datasource { public: - using point_type = boost::geometry::model::d2::point_xy; - using box_type = boost::geometry::model::box; - + using box_type = mapnik::box2d; using item_type = std::pair; using linear_type = boost::geometry::index::linear<16,4>; using spatial_index_type = boost::geometry::index::rtree;