diff --git a/include/mapnik/json/topojson_grammar.hpp b/include/mapnik/json/topojson_grammar.hpp index 5e426119c..1b5533611 100644 --- a/include/mapnik/json/topojson_grammar.hpp +++ b/include/mapnik/json/topojson_grammar.hpp @@ -92,7 +92,7 @@ private: qi::rule multi_linestring; qi::rule polygon; qi::rule multi_polygon; - qi::rule()> geometry_collection; + qi::rule&)> geometry_collection; qi::rule()> ring; @@ -105,7 +105,6 @@ private: // error boost::phoenix::function where_message_; - }; }} diff --git a/include/mapnik/json/topojson_grammar_impl.hpp b/include/mapnik/json/topojson_grammar_impl.hpp index e19aaa4fe..d52641e57 100644 --- a/include/mapnik/json/topojson_grammar_impl.hpp +++ b/include/mapnik/json/topojson_grammar_impl.hpp @@ -40,13 +40,15 @@ topojson_grammar::topojson_grammar() qi::no_skip_type no_skip; qi::omit_type omit; qi::_val_type _val; + qi::_1_type _1; qi::_2_type _2; qi::_3_type _3; qi::_4_type _4; + qi::_r1_type _r1; standard_wide::char_type char_; using qi::fail; using qi::on_error; - using phoenix::construct; + using phoenix::push_back; // generic json types value = object | array | string_ | number @@ -114,7 +116,7 @@ topojson_grammar::topojson_grammar() >> lit('{') >> -((omit[string_] >> lit(':') - >> (geometry_collection | geometry)) % lit(',')) + >> (geometry_collection(_val) | geometry)) % lit(',')) >> lit('}') ; @@ -130,7 +132,7 @@ topojson_grammar::topojson_grammar() geometry_collection = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"GeometryCollection\"") >> lit(',') - >> lit("\"geometries\"") >> lit(':') >> lit('[') >> -(geometry % lit(',')) + >> lit("\"geometries\"") >> lit(':') >> lit('[') >> -(geometry[push_back(_r1, _1)] % lit(',')) >> lit(']') >> lit('}') ; diff --git a/include/mapnik/json/topojson_utils.hpp b/include/mapnik/json/topojson_utils.hpp index 5a03b42ba..e3d4a0812 100644 --- a/include/mapnik/json/topojson_utils.hpp +++ b/include/mapnik/json/topojson_utils.hpp @@ -27,11 +27,10 @@ #include #include #include -#include namespace mapnik { namespace topojson { -struct bounding_box_visitor : public boost::static_visitor > +struct bounding_box_visitor : public mapnik::util::static_visitor > { bounding_box_visitor(topology const& topo) : topo_(topo) {} diff --git a/include/mapnik/json/topology.hpp b/include/mapnik/json/topology.hpp index cccc4235c..e7605a302 100644 --- a/include/mapnik/json/topology.hpp +++ b/include/mapnik/json/topology.hpp @@ -32,7 +32,6 @@ #include #include #include -#include namespace mapnik { namespace topojson { @@ -86,13 +85,13 @@ struct multi_polygon struct invalid {}; -using geometry = boost::variant; +using geometry = util::variant; using pair_type = std::tuple; diff --git a/plugins/input/topojson/topojson_datasource.cpp b/plugins/input/topojson/topojson_datasource.cpp index d615672d5..5d9c21169 100644 --- a/plugins/input/topojson/topojson_datasource.cpp +++ b/plugins/input/topojson/topojson_datasource.cpp @@ -34,7 +34,7 @@ #include #include #include -#include + // mapnik #include #include @@ -87,7 +87,7 @@ struct attr_value_converter : public mapnik::util::static_visitor +struct geometry_type_visitor : public mapnik::util::static_visitor { int operator() (mapnik::topojson::point const&) const { @@ -211,14 +211,14 @@ void topojson_datasource::parse_topojson(T & stream) std::size_t count = 0; for (auto const& geom : topo_.geometries) { - mapnik::box2d bbox = boost::apply_visitor(mapnik::topojson::bounding_box_visitor(topo_), geom); + mapnik::box2d bbox = mapnik::util::apply_visitor(mapnik::topojson::bounding_box_visitor(topo_), geom); if (bbox.valid()) { if (count == 0) { extent_ = bbox; collect_attributes_visitor assessor(desc_); - boost::apply_visitor(assessor,geom); + mapnik::util::apply_visitor( std::ref(assessor), geom); } else { @@ -245,7 +245,7 @@ boost::optional topojson_datasource::get_geometr for (std::size_t i = 0; i < num_features && i < 5; ++i) { mapnik::topojson::geometry const& geom = topo_.geometries[i]; - int type = boost::apply_visitor(geometry_type_visitor(),geom); + int type = mapnik::util::apply_visitor(geometry_type_visitor(),geom); if (type > 0) { if (multi_type > 0 && multi_type != type) diff --git a/plugins/input/topojson/topojson_featureset.cpp b/plugins/input/topojson/topojson_featureset.cpp index b2794e2c4..7f72885af 100644 --- a/plugins/input/topojson/topojson_featureset.cpp +++ b/plugins/input/topojson/topojson_featureset.cpp @@ -371,7 +371,7 @@ mapnik::feature_ptr topojson_featureset::next() if ( index < topo_.geometries.size()) { mapnik::topojson::geometry const& geom = topo_.geometries[index]; - mapnik::feature_ptr feature = boost::apply_visitor( + mapnik::feature_ptr feature = mapnik::util::apply_visitor( mapnik::topojson::feature_generator(ctx_, tr_, topo_, feature_id_++), geom); return feature;