From 58f21f33ea07c4f55e204c92e2f7e6d44f3bf7eb Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 4 Mar 2015 14:54:11 +0100 Subject: [PATCH] remove slicing --- plugins/input/topojson/topojson_featureset.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/input/topojson/topojson_featureset.cpp b/plugins/input/topojson/topojson_featureset.cpp index bea58f7ae..816907f44 100644 --- a/plugins/input/topojson/topojson_featureset.cpp +++ b/plugins/input/topojson/topojson_featureset.cpp @@ -25,6 +25,7 @@ #include #include #include +#include // stl #include #include @@ -36,7 +37,6 @@ #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" #include -#include #include #pragma GCC diagnostic pop @@ -215,14 +215,14 @@ struct feature_generator if (reverse) { - for (auto const& c : processed_coords | reversed | sliced(0, processed_coords.size()-1)) + for (auto const& c : processed_coords | reversed) { linear_ring.emplace_back(c.x, c.y); } } else { - for (auto const& c : processed_coords | sliced(0, processed_coords.size()-1)) + for (auto const& c : processed_coords) { linear_ring.emplace_back(c.x, c.y); } @@ -238,7 +238,7 @@ struct feature_generator polygon.add_hole(std::move(linear_ring)); } } - + boost::geometry::correct(polygon); feature->set_geometry(std::move(polygon)); assign_properties(*feature, poly, tr_); return feature; @@ -253,7 +253,6 @@ struct feature_generator for (auto const& poly : multi_poly.polygons) { - //std::unique_ptr poly_ptr(new geometry_type(geometry_type::types::Polygon)); bool first = true; mapnik::new_geometry::polygon polygon; if (poly.size() > 1) polygon.interior_rings.reserve(poly.size() - 1); @@ -286,14 +285,14 @@ struct feature_generator if (reverse) { - for (auto const& c : (processed_coords | reversed | sliced(0,processed_coords.size() - 1))) + for (auto const& c : (processed_coords | reversed)) { linear_ring.add_coord(c.x, c.y); } } else { - for (auto const& c : processed_coords | sliced(0,processed_coords.size() - 1)) + for (auto const& c : processed_coords) { linear_ring.add_coord(c.x, c.y); }