parameters.hpp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. // Boost.Geometry
  2. // Copyright (c) 2017-2019, Oracle and/or its affiliates.
  3. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  4. // Use, modification and distribution is subject to the Boost Software License,
  5. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP
  8. #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP
  9. #include <boost/geometry/formulas/andoyer_inverse.hpp>
  10. #include <boost/geometry/formulas/thomas_direct.hpp>
  11. #include <boost/geometry/formulas/thomas_inverse.hpp>
  12. #include <boost/geometry/formulas/vincenty_direct.hpp>
  13. #include <boost/geometry/formulas/vincenty_inverse.hpp>
  14. //#include <boost/geometry/formulas/karney_direct.hpp>
  15. //#include <boost/geometry/formulas/karney_inverse.hpp>
  16. #include <boost/mpl/assert.hpp>
  17. #include <boost/mpl/integral_c.hpp>
  18. namespace boost { namespace geometry { namespace strategy
  19. {
  20. struct andoyer
  21. {
  22. template
  23. <
  24. typename CT,
  25. bool EnableCoordinates = true,
  26. bool EnableReverseAzimuth = false,
  27. bool EnableReducedLength = false,
  28. bool EnableGeodesicScale = false
  29. >
  30. struct direct
  31. : formula::thomas_direct
  32. <
  33. CT, false,
  34. EnableCoordinates, EnableReverseAzimuth,
  35. EnableReducedLength, EnableGeodesicScale
  36. >
  37. {};
  38. template
  39. <
  40. typename CT,
  41. bool EnableDistance,
  42. bool EnableAzimuth,
  43. bool EnableReverseAzimuth = false,
  44. bool EnableReducedLength = false,
  45. bool EnableGeodesicScale = false
  46. >
  47. struct inverse
  48. : formula::andoyer_inverse
  49. <
  50. CT, EnableDistance,
  51. EnableAzimuth, EnableReverseAzimuth,
  52. EnableReducedLength, EnableGeodesicScale
  53. >
  54. {};
  55. };
  56. struct thomas
  57. {
  58. template
  59. <
  60. typename CT,
  61. bool EnableCoordinates = true,
  62. bool EnableReverseAzimuth = false,
  63. bool EnableReducedLength = false,
  64. bool EnableGeodesicScale = false
  65. >
  66. struct direct
  67. : formula::thomas_direct
  68. <
  69. CT, true,
  70. EnableCoordinates, EnableReverseAzimuth,
  71. EnableReducedLength, EnableGeodesicScale
  72. >
  73. {};
  74. template
  75. <
  76. typename CT,
  77. bool EnableDistance,
  78. bool EnableAzimuth,
  79. bool EnableReverseAzimuth = false,
  80. bool EnableReducedLength = false,
  81. bool EnableGeodesicScale = false
  82. >
  83. struct inverse
  84. : formula::thomas_inverse
  85. <
  86. CT, EnableDistance,
  87. EnableAzimuth, EnableReverseAzimuth,
  88. EnableReducedLength, EnableGeodesicScale
  89. >
  90. {};
  91. };
  92. struct vincenty
  93. {
  94. template
  95. <
  96. typename CT,
  97. bool EnableCoordinates = true,
  98. bool EnableReverseAzimuth = false,
  99. bool EnableReducedLength = false,
  100. bool EnableGeodesicScale = false
  101. >
  102. struct direct
  103. : formula::vincenty_direct
  104. <
  105. CT, EnableCoordinates, EnableReverseAzimuth,
  106. EnableReducedLength, EnableGeodesicScale
  107. >
  108. {};
  109. template
  110. <
  111. typename CT,
  112. bool EnableDistance,
  113. bool EnableAzimuth,
  114. bool EnableReverseAzimuth = false,
  115. bool EnableReducedLength = false,
  116. bool EnableGeodesicScale = false
  117. >
  118. struct inverse
  119. : formula::vincenty_inverse
  120. <
  121. CT, EnableDistance,
  122. EnableAzimuth, EnableReverseAzimuth,
  123. EnableReducedLength, EnableGeodesicScale
  124. >
  125. {};
  126. };
  127. /*
  128. struct karney
  129. {
  130. template
  131. <
  132. typename CT,
  133. bool EnableCoordinates = true,
  134. bool EnableReverseAzimuth = false,
  135. bool EnableReducedLength = false,
  136. bool EnableGeodesicScale = false,
  137. size_t SeriesOrder = 8
  138. >
  139. struct direct
  140. : formula::karney_direct
  141. <
  142. CT, EnableCoordinates, EnableReverseAzimuth,
  143. EnableReducedLength, EnableGeodesicScale,
  144. SeriesOrder
  145. >
  146. {};
  147. template
  148. <
  149. typename CT,
  150. bool EnableDistance,
  151. bool EnableAzimuth,
  152. bool EnableReverseAzimuth = false,
  153. bool EnableReducedLength = false,
  154. bool EnableGeodesicScale = false,
  155. size_t SeriesOrder = 8
  156. >
  157. struct inverse
  158. : formula::karney_inverse
  159. <
  160. CT, EnableDistance,
  161. EnableAzimuth, EnableReverseAzimuth,
  162. EnableReducedLength, EnableGeodesicScale,
  163. SeriesOrder
  164. >
  165. {};
  166. };
  167. */
  168. template <typename FormulaPolicy>
  169. struct default_order
  170. {
  171. BOOST_MPL_ASSERT_MSG
  172. (
  173. false, NOT_IMPLEMENTED_FOR_THIS_TYPE
  174. , (types<FormulaPolicy>)
  175. );
  176. };
  177. template<>
  178. struct default_order<andoyer>
  179. : boost::mpl::integral_c<unsigned int, 1>
  180. {};
  181. template<>
  182. struct default_order<thomas>
  183. : boost::mpl::integral_c<unsigned int, 2>
  184. {};
  185. template<>
  186. struct default_order<vincenty>
  187. : boost::mpl::integral_c<unsigned int, 4>
  188. {};
  189. /*
  190. template<>
  191. struct default_order<karney>
  192. : boost::mpl::integral_c<unsigned int, 8>
  193. {};
  194. */
  195. }}} // namespace boost::geometry::strategy
  196. #endif // BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_PARAMETERS_HPP