diff options
author | Young Hahn <young@mapbox.com> | 2016-07-06 17:29:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-06 17:29:34 -0400 |
commit | 71a3b1d0db170cfc1786be88c3e7b286c50dece9 (patch) | |
tree | 1d51cc28946dc990f8f613795417cb76ea8c00df /include/mbgl/util/geometry.hpp | |
parent | 903d609b40b6d0f4873f7bb46d96f4a06d7b17d6 (diff) | |
download | qtlocation-mapboxgl-71a3b1d0db170cfc1786be88c3e7b286c50dece9.tar.gz |
[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
Diffstat (limited to 'include/mbgl/util/geometry.hpp')
-rw-r--r-- | include/mbgl/util/geometry.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
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<S> convertPoint(const Point<T>& p) { return Point<S>(p.x, p.y); } +struct ToFeatureType { + template <class T> + FeatureType operator()(const Point<T> &) const { return FeatureType::Point; } + template <class T> + FeatureType operator()(const MultiPoint<T> &) const { return FeatureType::Point; } + template <class T> + FeatureType operator()(const LineString<T> &) const { return FeatureType::LineString; } + template <class T> + FeatureType operator()(const MultiLineString<T> &) const { return FeatureType::LineString; } + template <class T> + FeatureType operator()(const Polygon<T> &) const { return FeatureType::Polygon; } + template <class T> + FeatureType operator()(const MultiPolygon<T> &) const { return FeatureType::Polygon; } + template <class T> + FeatureType operator()(const mapbox::geometry::geometry_collection<T> &) const { return FeatureType::Unknown; } +}; + } // namespace mbgl |