mirror of
https://github.com/boostorg/geometry.git
synced 2026-01-31 20:22:09 +00:00
[algorithms] [strategies] Rename meridian method to vertical_or_meridian
This commit is contained in:
@@ -41,7 +41,6 @@
|
||||
#include <boost/geometry/algorithms/equals.hpp>
|
||||
#include <boost/geometry/algorithms/intersects.hpp>
|
||||
#include <boost/geometry/algorithms/not_implemented.hpp>
|
||||
#include <boost/geometry/algorithms/make.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/assign_box_corners.hpp>
|
||||
#include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
|
||||
@@ -362,7 +361,7 @@ private:
|
||||
//if p0 is in box's band
|
||||
if (less_equal(geometry::get<1>(p0), geometry::get<1>(top_right)))
|
||||
{
|
||||
//meridian segment & crosses band (TODO:merge with box-box dist)
|
||||
// segment & crosses band (TODO:merge with box-box dist)
|
||||
if (math::equals(geometry::get<0>(p0), geometry::get<0>(p1)))
|
||||
{
|
||||
SegmentPoint high = geometry::get<1>(p1) > geometry::get<1>(p0) ? p1 : p0;
|
||||
@@ -399,6 +398,7 @@ private:
|
||||
BoxPoint const& top_left,
|
||||
PSStrategy const& ps_strategy)
|
||||
{
|
||||
boost::ignore_unused(ps_strategy);
|
||||
return apply(p0, p1, p0, top_left, ps_strategy);
|
||||
}
|
||||
|
||||
@@ -413,11 +413,11 @@ private:
|
||||
LessEqual less_equal;
|
||||
|
||||
// p0 is above the upper segment of the box (and inside its band)
|
||||
// then compute the vertical (meridian) distance
|
||||
// then compute the vertical (i.e. meridian for spherical) distance
|
||||
if (less_equal(geometry::get<0>(top_left), geometry::get<0>(p_max)))
|
||||
{
|
||||
ReturnType diff =
|
||||
ps_strategy.get_distance_strategy().meridian(
|
||||
ps_strategy.get_distance_strategy().vertical_or_meridian(
|
||||
geometry::get_as_radian<1>(p_max),
|
||||
geometry::get_as_radian<1>(top_left));
|
||||
|
||||
@@ -715,6 +715,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
//=========================================================================
|
||||
|
||||
template
|
||||
<
|
||||
typename Segment,
|
||||
|
||||
@@ -166,15 +166,8 @@ private:
|
||||
|
||||
CalculationType lat1_rad = math::as_radian<Units>(lat1);
|
||||
CalculationType lat2_rad = math::as_radian<Units>(lat2);
|
||||
//CalculationType lon1_rad = math::as_radian<Units>(lon1);
|
||||
//CalculationType lon2_rad = math::as_radian<Units>(lon2);
|
||||
|
||||
//typedef typename geometry::formula::meridian_segment mseg;
|
||||
//mseg::SegmentType result_seg =
|
||||
//mseg::is_meridian(lon1_rad, lat1_rad, lon2_rad, lat2_rad);
|
||||
if (math::equals(a1, a2))// ||
|
||||
//result_seg == mseg::MeridianCrossingPole ||
|
||||
//result_seg == mseg::MeridianNotCrossingPole)
|
||||
if (math::equals(a1, a2))
|
||||
{
|
||||
// the segment must lie on the equator or is very short or is meridian
|
||||
return;
|
||||
|
||||
@@ -119,7 +119,7 @@ public :
|
||||
}
|
||||
|
||||
template <typename CT>
|
||||
inline CT meridian(CT const& lat1, CT const& lat2) const
|
||||
inline CT vertical_or_meridian(CT const& lat1, CT const& lat2) const
|
||||
{
|
||||
return lat1 - lat2;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ public :
|
||||
}
|
||||
|
||||
template <typename CT>
|
||||
inline CT meridian(CT const& lat1, CT const& lat2) const
|
||||
inline CT vertical_or_meridian(CT const& lat1, CT const& lat2) const
|
||||
{
|
||||
return lat1 - lat2;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public :
|
||||
|
||||
// points on a meridian not crossing poles
|
||||
template <typename CT>
|
||||
inline CT meridian(CT lat1, CT lat2) const
|
||||
inline CT vertical_or_meridian(CT lat1, CT lat2) const
|
||||
{
|
||||
typedef typename formula::elliptic_arc_length
|
||||
<
|
||||
|
||||
@@ -162,15 +162,15 @@ public :
|
||||
<
|
||||
Strategy, box_point_type1, box_point_type2
|
||||
>::apply(ps_strategy, ps_strategy.get_distance_strategy()
|
||||
.meridian(lat_min1, lat_max2));
|
||||
.vertical_or_meridian(lat_min1, lat_max2));
|
||||
}
|
||||
else if (lat_max1 < lat_min2)
|
||||
{
|
||||
return geometry::strategy::distance::services::result_from_distance
|
||||
<
|
||||
Strategy, box_point_type1, box_point_type2
|
||||
>::apply(ps_strategy, ps_strategy.get_distance_strategy().
|
||||
meridian(lat_min2, lat_max1));
|
||||
>::apply(ps_strategy, ps_strategy.get_distance_strategy()
|
||||
.vertical_or_meridian(lat_min2, lat_max1));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -100,14 +100,16 @@ public :
|
||||
return geometry::strategy::distance::services::result_from_distance
|
||||
<
|
||||
Strategy, Point, box_point_type
|
||||
>::apply(ps_strategy, ps_strategy.get_distance_strategy().meridian(plat, lat_max));
|
||||
>::apply(ps_strategy, ps_strategy.get_distance_strategy()
|
||||
.vertical_or_meridian(plat, lat_max));
|
||||
}
|
||||
else if (plat < lat_min)
|
||||
{
|
||||
return geometry::strategy::distance::services::result_from_distance
|
||||
<
|
||||
Strategy, Point, box_point_type
|
||||
>::apply(ps_strategy, ps_strategy.get_distance_strategy().meridian(lat_min, plat));
|
||||
>::apply(ps_strategy, ps_strategy.get_distance_strategy()
|
||||
.vertical_or_meridian(lat_min, plat));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -107,7 +107,7 @@ public :
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
inline radius_type meridian(T1 lat1, T2 lat2) const
|
||||
inline radius_type vertical_or_meridian(T1 lat1, T2 lat2) const
|
||||
{
|
||||
return m_radius * (lat1 - lat2);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ public :
|
||||
*/
|
||||
|
||||
template <typename T1, typename T2>
|
||||
inline radius_type meridian(T1 lat1, T2 lat2) const
|
||||
inline radius_type vertical_or_meridian(T1 lat1, T2 lat2) const
|
||||
{
|
||||
return m_radius * (lat1 - lat2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user