diff --git a/bindings/python/mapnik_feature.cpp b/bindings/python/mapnik_feature.cpp index 6e39b6382..73455524e 100644 --- a/bindings/python/mapnik_feature.cpp +++ b/bindings/python/mapnik_feature.cpp @@ -58,11 +58,6 @@ using mapnik::context_type; using mapnik::context_ptr; using mapnik::feature_kv_iterator; -void set_geometry_impl( mapnik::feature_impl & feature, mapnik::new_geometry::geometry const& geom) -{ - feature.set_geometry_copy(geom); -} - mapnik::feature_ptr from_geojson_impl(std::string const& json, mapnik::context_ptr const& ctx) { mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx,1)); diff --git a/include/mapnik/datasource.hpp b/include/mapnik/datasource.hpp index 04b016cf3..06eccdc4a 100644 --- a/include/mapnik/datasource.hpp +++ b/include/mapnik/datasource.hpp @@ -69,6 +69,7 @@ public: }; enum geometry_t : std::uint8_t { + Unknown = 0, Point = 1, LineString = 2, Polygon = 3, diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index b892abee8..51135c589 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -105,7 +105,7 @@ public: : id_(id), ctx_(ctx), data_(ctx_->mapping_.size()), - geom_(mapnik::util::no_init()), + geom_(new_geometry::geometry_empty()), raster_() {} inline mapnik::value_integer id() const { return id_;} diff --git a/include/mapnik/geometry_centroid.hpp b/include/mapnik/geometry_centroid.hpp index 5a0b1009e..668bb846a 100644 --- a/include/mapnik/geometry_centroid.hpp +++ b/include/mapnik/geometry_centroid.hpp @@ -42,7 +42,10 @@ struct geometry_centroid { return mapnik::util::apply_visitor(*this, geom); } - + result_type operator() (geometry_empty const&) const + { + return false; + } result_type operator() (geometry_collection const& collection) const { return false; diff --git a/include/mapnik/geometry_envelope.hpp b/include/mapnik/geometry_envelope.hpp index 4c65673ec..2b6c50373 100644 --- a/include/mapnik/geometry_envelope.hpp +++ b/include/mapnik/geometry_envelope.hpp @@ -39,6 +39,11 @@ struct geometry_envelope return mapnik::util::apply_visitor(*this, geom); } + bbox_type operator() (mapnik::new_geometry::geometry_empty const&) const + { + return mapnik::box2d(); + } + bbox_type operator() (mapnik::new_geometry::point const& pt) const { return mapnik::box2d(pt.x, pt.y, pt.x, pt.y); diff --git a/include/mapnik/geometry_impl.hpp b/include/mapnik/geometry_impl.hpp index 6298a0206..5d9065b89 100644 --- a/include/mapnik/geometry_impl.hpp +++ b/include/mapnik/geometry_impl.hpp @@ -103,8 +103,9 @@ struct multi_point : line_string {}; struct multi_line_string : std::vector {}; struct multi_polygon : std::vector {}; struct geometry_collection; - -using geometry = mapnik::util::variant