summaryrefslogtreecommitdiff
path: root/boost/geometry/core/cs.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/core/cs.hpp')
-rw-r--r--boost/geometry/core/cs.hpp63
1 files changed, 55 insertions, 8 deletions
diff --git a/boost/geometry/core/cs.hpp b/boost/geometry/core/cs.hpp
index cf6c56b53c..301fb6b76f 100644
--- a/boost/geometry/core/cs.hpp
+++ b/boost/geometry/core/cs.hpp
@@ -1,8 +1,13 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
-// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
-// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
+
+// This file was modified by Oracle on 2014.
+// Modifications copyright (c) 2014, Oracle and/or its affiliates.
+
+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@@ -16,7 +21,8 @@
#include <cstddef>
-#include <boost/type_traits.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/integral_constant.hpp>
#include <boost/geometry/core/coordinate_system.hpp>
#include <boost/geometry/core/tags.hpp>
@@ -45,6 +51,35 @@ struct degree {};
struct radian {};
+#ifndef DOXYGEN_NO_DETAIL
+namespace core_detail
+{
+
+template <typename DegreeOrRadian>
+struct coordinate_system_units
+{
+ BOOST_MPL_ASSERT_MSG
+ ((false),
+ COORDINATE_SYSTEM_UNITS_MUST_BE_DEGREES_OR_RADIANS,
+ (types<DegreeOrRadian>));
+};
+
+template <>
+struct coordinate_system_units<geometry::degree>
+{
+ typedef geometry::degree units;
+};
+
+template <>
+struct coordinate_system_units<geometry::radian>
+{
+ typedef geometry::radian units;
+};
+
+} // namespace core_detail
+#endif // DOXYGEN_NO_DETAIL
+
+
namespace cs
{
@@ -73,7 +108,10 @@ known as lat,long or lo,la or phi,lambda
template<typename DegreeOrRadian>
struct geographic
{
- typedef DegreeOrRadian units;
+ typedef typename core_detail::coordinate_system_units
+ <
+ DegreeOrRadian
+ >::units units;
};
@@ -99,7 +137,10 @@ struct geographic
template<typename DegreeOrRadian>
struct spherical
{
- typedef DegreeOrRadian units;
+ typedef typename core_detail::coordinate_system_units
+ <
+ DegreeOrRadian
+ >::units units;
};
@@ -116,7 +157,10 @@ struct spherical
template<typename DegreeOrRadian>
struct spherical_equatorial
{
- typedef DegreeOrRadian units;
+ typedef typename core_detail::coordinate_system_units
+ <
+ DegreeOrRadian
+ >::units units;
};
@@ -131,7 +175,10 @@ struct spherical_equatorial
template<typename DegreeOrRadian>
struct polar
{
- typedef DegreeOrRadian units;
+ typedef typename core_detail::coordinate_system_units
+ <
+ DegreeOrRadian
+ >::units units;
};