topojson - remove 'invalid' geometry type to avoid default constructed geometries

This commit is contained in:
artemp 2015-09-10 19:26:57 +02:00
parent 12485b66ef
commit 8128a2b1ef
4 changed files with 2 additions and 17 deletions

View file

@ -73,7 +73,7 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
// topo json // topo json
topology = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"Topology\"") topology = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"Topology\"")
>> ( (lit(',') >> objects) ^ ( lit(',') >> arcs) ^ (lit(',') >> transform) ^ (lit(',') >> bbox)) >> ( (lit(',') >> objects ) ^ ( lit(',') >> arcs) ^ (lit(',') >> transform) ^ (lit(',') >> bbox))
>> lit('}') >> lit('}')
; ;

View file

@ -238,12 +238,6 @@ struct bounding_box_visitor
} }
return bbox; return bbox;
} }
box2d<double> operator() (mapnik::topojson::invalid const&) const
{
return box2d<double>();
}
private: private:
topology const& topo_; topology const& topo_;
std::size_t num_arcs_; std::size_t num_arcs_;

View file

@ -86,10 +86,7 @@ struct multi_polygon
boost::optional<properties> props; boost::optional<properties> props;
}; };
struct invalid {}; using geometry = util::variant<point,
using geometry = util::variant<invalid,
point,
linestring, linestring,
polygon, polygon,
multi_point, multi_point,

View file

@ -109,10 +109,6 @@ struct geometry_type_visitor
{ {
return static_cast<int>(mapnik::datasource_geometry_t::Polygon); return static_cast<int>(mapnik::datasource_geometry_t::Polygon);
} }
int operator() (mapnik::topojson::invalid const&) const
{
return -1;
}
}; };
struct collect_attributes_visitor struct collect_attributes_visitor
@ -121,8 +117,6 @@ struct collect_attributes_visitor
collect_attributes_visitor(mapnik::layer_descriptor & desc): collect_attributes_visitor(mapnik::layer_descriptor & desc):
desc_(desc) {} desc_(desc) {}
void operator() (mapnik::topojson::invalid const&) {}
template <typename GeomType> template <typename GeomType>
void operator() (GeomType const& g) void operator() (GeomType const& g)
{ {