From 71a3b1d0db170cfc1786be88c3e7b286c50dece9 Mon Sep 17 00:00:00 2001 From: Young Hahn Date: Wed, 6 Jul 2016 17:29:34 -0400 Subject: [core] geometry@0.8.0 / geojsonvt@6.0.0 (#5514) * [core] geometry.hpp 0.8.0 * geojsonvt @ 6.0.0 * Update platform deps, build scripts * Perf optimizations/cleanup * Rebase in geometry@080 * D.R.Y. etc * Ensure fill annotation geometries have closed rings. * Optimizations * Update to geojsonvt @ 6.1.0 for clean handoff between geojson parsing and geojsonvt * Apply close multi/poly geoms for line annotations as well --- include/mbgl/style/filter_evaluator.hpp | 11 +++++++++++ include/mbgl/util/feature.hpp | 6 +++--- include/mbgl/util/geometry.hpp | 17 +++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/mbgl/style/filter_evaluator.hpp b/include/mbgl/style/filter_evaluator.hpp index e7b6e0f5a0..cf91fdab1f 100644 --- a/include/mbgl/style/filter_evaluator.hpp +++ b/include/mbgl/style/filter_evaluator.hpp @@ -151,13 +151,24 @@ private: return false; } + bool operator()(const NullValue&, + const NullValue&) const { + // Should be unreachable; null is not currently allowed by the style specification. + assert(false); + return false; + } + bool operator()(const std::vector&, const std::vector&) const { + // Should be unreachable; nested values are not currently allowed by the style specification. + assert(false); return false; } bool operator()(const std::unordered_map&, const std::unordered_map&) const { + // Should be unreachable; nested values are not currently allowed by the style specification. + assert(false); return false; } }; diff --git a/include/mbgl/util/feature.hpp b/include/mbgl/util/feature.hpp index 7747d34ee9..7c5c8d7625 100644 --- a/include/mbgl/util/feature.hpp +++ b/include/mbgl/util/feature.hpp @@ -7,13 +7,13 @@ namespace mbgl { using Value = mapbox::geometry::value; - +using NullValue = mapbox::geometry::null_value_t; +using PropertyMap = mapbox::geometry::property_map; +using FeatureIdentifier = mapbox::geometry::identifier; class Feature : public mapbox::geometry::feature { public: Feature(geometry_type&& geometry_) : mapbox::geometry::feature { std::move(geometry_) } {} - - optional id; }; } // namespace mbgl diff --git a/include/mbgl/util/geometry.hpp b/include/mbgl/util/geometry.hpp index 7fc2668c2c..6dc16bc514 100644 --- a/include/mbgl/util/geometry.hpp +++ b/include/mbgl/util/geometry.hpp @@ -41,4 +41,21 @@ Point convertPoint(const Point& p) { return Point(p.x, p.y); } +struct ToFeatureType { + template + FeatureType operator()(const Point &) const { return FeatureType::Point; } + template + FeatureType operator()(const MultiPoint &) const { return FeatureType::Point; } + template + FeatureType operator()(const LineString &) const { return FeatureType::LineString; } + template + FeatureType operator()(const MultiLineString &) const { return FeatureType::LineString; } + template + FeatureType operator()(const Polygon &) const { return FeatureType::Polygon; } + template + FeatureType operator()(const MultiPolygon &) const { return FeatureType::Polygon; } + template + FeatureType operator()(const mapbox::geometry::geometry_collection &) const { return FeatureType::Unknown; } +}; + } // namespace mbgl -- cgit v1.2.1