summaryrefslogtreecommitdiff
path: root/src/mbgl/util/geometry.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/util/geometry.hpp')
-rw-r--r--src/mbgl/util/geometry.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mbgl/util/geometry.hpp b/src/mbgl/util/geometry.hpp
new file mode 100644
index 0000000000..bf44d5ce93
--- /dev/null
+++ b/src/mbgl/util/geometry.hpp
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <mapbox/geometry/geometry.hpp>
+#include <mapbox/geometry/point_arithmetic.hpp>
+
+namespace mbgl {
+
+template <class T>
+using Point = mapbox::geometry::point<T>;
+
+template <class T>
+using LineString = mapbox::geometry::line_string<T>;
+
+template <class T>
+using Polygon = mapbox::geometry::polygon<T>;
+
+template <class T>
+using MultiPoint = mapbox::geometry::multi_point<T>;
+
+template <class T>
+using MultiLineString = mapbox::geometry::multi_line_string<T>;
+
+template <class T>
+using MultiPolygon = mapbox::geometry::multi_polygon<T>;
+
+template <class S, class T>
+Point<S> convertPoint(const Point<T>& p) {
+ return Point<S>(p.x, p.y);
+}
+
+} // namespace mbgl