File indexing completed on 2025-01-18 09:36:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_STRATEGY_GEOGRAPHIC_ENVELOPE_RANGE_HPP
0011 #define BOOST_GEOMETRY_STRATEGY_GEOGRAPHIC_ENVELOPE_RANGE_HPP
0012
0013 #include <boost/geometry/strategy/geographic/envelope_segment.hpp>
0014 #include <boost/geometry/strategy/geographic/expand_segment.hpp>
0015 #include <boost/geometry/strategy/spherical/envelope_range.hpp>
0016
0017
0018 #include <boost/geometry/strategies/spherical/point_in_poly_winding.hpp>
0019
0020 namespace boost { namespace geometry
0021 {
0022
0023 namespace strategy { namespace envelope
0024 {
0025
0026 template
0027 <
0028 typename FormulaPolicy = strategy::andoyer,
0029 typename Spheroid = geometry::srs::spheroid<double>,
0030 typename CalculationType = void
0031 >
0032 class geographic_linestring
0033 {
0034 public:
0035 using model_type = Spheroid;
0036
0037 geographic_linestring()
0038 : m_spheroid()
0039 {}
0040
0041 explicit geographic_linestring(Spheroid const& spheroid)
0042 : m_spheroid(spheroid)
0043 {}
0044
0045 template <typename Range, typename Box>
0046 void apply(Range const& range, Box& mbr) const
0047 {
0048 auto const envelope_s = envelope::geographic_segment
0049 <
0050 FormulaPolicy, Spheroid, CalculationType
0051 >(m_spheroid);
0052 auto const expand_s = expand::geographic_segment
0053 <
0054 FormulaPolicy, Spheroid, CalculationType
0055 >(m_spheroid);
0056 detail::spheroidal_linestring(range, mbr, envelope_s, expand_s);
0057 }
0058
0059 Spheroid model() const
0060 {
0061 return m_spheroid;
0062 }
0063
0064 private:
0065 Spheroid m_spheroid;
0066 };
0067
0068 template
0069 <
0070 typename FormulaPolicy = strategy::andoyer,
0071 typename Spheroid = geometry::srs::spheroid<double>,
0072 typename CalculationType = void
0073 >
0074 class geographic_ring
0075 {
0076 public:
0077 using model_type = Spheroid;
0078
0079 geographic_ring()
0080 : m_spheroid()
0081 {}
0082
0083 explicit geographic_ring(Spheroid const& spheroid)
0084 : m_spheroid(spheroid)
0085 {}
0086
0087 template <typename Range, typename Box>
0088 void apply(Range const& range, Box& mbr) const
0089 {
0090 auto const envelope_s = envelope::geographic_segment
0091 <
0092 FormulaPolicy, Spheroid, CalculationType
0093 >(m_spheroid);
0094 auto const expand_s = expand::geographic_segment
0095 <
0096 FormulaPolicy, Spheroid, CalculationType
0097 >(m_spheroid);
0098 auto const within_s = within::detail::spherical_winding_base
0099 <
0100 envelope::detail::side_of_pole<CalculationType>, CalculationType
0101 >();
0102 detail::spheroidal_ring(range, mbr, envelope_s, expand_s, within_s);
0103 }
0104
0105 Spheroid model() const
0106 {
0107 return m_spheroid;
0108 }
0109
0110 private:
0111 Spheroid m_spheroid;
0112 };
0113
0114 }}
0115
0116 }}
0117
0118 #endif