File indexing completed on 2025-09-17 08:32:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_GEOMETRY_STRATEGIES_CENTROID_GEOGRAPHIC_HPP
0013 #define BOOST_GEOMETRY_STRATEGIES_CENTROID_GEOGRAPHIC_HPP
0014
0015
0016 #include <boost/geometry/strategies/detail.hpp>
0017 #include <boost/geometry/strategies/centroid.hpp>
0018 #include <boost/geometry/strategies/centroid/services.hpp>
0019
0020
0021 namespace boost { namespace geometry
0022 {
0023
0024 namespace strategies { namespace centroid
0025 {
0026
0027 #ifndef DOXYGEN_NO_DETAIL
0028 namespace detail
0029 {
0030
0031 class geographic
0032 {
0033 public:
0034
0035 template <typename Geometry, typename Point>
0036 static auto centroid(Geometry const&, Point const&,
0037 std::enable_if_t
0038 <
0039 util::is_segment<Geometry>::value
0040 || util::is_box<Geometry>::value
0041 > * = nullptr)
0042 {
0043 return strategy::centroid::not_applicable_strategy();
0044 }
0045 };
0046
0047
0048 }
0049 #endif
0050
0051
0052 template
0053 <
0054 typename FormulaPolicy = strategy::andoyer,
0055 typename Spheroid = srs::spheroid<double>,
0056 typename CalculationType = void
0057 >
0058 class geographic
0059 : public strategies::detail::geographic_base<Spheroid>
0060 , public strategies::centroid::detail::geographic
0061 {
0062 using base_t = strategies::detail::geographic_base<Spheroid>;
0063
0064 public:
0065 geographic() = default;
0066
0067 explicit geographic(Spheroid const& spheroid)
0068 : base_t(spheroid)
0069 {}
0070 };
0071
0072
0073 namespace services
0074 {
0075
0076 template <typename Geometry>
0077 struct default_strategy<Geometry, geographic_tag>
0078 {
0079 using type = strategies::centroid::geographic<>;
0080 };
0081
0082 }
0083
0084 }}
0085
0086 }}
0087
0088 #endif