Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72409 - in branches/release: boost/geometry boost/geometry/algorithms boost/geometry/arithmetic boost/geometry/core boost/geometry/domains boost/geometry/geometries boost/geometry/iterators boost/geometry/multi boost/geometry/policies boost/geometry/strategies boost/geometry/strategies/agnostic boost/geometry/strategies/cartesian boost/geometry/strategies/spherical boost/geometry/util boost/geometry/views libs/geometry/doc libs/geometry/doc/concept libs/geometry/doc/doxy libs/geometry/doc/generated libs/geometry/doc/html libs/geometry/doc/reference libs/geometry/doc/src libs/geometry/doc/src/examples libs/geometry/doc/src/examples/algorithms libs/geometry/doc/src/examples/core libs/geometry/example libs/geometry/test libs/geometry/test/algorithms libs/geometry/test/algorithms/overlay libs/geometry/test/strategies
From: barend.gehrels_at_[hidden]
Date: 2011-06-05 10:43:11


Author: barendgehrels
Date: 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
New Revision: 72409
URL: http://svn.boost.org/trac/boost/changeset/72409

Log:
Boost.Geometry: Merged r72086 through r72406

Added:
   branches/release/boost/geometry/strategies/spherical/ssf.hpp
      - copied unchanged from r72406, /trunk/boost/geometry/strategies/spherical/ssf.hpp
   branches/release/libs/geometry/test/strategies/spherical_side.cpp
      - copied unchanged from r72406, /trunk/libs/geometry/test/strategies/spherical_side.cpp
   branches/release/libs/geometry/test/strategies/spherical_side.vcproj
      - copied unchanged from r72406, /trunk/libs/geometry/test/strategies/spherical_side.vcproj
Removed:
   branches/release/libs/geometry/test/strategies/side_by_cross_track.cpp
   branches/release/libs/geometry/test/strategies/side_by_cross_track.vcproj
Properties modified:
   branches/release/boost/geometry/algorithms/ (props changed)
   branches/release/boost/geometry/arithmetic/ (props changed)
   branches/release/boost/geometry/core/ (props changed)
   branches/release/boost/geometry/domains/ (props changed)
   branches/release/boost/geometry/geometries/ (props changed)
   branches/release/boost/geometry/geometry.hpp (props changed)
   branches/release/boost/geometry/iterators/ (props changed)
   branches/release/boost/geometry/multi/ (props changed)
   branches/release/boost/geometry/policies/ (props changed)
   branches/release/boost/geometry/strategies/ (props changed)
   branches/release/boost/geometry/util/ (props changed)
   branches/release/boost/geometry/views/ (props changed)
   branches/release/libs/geometry/doc/ (props changed)
   branches/release/libs/geometry/doc/Jamfile.v2 (props changed)
   branches/release/libs/geometry/doc/about_documentation.qbk (props changed)
   branches/release/libs/geometry/doc/acknowledgments.qbk (props changed)
   branches/release/libs/geometry/doc/compiling.qbk (props changed)
   branches/release/libs/geometry/doc/concept/ (props changed)
   branches/release/libs/geometry/doc/copyright_note_policy.txt (props changed)
   branches/release/libs/geometry/doc/design_rationale.qbk (props changed)
   branches/release/libs/geometry/doc/doxy/ (props changed)
   branches/release/libs/geometry/doc/generated/ (props changed)
   branches/release/libs/geometry/doc/geometry.qbk (props changed)
   branches/release/libs/geometry/doc/html/ (props changed)
   branches/release/libs/geometry/doc/imports.qbk (props changed)
   branches/release/libs/geometry/doc/introduction.qbk (props changed)
   branches/release/libs/geometry/doc/make_qbk.py (props changed)
   branches/release/libs/geometry/doc/matrix.qbk (props changed)
   branches/release/libs/geometry/doc/quickref.xml (props changed)
   branches/release/libs/geometry/doc/quickstart.qbk (props changed)
   branches/release/libs/geometry/doc/readme.txt (props changed)
   branches/release/libs/geometry/doc/reference/ (props changed)
   branches/release/libs/geometry/doc/reference.qbk (props changed)
   branches/release/libs/geometry/doc/src/ (props changed)
   branches/release/libs/geometry/example/ (props changed)
   branches/release/libs/geometry/test/ (props changed)
Text files modified:
   branches/release/boost/geometry/core/cs.hpp | 30 ++++++++++
   branches/release/boost/geometry/core/tags.hpp | 8 ++
   branches/release/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp | 4
   branches/release/boost/geometry/strategies/agnostic/point_in_poly_oriented_winding.hpp | 2
   branches/release/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp | 10 +++
   branches/release/boost/geometry/strategies/cartesian/distance_projected_point.hpp | 25 ++++-----
   branches/release/boost/geometry/strategies/cartesian/side_by_triangle.hpp | 19 +++++--
   branches/release/boost/geometry/strategies/intersection.hpp | 2
   branches/release/boost/geometry/strategies/side.hpp | 19 ++++++
   branches/release/boost/geometry/strategies/spherical/area_huiller.hpp | 68 +++++++++++++++++---------
   branches/release/boost/geometry/strategies/spherical/compare_circular.hpp | 4
   branches/release/boost/geometry/strategies/spherical/distance_cross_track.hpp | 61 +++++++++++++++++++++-
   branches/release/boost/geometry/strategies/spherical/distance_haversine.hpp | 7 +
   branches/release/boost/geometry/strategies/spherical/side_by_cross_track.hpp | 17 -----
   branches/release/boost/geometry/strategies/strategies.hpp | 1
   branches/release/boost/geometry/strategies/strategy_transform.hpp | 97 ++++++++++++++++++++++++++++++-------
   branches/release/libs/geometry/doc/src/examples/algorithms/area.cpp | 4
   branches/release/libs/geometry/doc/src/examples/algorithms/area_with_strategy.cpp | 4
   branches/release/libs/geometry/doc/src/examples/algorithms/length_with_strategy.cpp | 2
   branches/release/libs/geometry/doc/src/examples/algorithms/transform.cpp | 9 +-
   branches/release/libs/geometry/doc/src/examples/core/degree_radian.cpp | 4
   branches/release/libs/geometry/doc/src/examples/quick_start.cpp | 2
   branches/release/libs/geometry/example/06_a_transformation_example.cpp | 2
   branches/release/libs/geometry/example/07_a_graph_route_example.cpp | 2
   branches/release/libs/geometry/example/07_b_graph_route_example.cpp | 4
   branches/release/libs/geometry/test/algorithms/area.cpp | 102 +++++++++++++++++++++++++++++++++++++--
   branches/release/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp | 2
   branches/release/libs/geometry/test/algorithms/overlay/traverse.cpp | 2
   branches/release/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp | 2
   branches/release/libs/geometry/test/algorithms/simplify.cpp | 4
   branches/release/libs/geometry/test/algorithms/test_area.hpp | 1
   branches/release/libs/geometry/test/algorithms/within.cpp | 48 ++++++++++++++++++
   branches/release/libs/geometry/test/geometry_test_common.hpp | 23 +++++++++
   branches/release/libs/geometry/test/strategies/Jamfile.v2 | 1
   branches/release/libs/geometry/test/strategies/cross_track.cpp | 26 +++++----
   branches/release/libs/geometry/test/strategies/haversine.cpp | 40 ++++++++-------
   branches/release/libs/geometry/test/strategies/segment_intersection.cpp | 2
   branches/release/libs/geometry/test/strategies/segment_intersection_collinear.cpp | 2
   branches/release/libs/geometry/test/strategies/strategies_tests.sln | 2
   39 files changed, 505 insertions(+), 159 deletions(-)

Modified: branches/release/boost/geometry/core/cs.hpp
==============================================================================
--- branches/release/boost/geometry/core/cs.hpp (original)
+++ branches/release/boost/geometry/core/cs.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -79,7 +79,7 @@
 
 
 /*!
-\brief Spherical coordinate system, in degree or in radian
+\brief Spherical (polar) coordinate system, in degree or in radian
 \details Defines the spherical coordinate system where points are
     defined in two angles
     and an optional radius usually known as r, theta, phi
@@ -102,6 +102,25 @@
     typedef DegreeOrRadian units;
 };
 
+
+/*!
+\brief Spherical equatorial coordinate system, in degree or in radian
+\details This one resembles the geographic coordinate system, and has latitude
+ up from zero at the equator, to 90 at the pole
+ (opposite to the spherical(polar) coordinate system).
+ Used in astronomy and in GIS (but there is also the geographic)
+
+\see http://en.wikipedia.org/wiki/Spherical_coordinates
+\ingroup cs
+*/
+template<typename DegreeOrRadian>
+struct spherical_equatorial
+{
+ typedef DegreeOrRadian units;
+};
+
+
+
 /*!
 \brief Polar coordinate system
 \details Defines the polar coordinate system "in which each point
@@ -144,9 +163,16 @@
 template<typename DegreeOrRadian>
 struct cs_tag<cs::spherical<DegreeOrRadian> >
 {
- typedef spherical_tag type;
+ typedef spherical_polar_tag type;
 };
 
+template<typename DegreeOrRadian>
+struct cs_tag<cs::spherical_equatorial<DegreeOrRadian> >
+{
+ typedef spherical_equatorial_tag type;
+};
+
+
 template<>
 struct cs_tag<cs::cartesian>
 {

Modified: branches/release/boost/geometry/core/tags.hpp
==============================================================================
--- branches/release/boost/geometry/core/tags.hpp (original)
+++ branches/release/boost/geometry/core/tags.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -24,11 +24,15 @@
 /// Tag indicating Cartesian coordinate system family (cartesian,epsg)
 struct cartesian_tag {};
 
+/// Tag indicating Spherical polar coordinate system family
+struct spherical_polar_tag {};
+
+/// Tag indicating Spherical equatorial coordinate system family
+struct spherical_equatorial_tag {};
+
 /// Tag indicating Geographic coordinate system family (geographic)
 struct geographic_tag {};
 
-/// Tag indicating Spherical coordinate system family (spherical,celestial,...)
-struct spherical_tag {};
 
 
 // Tags defining tag hierarchy

Modified: branches/release/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp (original)
+++ branches/release/boost/geometry/strategies/agnostic/hull_graham_andrew.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -301,7 +301,7 @@
                 range_type,
                 range_iterator,
                 container_type,
- typename strategy_side<cs_tag>::type
+ typename strategy::side::services::default_strategy<cs_tag>::type
> assigner(extremes.left, extremes.right);
 
         geometry::detail::for_each_range(geometry, assigner);
@@ -358,7 +358,7 @@
     template <int Factor>
     static inline void add_to_hull(point_type const& p, container_type& output)
     {
- typedef typename strategy_side<cs_tag>::type side;
+ typedef typename strategy::side::services::default_strategy<cs_tag>::type side;
 
         output.push_back(p);
         register std::size_t output_size = output.size();

Modified: branches/release/boost/geometry/strategies/agnostic/point_in_poly_oriented_winding.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/agnostic/point_in_poly_oriented_winding.hpp (original)
+++ branches/release/boost/geometry/strategies/agnostic/point_in_poly_oriented_winding.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -62,7 +62,7 @@
>::type calculation_type;
 
 
- typedef typename strategy_side
+ typedef typename strategy::side::services::default_strategy
         <
             typename cs_tag<Point>::type
>::type strategy_side_type;

Modified: branches/release/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp (original)
+++ branches/release/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -58,7 +58,7 @@
>::type calculation_type;
 
 
- typedef typename strategy_side
+ typedef typename strategy::side::services::default_strategy
         <
             typename cs_tag<Point>::type
>::type strategy_side_type;
@@ -188,7 +188,13 @@
 };
 
 template <typename Point, typename PointOfSegment>
-struct default_strategy<point_tag, areal_tag, spherical_tag, spherical_tag, Point, PointOfSegment>
+struct default_strategy<point_tag, areal_tag, spherical_polar_tag, spherical_polar_tag, Point, PointOfSegment>
+{
+ typedef winding<Point, PointOfSegment> type;
+};
+
+template <typename Point, typename PointOfSegment>
+struct default_strategy<point_tag, areal_tag, spherical_equatorial_tag, spherical_equatorial_tag, Point, PointOfSegment>
 {
     typedef winding<Point, PointOfSegment> type;
 };

Modified: branches/release/boost/geometry/strategies/cartesian/distance_projected_point.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/cartesian/distance_projected_point.hpp (original)
+++ branches/release/boost/geometry/strategies/cartesian/distance_projected_point.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -116,13 +116,14 @@
     {
         assert_dimension_equal<Point, PointOfSegment>();
 
- /* Algorithm
- POINT v(x2 - x1, y2 - y1);
- POINT w(px - x1, py - y1);
- c1 = w . v
- c2 = v . v
- b = c1 / c2
- RETURN POINT(x1 + b * vx, y1 + b * vy);
+ /*
+ Algorithm [p1: (x1,y1), p2: (x2,y2), p: (px,py)]
+ VECTOR v(x2 - x1, y2 - y1)
+ VECTOR w(px - x1, py - y1)
+ c1 = w . v
+ c2 = v . v
+ b = c1 / c2
+ RETURN POINT(x1 + b * vx, y1 + b * vy)
         */
 
         // v is multiplied below with a (possibly) FP-value, so should be in FP
@@ -137,21 +138,20 @@
         Strategy strategy;
         boost::ignore_unused_variable_warning(strategy);
 
- calculation_type zero = calculation_type();
- fp_type c1 = dot_product(w, v);
+ calculation_type const zero = calculation_type();
+ fp_type const c1 = dot_product(w, v);
         if (c1 <= zero)
         {
             return strategy.apply(p, p1);
         }
- fp_type c2 = dot_product(v, v);
+ fp_type const c2 = dot_product(v, v);
         if (c2 <= c1)
         {
             return strategy.apply(p, p2);
         }
 
         // See above, c1 > 0 AND c2 > c1 so: c2 != 0
- fp_type b = fp_type(c1) / fp_type(c2);
-
+ fp_type const b = c1 / c2;
 
         fp_strategy_type fp_strategy
             = strategy::distance::services::get_similar
@@ -168,7 +168,6 @@
 
         return fp_strategy.apply(p, projected);
     }
-
 };
 
 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS

Modified: branches/release/boost/geometry/strategies/cartesian/side_by_triangle.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/cartesian/side_by_triangle.hpp (original)
+++ branches/release/boost/geometry/strategies/cartesian/side_by_triangle.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -21,6 +21,7 @@
 
 #include <boost/geometry/util/select_coordinate_type.hpp>
 
+#include <boost/geometry/strategies/side.hpp>
 
 
 namespace boost { namespace geometry
@@ -90,22 +91,28 @@
         promoted_type const s = dx * dpy - dy * dpx;
 
         promoted_type zero = promoted_type();
- return math::equals(s, zero) ? 0 : s > zero ? 1 : -1;
- //return s > 0 ? 1 : s < 0 ? -1 : 0;
+ return math::equals(s, zero) ? 0
+ : s > zero ? 1
+ : -1;
     }
 };
 
-}} // namespace strategy::side
-
 
 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
+namespace services
+{
+
 template <typename CalculationType>
-struct strategy_side<cartesian_tag, CalculationType>
+struct default_strategy<cartesian_tag, CalculationType>
 {
- typedef strategy::side::side_by_triangle<CalculationType> type;
+ typedef side_by_triangle<CalculationType> type;
 };
+
+}
 #endif
 
+}} // namespace strategy::side
+
 }} // namespace boost::geometry
 
 

Modified: branches/release/boost/geometry/strategies/intersection.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/intersection.hpp (original)
+++ branches/release/boost/geometry/strategies/intersection.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -77,7 +77,7 @@
                 CalculationType
> segment_intersection_strategy_type;
 
- typedef typename strategy_side
+ typedef typename strategy::side::services::default_strategy
         <
             Tag,
             CalculationType

Modified: branches/release/boost/geometry/strategies/side.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/side.hpp (original)
+++ branches/release/boost/geometry/strategies/side.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -21,6 +21,11 @@
 namespace boost { namespace geometry
 {
 
+namespace strategy { namespace side
+{
+
+namespace services
+{
 
 /*!
 \brief Traits class binding a side determination strategy to a coordinate system
@@ -29,12 +34,22 @@
 \tparam CalculationType \tparam_calculation
 */
 template <typename Tag, typename CalculationType = void>
-struct strategy_side
+struct default_strategy
 {
- typedef strategy::not_implemented type;
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_IMPLEMENTED_FOR_THIS_TYPE
+ , (types<Tag>)
+ );
 };
 
 
+} // namespace services
+
+
+}} // namespace strategy::side
+
+
 }} // namespace boost::geometry
 
 #endif // BOOST_GEOMETRY_STRATEGIES_SIDE_HPP

Modified: branches/release/boost/geometry/strategies/spherical/area_huiller.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/spherical/area_huiller.hpp (original)
+++ branches/release/boost/geometry/strategies/spherical/area_huiller.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -10,7 +10,6 @@
 #define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_AREA_HUILLER_HPP
 
 
-#include <boost/math/constants/constants.hpp>
 
 #include <boost/geometry/strategies/spherical/distance_haversine.hpp>
 
@@ -45,6 +44,8 @@
 and works well in most cases but not in 180 meridian crossing cases. This probably
 could be solved.
 
+\note This version is made for spherical equatorial coordinate systems
+
 \qbk{
 
 [heading Example]
@@ -64,10 +65,21 @@
>
 class huiller
 {
+typedef typename boost::mpl::if_c
+ <
+ boost::is_void<CalculationType>::type::value,
+ typename select_most_precise
+ <
+ typename coordinate_type<PointOfSegment>::type,
+ double
+ >::type,
+ CalculationType
+ >::type calculation_type;
+
 protected :
     struct excess_sum
     {
- double sum;
+ calculation_type sum;
 
         // Distances are calculated on unit sphere here
         strategy::distance::haversine<PointOfSegment, PointOfSegment>
@@ -78,18 +90,18 @@
             : sum(0)
             , distance_over_unit_sphere(1)
         {}
- inline double area(double radius) const
+ inline calculation_type area(calculation_type radius) const
         {
             return - sum * radius * radius;
         }
     };
 
 public :
- typedef double return_type;
+ typedef calculation_type return_type;
     typedef PointOfSegment segment_point_type;
     typedef excess_sum state_type;
 
- inline huiller(double radius = 1.0)
+ inline huiller(calculation_type radius = 1.0)
         : m_radius(radius)
     {}
 
@@ -99,26 +111,25 @@
     {
         if (! geometry::math::equals(get<0>(p1), get<0>(p2)))
         {
- namespace mc = boost::math::constants;
-
- double const two_pi = 2.0 * mc::pi<double>();
- double const half = 0.5;
- double const two = 2.0;
- double const four = 4.0;
+ calculation_type const half = 0.5;
+ calculation_type const two = 2.0;
+ calculation_type const four = 4.0;
+ calculation_type const two_pi = two * geometry::math::pi<calculation_type>();
+ calculation_type const half_pi = half * geometry::math::pi<calculation_type>();
 
             // Distance p1 p2
- double a = state.distance_over_unit_sphere.apply(p1, p2);
+ calculation_type a = state.distance_over_unit_sphere.apply(p1, p2);
 
             // Sides on unit sphere to south pole
- double b = half * mc::pi<double>() - geometry::get_as_radian<1>(p2);
- double c = half * mc::pi<double>() - geometry::get_as_radian<1>(p1);
+ calculation_type b = half_pi - geometry::get_as_radian<1>(p2);
+ calculation_type c = half_pi - geometry::get_as_radian<1>(p1);
 
             // Semi parameter
- double s = half * (a + b + c);
+ calculation_type s = half * (a + b + c);
 
             // E: spherical excess, using l'Huiller's formula
             // [tg(e / 4)]2 = tg[s / 2] tg[(s-a) / 2] tg[(s-b) / 2] tg[(s-c) / 2]
- double E = four * atan(sqrt(geometry::math::abs(tan(s / two)
+ calculation_type E = four * atan(sqrt(geometry::math::abs(tan(s / two)
                     * tan((s - a) / two)
                     * tan((s - b) / two)
                     * tan((s - c) / two))));
@@ -130,11 +141,11 @@
             // we have to take the dateline into account.
             // TODO: check this / enhance this, should be more robust. See also the "grow" for ll
             // TODO: use minmax or "smaller"/"compare" strategy for this
- double lon1 = geometry::get_as_radian<0>(p1) < 0
+ calculation_type lon1 = geometry::get_as_radian<0>(p1) < 0
                 ? geometry::get_as_radian<0>(p1) + two_pi
                 : geometry::get_as_radian<0>(p1);
 
- double lon2 = geometry::get_as_radian<0>(p2) < 0
+ calculation_type lon2 = geometry::get_as_radian<0>(p2) < 0
                 ? geometry::get_as_radian<0>(p2) + two_pi
                 : geometry::get_as_radian<0>(p2);
 
@@ -154,18 +165,27 @@
 
 private :
     /// Radius of the sphere
- double m_radius;
+ calculation_type m_radius;
 };
 
 #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
 
 namespace services
 {
- template <typename Point>
- struct default_strategy<spherical_tag, Point>
- {
- typedef strategy::area::huiller<Point> type;
- };
+
+
+template <typename Point>
+struct default_strategy<spherical_equatorial_tag, Point>
+{
+ typedef strategy::area::huiller<Point> type;
+};
+
+// Note: spherical polar coordinate system requires "get_as_radian_equatorial"
+/***template <typename Point>
+struct default_strategy<spherical_polar_tag, Point>
+{
+ typedef strategy::area::huiller<Point> type;
+};***/
 
 } // namespace services
 

Modified: branches/release/boost/geometry/strategies/spherical/compare_circular.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/spherical/compare_circular.hpp (original)
+++ branches/release/boost/geometry/strategies/spherical/compare_circular.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -117,7 +117,7 @@
     template<typename> class CoordinateSystem,
     typename Units
>
-struct strategy_compare<spherical_tag, 1, Point, CoordinateSystem<Units>, 0>
+struct strategy_compare<spherical_polar_tag, 1, Point, CoordinateSystem<Units>, 0>
 {
     typedef typename coordinate_type<Point>::type coordinate_type;
     typedef strategy::compare::circular_comparator
@@ -134,7 +134,7 @@
     template<typename> class CoordinateSystem,
     typename Units
>
-struct strategy_compare<spherical_tag, -1, Point, CoordinateSystem<Units>, 0>
+struct strategy_compare<spherical_polar_tag, -1, Point, CoordinateSystem<Units>, 0>
 {
     typedef typename coordinate_type<Point>::type coordinate_type;
     typedef strategy::compare::circular_comparator

Modified: branches/release/boost/geometry/strategies/spherical/distance_cross_track.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/spherical/distance_cross_track.hpp (original)
+++ branches/release/boost/geometry/strategies/spherical/distance_cross_track.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -219,7 +219,12 @@
 };
 
 
-template <typename Point, typename PointOfSegment, typename CalculationType, typename Strategy>
+template
+<
+ typename Point, typename PointOfSegment,
+ typename CalculationType,
+ typename Strategy
+>
 struct get_comparable<cross_track<Point, PointOfSegment, CalculationType, Strategy> >
 {
     typedef typename comparable_type
@@ -234,7 +239,12 @@
 };
 
 
-template <typename Point, typename PointOfSegment, typename CalculationType, typename Strategy>
+template
+<
+ typename Point, typename PointOfSegment,
+ typename CalculationType,
+ typename Strategy
+>
 struct result_from_distance<cross_track<Point, PointOfSegment, CalculationType, Strategy> >
 {
 private :
@@ -248,7 +258,12 @@
 };
 
 
-template <typename Point, typename PointOfSegment, typename CalculationType, typename Strategy>
+template
+<
+ typename Point, typename PointOfSegment,
+ typename CalculationType,
+ typename Strategy
+>
 struct strategy_point_point<cross_track<Point, PointOfSegment, CalculationType, Strategy> >
 {
     typedef Strategy type;
@@ -256,9 +271,17 @@
 
 
 
+/*
+
+TODO: spherical polar coordinate system requires "get_as_radian_equatorial<>"
 
 template <typename Point, typename PointOfSegment, typename Strategy>
-struct default_strategy<segment_tag, Point, PointOfSegment, spherical_tag, spherical_tag, Strategy>
+struct default_strategy
+ <
+ segment_tag, Point, PointOfSegment,
+ spherical_polar_tag, spherical_polar_tag,
+ Strategy
+ >
 {
     typedef cross_track
         <
@@ -271,12 +294,40 @@
                     typename default_strategy
                         <
                             point_tag, Point, PointOfSegment,
- spherical_tag, spherical_tag
+ spherical_polar_tag, spherical_polar_tag
>::type,
                     Strategy
>::type
> type;
 };
+*/
+
+template <typename Point, typename PointOfSegment, typename Strategy>
+struct default_strategy
+ <
+ segment_tag, Point, PointOfSegment,
+ spherical_equatorial_tag, spherical_equatorial_tag,
+ Strategy
+ >
+{
+ typedef cross_track
+ <
+ Point,
+ PointOfSegment,
+ void,
+ typename boost::mpl::if_
+ <
+ boost::is_void<Strategy>,
+ typename default_strategy
+ <
+ point_tag, Point, PointOfSegment,
+ spherical_equatorial_tag, spherical_equatorial_tag
+ >::type,
+ Strategy
+ >::type
+ > type;
+};
+
 
 
 } // namespace services

Modified: branches/release/boost/geometry/strategies/spherical/distance_haversine.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/spherical/distance_haversine.hpp (original)
+++ branches/release/boost/geometry/strategies/spherical/distance_haversine.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -306,13 +306,16 @@
 };
 
 
-// Register it as the default for point-types in a spherical coordinate system
+// Register it as the default for point-types
+// in a spherical equatorial coordinate system
 template <typename Point1, typename Point2>
-struct default_strategy<point_tag, Point1, Point2, spherical_tag, spherical_tag>
+struct default_strategy<point_tag, Point1, Point2, spherical_equatorial_tag, spherical_equatorial_tag>
 {
     typedef strategy::distance::haversine<Point1, Point2> type;
 };
 
+// Note: spherical polar coordinate system requires "get_as_radian_equatorial"
+
 
 } // namespace services
 #endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS

Modified: branches/release/boost/geometry/strategies/spherical/side_by_cross_track.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/spherical/side_by_cross_track.hpp (original)
+++ branches/release/boost/geometry/strategies/spherical/side_by_cross_track.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -83,31 +83,18 @@
                 CalculationType
>::type coordinate_type;
 
- // Calculate the distance using the Haversine formula.
- // That is also applicable on the spherical earth. A radius is not necessary.
-
         double d1 = 0.001; // m_strategy.apply(sp1, p);
         double crs_AD = detail::course(p1, p);
         double crs_AB = detail::course(p1, p2);
- double XTD = geometry::math::abs(asin(sin(d1) * sin(crs_AD - crs_AB)));
+ double XTD = asin(sin(d1) * sin(crs_AD - crs_AB));
 
- return math::equals(XTD, 0) ? 0 : XTD > 0 ? 1 : -1;
- //return s > 0 ? 1 : s < 0 ? -1 : 0;
+ return math::equals(XTD, 0) ? 0 : XTD < 0 ? 1 : -1;
     }
 };
 
 }} // namespace strategy::side
 
 
-#ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
-template <typename CalculationType>
-struct strategy_side<spherical_tag, CalculationType>
-{
- typedef strategy::side::side_by_cross_track<CalculationType> type;
-};
-#endif
-
-
 }} // namespace boost::geometry
 
 

Modified: branches/release/boost/geometry/strategies/strategies.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/strategies.hpp (original)
+++ branches/release/boost/geometry/strategies/strategies.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -40,6 +40,7 @@
 #include <boost/geometry/strategies/spherical/distance_haversine.hpp>
 #include <boost/geometry/strategies/spherical/distance_cross_track.hpp>
 #include <boost/geometry/strategies/spherical/compare_circular.hpp>
+#include <boost/geometry/strategies/spherical/ssf.hpp>
 
 #include <boost/geometry/strategies/agnostic/hull_graham_andrew.hpp>
 #include <boost/geometry/strategies/agnostic/point_in_poly_winding.hpp>

Modified: branches/release/boost/geometry/strategies/strategy_transform.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/strategy_transform.hpp (original)
+++ branches/release/boost/geometry/strategies/strategy_transform.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -155,26 +155,48 @@
 
     /// Helper function for conversion, phi/theta are in radians
     template <typename P, typename T, typename R>
- inline void spherical_to_cartesian(T phi, T theta, R r, P& p)
+ inline void spherical_polar_to_cartesian(T phi, T theta, R r, P& p)
     {
         assert_dimension<P, 3>();
 
         // http://en.wikipedia.org/wiki/List_of_canonical_coordinate_transformations#From_spherical_coordinates
+ // http://www.vias.org/comp_geometry/math_coord_convert_3d.htm
+ // https://moodle.polymtl.ca/file.php/1183/Autres_Documents/Derivation_for_Spherical_Co-ordinates.pdf
+ // http://en.citizendium.org/wiki/Spherical_polar_coordinates
+
         // Phi = first, theta is second, r is third, see documentation on cs::spherical
 
         // (calculations are splitted to implement ttmath)
 
         T r_sin_theta = r;
+ T r_cos_theta = r;
         r_sin_theta *= sin(theta);
+ r_cos_theta *= cos(theta);
 
         set<0>(p, r_sin_theta * cos(phi));
         set<1>(p, r_sin_theta * sin(phi));
-
- T r_cos_theta = r;
- r_cos_theta *= cos(theta);
-
         set<2>(p, r_cos_theta);
     }
+
+ /// Helper function for conversion, lambda/delta (lon lat) are in radians
+ template <typename P, typename T, typename R>
+ inline void spherical_equatorial_to_cartesian(T lambda, T delta, R r, P& p)
+ {
+ assert_dimension<P, 3>();
+
+ // http://mathworld.wolfram.com/GreatCircle.html
+ // http://www.spenvis.oma.be/help/background/coortran/coortran.html WRONG
+
+ T r_cos_delta = r;
+ T r_sin_delta = r;
+ r_cos_delta *= cos(delta);
+ r_sin_delta *= sin(delta);
+
+ set<0>(p, r_cos_delta * cos(lambda));
+ set<1>(p, r_cos_delta * sin(lambda));
+ set<2>(p, r_sin_delta);
+ }
+
 
     /// Helper function for conversion
     template <typename P, typename T>
@@ -230,16 +252,28 @@
     \tparam P2 second point type
  */
 template <typename P1, typename P2>
-struct from_spherical_2_to_cartesian_3
+struct from_spherical_polar_2_to_cartesian_3
+{
+ inline bool apply(P1 const& p1, P2& p2) const
+ {
+ assert_dimension<P1, 2>();
+ detail::spherical_polar_to_cartesian(get_as_radian<0>(p1), get_as_radian<1>(p1), 1.0, p2);
+ return true;
+ }
+};
+
+template <typename P1, typename P2>
+struct from_spherical_equatorial_2_to_cartesian_3
 {
     inline bool apply(P1 const& p1, P2& p2) const
     {
         assert_dimension<P1, 2>();
- detail::spherical_to_cartesian(get_as_radian<0>(p1), get_as_radian<1>(p1), 1.0, p2);
+ detail::spherical_equatorial_to_cartesian(get_as_radian<0>(p1), get_as_radian<1>(p1), 1.0, p2);
         return true;
     }
 };
 
+
 /*!
     \brief Transformation strategy for 3D spherical (phi,theta,r) to 3D cartesian (x,y,z)
     \ingroup transform
@@ -247,17 +281,30 @@
     \tparam P2 second point type
  */
 template <typename P1, typename P2>
-struct from_spherical_3_to_cartesian_3
+struct from_spherical_polar_3_to_cartesian_3
+{
+ inline bool apply(P1 const& p1, P2& p2) const
+ {
+ assert_dimension<P1, 3>();
+ detail::spherical_polar_to_cartesian(
+ get_as_radian<0>(p1), get_as_radian<1>(p1), get<2>(p1), p2);
+ return true;
+ }
+};
+
+template <typename P1, typename P2>
+struct from_spherical_equatorial_3_to_cartesian_3
 {
     inline bool apply(P1 const& p1, P2& p2) const
     {
         assert_dimension<P1, 3>();
- detail::spherical_to_cartesian(
+ detail::spherical_equatorial_to_cartesian(
                     get_as_radian<0>(p1), get_as_radian<1>(p1), get<2>(p1), p2);
         return true;
     }
 };
 
+
 /*!
     \brief Transformation strategy for 3D cartesian (x,y,z) to 2D spherical (phi,theta)
     \details on Unit sphere
@@ -267,7 +314,7 @@
     \note If x,y,z point is not lying on unit sphere, transformation will return false
  */
 template <typename P1, typename P2>
-struct from_cartesian_3_to_spherical_2
+struct from_cartesian_3_to_spherical_polar_2
 {
     inline bool apply(P1 const& p1, P2& p2) const
     {
@@ -284,7 +331,7 @@
     \tparam P2 second point type
  */
 template <typename P1, typename P2>
-struct from_cartesian_3_to_spherical_3
+struct from_cartesian_3_to_spherical_polar_3
 {
     inline bool apply(P1 const& p1, P2& p2) const
     {
@@ -343,30 +390,42 @@
 
 /// Specialization to transform from unit sphere(phi,theta) to XYZ
 template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
-struct default_strategy<spherical_tag, cartesian_tag, CoordSys1, CoordSys2, 2, 3, P1, P2>
+struct default_strategy<spherical_polar_tag, cartesian_tag, CoordSys1, CoordSys2, 2, 3, P1, P2>
 {
- typedef from_spherical_2_to_cartesian_3<P1, P2> type;
+ typedef from_spherical_polar_2_to_cartesian_3<P1, P2> type;
 };
 
 /// Specialization to transform from sphere(phi,theta,r) to XYZ
 template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
-struct default_strategy<spherical_tag, cartesian_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
+struct default_strategy<spherical_polar_tag, cartesian_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
+{
+ typedef from_spherical_polar_3_to_cartesian_3<P1, P2> type;
+};
+
+template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
+struct default_strategy<spherical_equatorial_tag, cartesian_tag, CoordSys1, CoordSys2, 2, 3, P1, P2>
+{
+ typedef from_spherical_equatorial_2_to_cartesian_3<P1, P2> type;
+};
+
+template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
+struct default_strategy<spherical_equatorial_tag, cartesian_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
 {
- typedef from_spherical_3_to_cartesian_3<P1, P2> type;
+ typedef from_spherical_equatorial_3_to_cartesian_3<P1, P2> type;
 };
 
 /// Specialization to transform from XYZ to unit sphere(phi,theta)
 template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
-struct default_strategy<cartesian_tag, spherical_tag, CoordSys1, CoordSys2, 3, 2, P1, P2>
+struct default_strategy<cartesian_tag, spherical_polar_tag, CoordSys1, CoordSys2, 3, 2, P1, P2>
 {
- typedef from_cartesian_3_to_spherical_2<P1, P2> type;
+ typedef from_cartesian_3_to_spherical_polar_2<P1, P2> type;
 };
 
 /// Specialization to transform from XYZ to sphere(phi,theta,r)
 template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
-struct default_strategy<cartesian_tag, spherical_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
+struct default_strategy<cartesian_tag, spherical_polar_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
 {
- typedef from_cartesian_3_to_spherical_3<P1, P2> type;
+ typedef from_cartesian_3_to_spherical_polar_3<P1, P2> type;
 };
 
 

Modified: branches/release/libs/geometry/doc/src/examples/algorithms/area.cpp
==============================================================================
--- branches/release/libs/geometry/doc/src/examples/algorithms/area.cpp (original)
+++ branches/release/libs/geometry/doc/src/examples/algorithms/area.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -27,8 +27,8 @@
     double area = bg::area(poly);
     std::cout << "Area: " << area << std::endl;
 
- // Calculate the area of a spherical polygon
- bg::model::polygon<bg::model::point<float, 2, bg::cs::spherical<bg::degree> > > sph_poly;
+ // Calculate the area of a spherical equatorial polygon
+ bg::model::polygon<bg::model::point<float, 2, bg::cs::spherical_equatorial<bg::degree> > > sph_poly;
     bg::read_wkt("POLYGON((0 0,0 45,45 0,0 0))", sph_poly);
     area = bg::area(sph_poly);
     std::cout << "Area: " << area << std::endl;

Modified: branches/release/libs/geometry/doc/src/examples/algorithms/area_with_strategy.cpp
==============================================================================
--- branches/release/libs/geometry/doc/src/examples/algorithms/area_with_strategy.cpp (original)
+++ branches/release/libs/geometry/doc/src/examples/algorithms/area_with_strategy.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -27,8 +27,8 @@
     double area = bg::area(poly);
     std::cout << "Area: " << area << std::endl;
 
- // Calculate the area of a spherical polygon
- bg::model::polygon<bg::model::point<float, 2, bg::cs::spherical<bg::degree> > > sph_poly;
+ // Calculate the area of a spherical polygon (for latitude: 0 at equator)
+ bg::model::polygon<bg::model::point<float, 2, bg::cs::spherical_equatorial<bg::degree> > > sph_poly;
     bg::read_wkt("POLYGON((0 0,0 45,45 0,0 0))", sph_poly);
     area = bg::area(sph_poly);
     std::cout << "Area: " << area << std::endl;

Modified: branches/release/libs/geometry/doc/src/examples/algorithms/length_with_strategy.cpp
==============================================================================
--- branches/release/libs/geometry/doc/src/examples/algorithms/length_with_strategy.cpp (original)
+++ branches/release/libs/geometry/doc/src/examples/algorithms/length_with_strategy.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -17,7 +17,7 @@
 int main()
 {
     using namespace boost::geometry;
- typedef model::point<float, 2, cs::spherical<degree> > P;
+ typedef model::point<float, 2, cs::spherical_equatorial<degree> > P;
     model::linestring<P> line;
     line.push_back(P(2, 41));
     line.push_back(P(2, 48));

Modified: branches/release/libs/geometry/doc/src/examples/algorithms/transform.cpp
==============================================================================
--- branches/release/libs/geometry/doc/src/examples/algorithms/transform.cpp (original)
+++ branches/release/libs/geometry/doc/src/examples/algorithms/transform.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -18,7 +18,8 @@
 {
     namespace bg = boost::geometry;
 
- bg::model::point<long double, 2, bg::cs::spherical<bg::degree> > p1(5.0, 52.0);
+ // Select a point near the pole (theta=5.0, phi=15.0)
+ bg::model::point<long double, 2, bg::cs::spherical<bg::degree> > p1(15.0, 5.0);
     
     // Transform from degree to radian. Default strategy is automatically selected,
     // it will convert from degree to radian
@@ -45,9 +46,9 @@
 /*`
 Output:
 [pre
-p1: (5, 52)
-p2: (0.0872665, 0.907571)
-p3: (0.785012, 0.0686797, 0.615661)
+p1: (15, 5)
+p2: (0.261799, 0.0872665)
+p3: (0.084186, 0.0225576, 0.996195)
 ]
 */
 //]

Modified: branches/release/libs/geometry/doc/src/examples/core/degree_radian.cpp
==============================================================================
--- branches/release/libs/geometry/doc/src/examples/core/degree_radian.cpp (original)
+++ branches/release/libs/geometry/doc/src/examples/core/degree_radian.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -17,8 +17,8 @@
 
 int main()
 {
- typedef model::point<double, 2, cs::spherical<degree> > degree_point;
- typedef model::point<double, 2, cs::spherical<radian> > radian_point;
+ typedef model::point<double, 2, cs::spherical_equatorial<degree> > degree_point;
+ typedef model::point<double, 2, cs::spherical_equatorial<radian> > radian_point;
     
     degree_point d(4.893, 52.373);
     radian_point r(0.041, 0.8527);

Modified: branches/release/libs/geometry/doc/src/examples/quick_start.cpp
==============================================================================
--- branches/release/libs/geometry/doc/src/examples/quick_start.cpp (original)
+++ branches/release/libs/geometry/doc/src/examples/quick_start.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -135,7 +135,7 @@
     //[quick_start_spherical
     typedef boost::geometry::model::point
         <
- double, 2, boost::geometry::cs::spherical<boost::geometry::degree>
+ double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::degree>
> spherical_point;
     
     spherical_point amsterdam(4.90, 52.37);

Modified: branches/release/libs/geometry/example/06_a_transformation_example.cpp
==============================================================================
--- branches/release/libs/geometry/example/06_a_transformation_example.cpp (original)
+++ branches/release/libs/geometry/example/06_a_transformation_example.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -50,7 +50,7 @@
     // - from Cartesian to Spherical coordinate systems and back
     // - from Cartesian to Cartesian (mapping, affine transformations) and back (inverse)
     // - Map Projections
- // - from Degree to Radian and back in spherical or geographic coordinate systems
+ // - from Degree to Radian and back in spherical_equatorial or geographic coordinate systems
 
     return 0;
 }

Modified: branches/release/libs/geometry/example/07_a_graph_route_example.cpp
==============================================================================
--- branches/release/libs/geometry/example/07_a_graph_route_example.cpp (original)
+++ branches/release/libs/geometry/example/07_a_graph_route_example.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -267,7 +267,7 @@
     // (geographic calculations are in an extension; for sample it makes no difference)
     typedef boost::geometry::model::point
         <
- double, 2, boost::geometry::cs::spherical<boost::geometry::degree>
+ double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::degree>
> point_type;
 
     typedef boost::geometry::model::linestring<point_type> line_type;

Modified: branches/release/libs/geometry/example/07_b_graph_route_example.cpp
==============================================================================
--- branches/release/libs/geometry/example/07_b_graph_route_example.cpp (original)
+++ branches/release/libs/geometry/example/07_b_graph_route_example.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -249,11 +249,11 @@
 
 int main()
 {
- // Define a point in the Geographic coordinate system (currently Spherical)
+ // Define a point in the Geographic coordinate system (currently spherical-equatorial)
     // (geographic calculations are in an extension; for sample it makes no difference)
     typedef boost::geometry::model::point
         <
- double, 2, boost::geometry::cs::spherical<boost::geometry::degree>
+ double, 2, boost::geometry::cs::spherical_equatorial<boost::geometry::degree>
> point_type;
 
     typedef boost::geometry::model::linestring<point_type> line_type;

Modified: branches/release/libs/geometry/test/algorithms/area.cpp
==============================================================================
--- branches/release/libs/geometry/test/algorithms/area.cpp (original)
+++ branches/release/libs/geometry/test/algorithms/area.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -13,8 +13,6 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 
-#include <boost/math/constants/constants.hpp>
-
 #include <algorithms/test_area.hpp>
 
 #include <boost/geometry/geometries/point_xy.hpp>
@@ -60,15 +58,19 @@
 }
 
 template <typename Point>
-void test_spherical()
+void test_spherical(bool polar = false)
 {
+ typedef typename bg::coordinate_type<Point>::type ct;
     bg::model::polygon<Point> geometry;
 
     // unit-sphere has area of 4-PI. Polygon covering 1/8 of it:
- double expected = 4.0 * boost::math::constants::pi<double>() / 8.0;
+ // calculations splitted for ttmath
+ ct const four = 4.0;
+ ct const eight = 8.0;
+ ct expected = four * boost::geometry::math::pi<ct>() / eight;
     bg::read_wkt("POLYGON((0 0,0 90,90 0,0 0))", geometry);
 
- double area = bg::area(geometry);
+ ct area = bg::area(geometry);
     BOOST_CHECK_CLOSE(area, expected, 0.0001);
 
     // With strategy, radius 2 -> 4 pi r^2
@@ -78,7 +80,91 @@
> strategy(2.0);
 
     area = bg::area(geometry, strategy);
- BOOST_CHECK_CLOSE(area, 2.0 * 2.0 * expected, 0.0001);
+ ct const two = 2.0;
+ BOOST_CHECK_CLOSE(area, two * two * expected, 0.0001);
+
+ // Wrangel Island (dateline crossing)
+ // With (spherical) Earth strategy
+ bg::strategy::area::huiller
+ <
+ typename bg::point_type<Point>::type
+ > spherical_earth(6373);
+ bg::read_wkt("POLYGON((-178.7858 70.7852, 177.4758 71.2333, 179.7436 71.5733, -178.7858 70.7852))", geometry);
+ area = bg::area(geometry, spherical_earth);
+ // SQL Server gives: 4537.9654419375
+ // PostGIS gives: 4537.9311668307
+ // Note: those are Geographic, this test is Spherical
+ BOOST_CHECK_CLOSE(area, 4506.6389, 0.001);
+
+ // Wrangel, more in detail
+ bg::read_wkt("POLYGON((-178.568604 71.564148,-178.017548 71.449692,-177.833313 71.3461,-177.502838 71.277466 ,-177.439453 71.226929,-177.620026 71.116638,-177.9389 71.037491,-178.8186 70.979965,-179.274445 70.907761,-180 70.9972,179.678314 70.895538,179.272766 70.888596,178.791016 70.7964,178.617737 71.035538,178.872192 71.217484,179.530273 71.4383 ,-180 71.535843 ,-179.628601 71.577194,-179.305298 71.551361,-179.03421 71.597748,-178.568604 71.564148))", geometry);
+ area = bg::area(geometry, spherical_earth);
+ // SQL Server gives: 7669.10402181435
+ // PostGIS gives: 7669.55565459832
+ BOOST_CHECK_CLOSE(area, 7616.523769, 0.001);
+
+ // Check more at the equator
+ /*
+ select 1,geography::STGeomFromText('POLYGON((-178.7858 10.7852 , 179.7436 11.5733 , 177.4758 11.2333 , -178.7858 10.7852))',4326) .STArea()/1000000.0
+ union select 2,geography::STGeomFromText('POLYGON((-178.7858 20.7852 , 179.7436 21.5733 , 177.4758 21.2333 , -178.7858 20.7852))',4326) .STArea()/1000000.0
+ union select 3,geography::STGeomFromText('POLYGON((-178.7858 30.7852 , 179.7436 31.5733 , 177.4758 31.2333 , -178.7858 30.7852))',4326) .STArea()/1000000.0
+ union select 0,geography::STGeomFromText('POLYGON((-178.7858 0.7852 , 179.7436 1.5733 , 177.4758 1.2333 , -178.7858 0.7852))',4326) .STArea()/1000000.0
+ union select 4,geography::STGeomFromText('POLYGON((-178.7858 40.7852 , 179.7436 41.5733 , 177.4758 41.2333 , -178.7858 40.7852))',4326) .STArea()/1000000.0
+ */
+
+ bg::read_wkt("POLYGON((-178.7858 0.7852, 177.4758 1.2333, 179.7436 1.5733, -178.7858 0.7852))", geometry);
+ area = bg::area(geometry, spherical_earth);
+ BOOST_CHECK_CLOSE(area, 14136.09946, 0.001); // SQL Server gives: 14064.1902284513
+
+
+ bg::read_wkt("POLYGON((-178.7858 10.7852, 177.4758 11.2333, 179.7436 11.5733, -178.7858 10.7852))", geometry);
+ area = bg::area(geometry, spherical_earth);
+ BOOST_CHECK_CLOSE(area, 13760.2456, 0.001); // SQL Server gives: 13697.0941155193
+
+ bg::read_wkt("POLYGON((-178.7858 20.7852, 177.4758 21.2333, 179.7436 21.5733, -178.7858 20.7852))", geometry);
+ area = bg::area(geometry, spherical_earth);
+ BOOST_CHECK_CLOSE(area, 12987.8682, 0.001); // SQL Server gives: 12944.3970990317 -> -39m^2
+
+ bg::read_wkt("POLYGON((-178.7858 30.7852, 177.4758 31.2333, 179.7436 31.5733, -178.7858 30.7852))", geometry);
+ area = bg::area(geometry, spherical_earth);
+ BOOST_CHECK_CLOSE(area, 11856.3935, 0.001); // SQL Server gives: 11838.5338423574 -> -18m^2
+
+ bg::read_wkt("POLYGON((-178.7858 40.7852, 177.4758 41.2333, 179.7436 41.5733, -178.7858 40.7852))", geometry);
+ area = bg::area(geometry, spherical_earth);
+ BOOST_CHECK_CLOSE(area, 10404.627685523914, 0.001); // SQL Server gives: 10412.0607137119, -> +8m^2
+
+ // Concave
+ bg::read_wkt("POLYGON((0 40,1 42,0 44,2 43,4 44,3 42,4 40,2 41,0 40))", geometry);
+ area = bg::area(geometry, spherical_earth);
+ BOOST_CHECK_CLOSE(area, 73538.2958, 0.001); // SQL Server gives: 73604.2047689719
+
+ // With hole POLYGON((0 40,4 40,4 44,0 44,0 40),(1 41,2 43,3 42,1 41))
+ bg::read_wkt("POLYGON((0 40,0 44,4 44,4 40,0 40),(1 41,3 42,2 43,1 41))", geometry);
+ area = bg::area(geometry, spherical_earth);
+ BOOST_CHECK_CLOSE(area, 133233.844876, 0.001); // SQL Server gives: 133353.335
+
+ {
+ bg::model::ring<Point> aurha; // a'dam-utr-rott.-den haag-a'dam
+ bg::read_wkt("POLYGON((4.892 52.373,5.119 52.093,4.479 51.930,4.23 52.08,4.892 52.373))", aurha);
+ if (polar)
+ {
+ // Create colatitudes (measured from pole)
+ BOOST_FOREACH(Point& p, aurha)
+ {
+ bg::set<1>(p, ct(90) - bg::get<1>(p));
+ }
+ bg::correct(aurha);
+ }
+ bg::strategy::area::huiller
+ <
+ typename bg::point_type<Point>::type
+ > huiller(6372.795);
+ area = bg::area(aurha, huiller);
+ BOOST_CHECK_CLOSE(area, 1476.645675, 0.0001);
+
+ // SQL Server gives: 1481.55595960659
+ // for select geography::STGeomFromText('POLYGON((4.892 52.373,4.23 52.08,4.479 51.930,5.119 52.093,4.892 52.373))',4326).STArea()/1000000.0
+ }
 }
 
 template <typename P>
@@ -116,7 +202,8 @@
     test_all<bg::model::point<float, 2, bg::cs::cartesian> >();
     test_all<bg::model::point<double, 2, bg::cs::cartesian> >();
 
- test_spherical<bg::model::point<double, 2, bg::cs::spherical<bg::degree> > >();
+ test_spherical<bg::model::point<double, 2, bg::cs::spherical_equatorial<bg::degree> > >();
+ //test_spherical<bg::model::point<double, 2, bg::cs::spherical<bg::degree> > >(true);
 
     test_ccw<bg::model::point<double, 2, bg::cs::cartesian> >();
     test_open<bg::model::point<double, 2, bg::cs::cartesian> >();
@@ -124,6 +211,7 @@
 
 #ifdef HAVE_TTMATH
     test_all<bg::model::d2::point_xy<ttmath_big> >();
+ test_spherical<bg::model::point<ttmath_big, 2, bg::cs::spherical_equatorial<bg::degree> > >();
 #endif
 
     return 0;

Modified: branches/release/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp
==============================================================================
--- branches/release/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp (original)
+++ branches/release/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -35,7 +35,7 @@
 inline typename bg::coordinate_type<Geometry1>::type intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name,
                bg::detail::overlay::operation_type op)
 {
- typedef typename bg::strategy_side
+ typedef typename bg::strategy::side::services::default_strategy
     <
         typename bg::cs_tag<Geometry1>::type
>::type side_strategy_type;

Modified: branches/release/libs/geometry/test/algorithms/overlay/traverse.cpp
==============================================================================
--- branches/release/libs/geometry/test/algorithms/overlay/traverse.cpp (original)
+++ branches/release/libs/geometry/test/algorithms/overlay/traverse.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -134,7 +134,7 @@
         //std::cout << bg::area(g1) << " " << bg::area(g2) << std::endl;
 #endif
 
- typedef typename bg::strategy_side
+ typedef typename bg::strategy::side::services::default_strategy
         <
             typename bg::cs_tag<G1>::type
>::type side_strategy_type;

Modified: branches/release/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp
==============================================================================
--- branches/release/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp (original)
+++ branches/release/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -62,7 +62,7 @@
     typedef std::vector<ip> ip_vector;
     ip_vector ips;
 
- typedef typename bg::strategy_side
+ typedef typename bg::strategy::side::services::default_strategy
             <
                 typename bg::cs_tag<G1>::type
>::type strategy_type;

Modified: branches/release/libs/geometry/test/algorithms/simplify.cpp
==============================================================================
--- branches/release/libs/geometry/test/algorithms/simplify.cpp (original)
+++ branches/release/libs/geometry/test/algorithms/simplify.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -96,11 +96,11 @@
     test_all<bg::model::d2::point_xy<float> >();
     test_all<bg::model::d2::point_xy<double> >();
 
- test_spherical<bg::model::point<double, 2, bg::cs::spherical<bg::degree> > >();
+ test_spherical<bg::model::point<double, 2, bg::cs::spherical_equatorial<bg::degree> > >();
 
 #if defined(HAVE_TTMATH)
     test_all<bg::model::d2::point_xy<ttmath_big> >();
- test_spherical<bg::model::point<ttmath_big, 2, bg::cs::spherical<bg::degree> > >();
+ test_spherical<bg::model::point<ttmath_big, 2, bg::cs::spherical_equatorial<bg::degree> > >();
 #endif
 
     return 0;

Modified: branches/release/libs/geometry/test/algorithms/test_area.hpp
==============================================================================
--- branches/release/libs/geometry/test/algorithms/test_area.hpp (original)
+++ branches/release/libs/geometry/test/algorithms/test_area.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -14,6 +14,7 @@
 #include <geometry_test_common.hpp>
 
 #include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/correct.hpp>
 #include <boost/geometry/strategies/strategies.hpp>
 
 #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp>

Modified: branches/release/libs/geometry/test/algorithms/within.cpp
==============================================================================
--- branches/release/libs/geometry/test/algorithms/within.cpp (original)
+++ branches/release/libs/geometry/test/algorithms/within.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -62,7 +62,51 @@
         true, false);
 }
 
+template <typename Point>
+void test_spherical()
+{
+ typedef typename bg::coordinate_type<Point>::type ct;
+ bg::model::polygon<Point> wrangel;
+
+ // SQL Server check (no geography::STWithin, so check with intersection trick)
+ /*
+
+ with q as (
+ select geography::STGeomFromText('POLYGON((-178.569 71.5641,-179.034 71.5977,-179.305 71.5514,-179.629 71.5772,-180 71.5358,179.53 71.4383,178.872 71.2175,178.618 71.0355,178.791 70.7964,179.273 70.8886,179.678 70.8955,-180 70.9972,-179.274 70.9078,-178.819 70.98,-177.939 71.0375,-177.62 71.1166,-177.439 71.2269,-177.503 71.2775,-177.833 71.3461,-178.018 71.4497,-178.569 71.5641))',4326) as wrangel
+ )
+
+ select wrangel.STArea()/1000000.0
+ ,geography::STGeomFromText('POINT(-179.3 71.27)',4326).STIntersection(wrangel).STAsText() as workaround_within_1
+ ,geography::STGeomFromText('POINT(-179.9 70.95)',4326).STIntersection(wrangel).STAsText() as workaround_within_2
+ ,geography::STGeomFromText('POINT(179.9 70.95)',4326).STIntersection(wrangel).STAsText() as workaround_within_3
+ from q
+
+ -> 7669.10402181435 POINT (-179.3 71.27) GEOMETRYCOLLECTION EMPTY GEOMETRYCOLLECTION EMPTY
+
+ PostGIS knows Within for Geography neither, and the intersection trick gives the same result
+
+ */
+
+ bg::read_wkt("POLYGON((-178.568604 71.564148,-178.017548 71.449692,-177.833313 71.3461,-177.502838 71.277466 ,-177.439453 71.226929,-177.620026 71.116638,-177.9389 71.037491,-178.8186 70.979965,-179.274445 70.907761,-180 70.9972,179.678314 70.895538,179.272766 70.888596,178.791016 70.7964,178.617737 71.035538,178.872192 71.217484,179.530273 71.4383 ,-180 71.535843 ,-179.628601 71.577194,-179.305298 71.551361,-179.03421 71.597748,-178.568604 71.564148))", wrangel);
 
+ bool within = bg::within(Point(-179.3, 71.27), wrangel);
+ BOOST_CHECK_EQUAL(within, true);
+
+ within = bg::within(Point(-179.9, 70.95), wrangel);
+ BOOST_CHECK_EQUAL(within, false);
+
+ within = bg::within(Point(179.9, 70.95), wrangel);
+ BOOST_CHECK_EQUAL(within, false);
+
+ // Test using great circle mapper
+ // http://www.gcmap.com/mapui?P=5E52N-9E53N-7E50N-5E52N,7E52.5N,8E51.5N,6E51N
+
+ bg::model::polygon<Point> triangle;
+ bg::read_wkt("POLYGON((5 52,9 53,7 50,5 52))", triangle);
+ BOOST_CHECK_EQUAL(bg::within(Point(7, 52.5), triangle), true);
+ BOOST_CHECK_EQUAL(bg::within(Point(8.0, 51.5), triangle), false);
+ BOOST_CHECK_EQUAL(bg::within(Point(6.0, 51.0), triangle), false);
+}
 
 
 int test_main( int , char* [] )
@@ -70,8 +114,12 @@
     test_all<bg::model::d2::point_xy<int> >();
     test_all<bg::model::d2::point_xy<double> >();
 
+ test_spherical<bg::model::point<double, 2, bg::cs::spherical_equatorial<bg::degree> > >();
+
+
 #if defined(HAVE_TTMATH)
     test_all<bg::model::d2::point_xy<ttmath_big> >();
+ test_spherical<bg::model::point<ttmath_big, 2, bg::cs::spherical_equatorial<bg::degree> > >();
 #endif
 
     return 0;

Modified: branches/release/libs/geometry/test/geometry_test_common.hpp
==============================================================================
--- branches/release/libs/geometry/test/geometry_test_common.hpp (original)
+++ branches/release/libs/geometry/test/geometry_test_common.hpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -94,6 +94,29 @@
 #endif
 
 
+
+struct geographic_policy
+{
+ template <typename CoordinateType>
+ static inline CoordinateType apply(CoordinateType const& value)
+ {
+ return value;
+ }
+};
+
+struct mathematical_policy
+{
+ template <typename CoordinateType>
+ static inline CoordinateType apply(CoordinateType const& value)
+ {
+ return 90 - value;
+ }
+
+};
+
+
+
+
 // For all tests:
 // - do NOT use "using namespace boost::geometry" to make clear what is Boost.Geometry
 // - use bg:: as short alias

Modified: branches/release/libs/geometry/test/strategies/Jamfile.v2
==============================================================================
--- branches/release/libs/geometry/test/strategies/Jamfile.v2 (original)
+++ branches/release/libs/geometry/test/strategies/Jamfile.v2 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -14,6 +14,7 @@
     [ run haversine.cpp ]
     [ run projected_point.cpp ]
     [ run pythagoras.cpp ]
+ [ run spherical_side.cpp ]
     [ run transformer.cpp ]
     [ run within.cpp ]
     ;

Modified: branches/release/libs/geometry/test/strategies/cross_track.cpp
==============================================================================
--- branches/release/libs/geometry/test/strategies/cross_track.cpp (original)
+++ branches/release/libs/geometry/test/strategies/cross_track.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -28,9 +28,10 @@
 #include <boost/geometry/geometries/segment.hpp>
 
 
+// This test is GIS oriented.
 
 
-template <typename Point>
+template <typename Point, typename LatitudePolicy>
 void test_distance(
             typename bg::coordinate_type<Point>::type const& lon1,
             typename bg::coordinate_type<Point>::type const& lat1,
@@ -60,9 +61,9 @@
 
 
     Point p1, p2, p3;
- bg::assign_values(p1, lon1, lat1);
- bg::assign_values(p2, lon2, lat2);
- bg::assign_values(p3, lon3, lat3);
+ bg::assign_values(p1, lon1, LatitudePolicy::apply(lat1));
+ bg::assign_values(p2, lon2, LatitudePolicy::apply(lat2));
+ bg::assign_values(p3, lon3, LatitudePolicy::apply(lat3));
 
 
     strategy_type strategy;
@@ -83,29 +84,30 @@
 }
 
 
-
-template <typename Point>
+template <typename Point, typename LatitudePolicy>
 void test_all()
 {
     typename bg::coordinate_type<Point>::type const average_earth_radius = 6372795.0;
 
     // distance (Paris <-> Amsterdam/Barcelona),
     // with coordinates rounded as below ~87 km
- // should be is equal
- // to distance (Paris <-> Barcelona/Amsterdam)
+ // is equal to distance (Paris <-> Barcelona/Amsterdam)
     typename bg::coordinate_type<Point>::type const p_to_ab = 86.798321 * 1000.0;
- test_distance<Point>(2, 48, 4, 52, 2, 41, average_earth_radius, p_to_ab, 0.1);
- test_distance<Point>(2, 48, 2, 41, 4, 52, average_earth_radius, p_to_ab, 0.1);
+ test_distance<Point, LatitudePolicy>(2, 48, 4, 52, 2, 41, average_earth_radius, p_to_ab, 0.1);
+ test_distance<Point, LatitudePolicy>(2, 48, 2, 41, 4, 52, average_earth_radius, p_to_ab, 0.1);
 }
 
 
 int test_main(int, char* [])
 {
- test_all<bg::model::point<double, 2, bg::cs::spherical<bg::degree> > >();
+ test_all<bg::model::point<double, 2, bg::cs::spherical_equatorial<bg::degree> >, geographic_policy >();
+
+ // NYI: haversine for mathematical spherical coordinate systems
+ // test_all<bg::model::point<double, 2, bg::cs::spherical<bg::degree> >, mathematical_policya >();
 
 #if defined(HAVE_TTMATH)
     typedef ttmath::Big<1,4> tt;
- //test_all<bg::model::point<tt, 2, bg::cs::spherical<bg::degree> > >();
+ //test_all<bg::model::point<tt, 2, bg::cs::geographic<bg::degree> >, geographic_policy>();
 #endif
 
     return 0;

Modified: branches/release/libs/geometry/test/strategies/haversine.cpp
==============================================================================
--- branches/release/libs/geometry/test/strategies/haversine.cpp (original)
+++ branches/release/libs/geometry/test/strategies/haversine.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -34,7 +34,7 @@
 double const average_earth_radius = 6372795.0;
 
 
-template <typename Point>
+template <typename Point, typename LatitudePolicy>
 struct test_distance
 {
     typedef bg::strategy::distance::haversine
@@ -60,15 +60,15 @@
         haversine_type strategy(radius);
 
         Point p1, p2;
- bg::assign_values(p1, lon1, lat1);
- bg::assign_values(p2, lon2, lat2);
+ bg::assign_values(p1, lon1, LatitudePolicy::apply(lat1));
+ bg::assign_values(p2, lon2, LatitudePolicy::apply(lat2));
         return_type d = strategy.apply(p1, p2);
 
         BOOST_CHECK_CLOSE(d, expected, tolerance);
     }
 };
 
-template <typename Point>
+template <typename Point, typename LatitudePolicy>
 void test_all()
 {
     // earth to unit-sphere -> divide by earth circumference, then it is from 0-1,
@@ -77,19 +77,19 @@
 
     // ~ Amsterdam/Paris, 467 kilometers
     double const a_p = 467.2704 * 1000.0;
- test_distance<Point>::test(4, 52, 2, 48, average_earth_radius, a_p, 1.0);
- test_distance<Point>::test(2, 48, 4, 52, average_earth_radius, a_p, 1.0);
- test_distance<Point>::test(4, 52, 2, 48, 1.0, a_p * e2u, 0.001);
+ test_distance<Point, LatitudePolicy>::test(4, 52, 2, 48, average_earth_radius, a_p, 1.0);
+ test_distance<Point, LatitudePolicy>::test(2, 48, 4, 52, average_earth_radius, a_p, 1.0);
+ test_distance<Point, LatitudePolicy>::test(4, 52, 2, 48, 1.0, a_p * e2u, 0.001);
 
     // ~ Amsterdam/Barcelona
     double const a_b = 1232.9065 * 1000.0;
- test_distance<Point>::test(4, 52, 2, 41, average_earth_radius, a_b, 1.0);
- test_distance<Point>::test(2, 41, 4, 52, average_earth_radius, a_b, 1.0);
- test_distance<Point>::test(4, 52, 2, 41, 1.0, a_b * e2u, 0.001);
+ test_distance<Point, LatitudePolicy>::test(4, 52, 2, 41, average_earth_radius, a_b, 1.0);
+ test_distance<Point, LatitudePolicy>::test(2, 41, 4, 52, average_earth_radius, a_b, 1.0);
+ test_distance<Point, LatitudePolicy>::test(4, 52, 2, 41, 1.0, a_b * e2u, 0.001);
 }
 
 
-template <typename P1, typename P2, typename CalculationType>
+template <typename P1, typename P2, typename CalculationType, typename LatitudePolicy>
 void test_services()
 {
     namespace bgsd = bg::strategy::distance;
@@ -244,9 +244,12 @@
 
 int test_main(int, char* [])
 {
- test_all<bg::model::point<int, 2, bg::cs::spherical<bg::degree> > >();
- test_all<bg::model::point<float, 2, bg::cs::spherical<bg::degree> > >();
- test_all<bg::model::point<double, 2, bg::cs::spherical<bg::degree> > >();
+ test_all<bg::model::point<int, 2, bg::cs::spherical_equatorial<bg::degree> >, geographic_policy>();
+ test_all<bg::model::point<float, 2, bg::cs::spherical_equatorial<bg::degree> >, geographic_policy>();
+ test_all<bg::model::point<double, 2, bg::cs::spherical_equatorial<bg::degree> >, geographic_policy>();
+
+ // NYI: haversine for mathematical spherical coordinate systems
+ // test_all<bg::model::point<double, 2, bg::cs::spherical<bg::degree> >, mathematical_policy>();
 
     //double t1 = time_sqrt(20000);
     //double t2 = time_normal(20000);
@@ -255,15 +258,16 @@
 
 #if defined(HAVE_TTMATH)
     typedef ttmath::Big<1,4> tt;
- test_all<bg::model::point<tt, 2, bg::cs::spherical<bg::degree> > >();
+ test_all<bg::model::point<tt, 2, bg::cs::spherical_equatorial<bg::degree> >, geographic_policy>();
 #endif
 
 
     test_services
         <
- bg::model::point<float, 2, bg::cs::spherical<bg::degree> >,
- bg::model::point<double, 2, bg::cs::spherical<bg::degree> >,
- double
+ bg::model::point<double, 2, bg::cs::spherical_equatorial<bg::degree> >,
+ bg::model::point<double, 2, bg::cs::spherical_equatorial<bg::degree> >,
+ double,
+ geographic_policy
>();
 
     return 0;

Modified: branches/release/libs/geometry/test/strategies/segment_intersection.cpp
==============================================================================
--- branches/release/libs/geometry/test/strategies/segment_intersection.cpp (original)
+++ branches/release/libs/geometry/test/strategies/segment_intersection.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -91,7 +91,7 @@
 #endif
 
     typedef typename bg::coordinate_type<P>::type coordinate_type;
- typedef segment<const P> segment_type;
+ typedef bg::model::referring_segment<const P> segment_type;
 
     P p1, p2, p3, p4;
     bg::assign_values(p1, x1, y1);

Modified: branches/release/libs/geometry/test/strategies/segment_intersection_collinear.cpp
==============================================================================
--- branches/release/libs/geometry/test/strategies/segment_intersection_collinear.cpp (original)
+++ branches/release/libs/geometry/test/strategies/segment_intersection_collinear.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -64,7 +64,7 @@
 //#endif
 
     typedef typename bg::coordinate_type<P>::type coordinate_type;
- typedef bg::segment<const P> segment_type;
+ typedef bg::model::referring_segment<const P> segment_type;
 
     P p1, p2, p3, p4;
     bg::assign_values(p1, x1, y1);

Deleted: branches/release/libs/geometry/test/strategies/side_by_cross_track.cpp
==============================================================================
--- branches/release/libs/geometry/test/strategies/side_by_cross_track.cpp 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
+++ (empty file)
@@ -1,54 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Unit Test
-
-// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
-
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-
-#include <geometry_test_common.hpp>
-
-#include <boost/geometry/algorithms/assign.hpp>
-
-#include <boost/geometry/strategies/spherical/side_by_cross_track.hpp>
-
-#include <boost/geometry/core/cs.hpp>
-
-#include <boost/geometry/geometries/point.hpp>
-#include <boost/geometry/geometries/segment.hpp>
-
-
-template <typename Point>
-void test_side(double lon1, double lat1,
- double lon2, double lat2,
- double lon3, double lat3,
- int expected)
-{
- typedef bg::strategy::side::side_by_cross_track<double> strategy;
-
- Point p1, p2, p3;
- bg::assign_values(p1, lon1, lat1);
- bg::assign_values(p2, lon2, lat2);
- bg::assign_values(p3, lon3, lat3);
- int s = strategy::apply(p1, p2, p3);
-
-}
-
-template <typename Point>
-void test_all()
-{
- test_side<Point>(2.0, 48.0, 4.0, 52.0, 2.0, 41.0, 1);
- test_side<Point>(2.0, 48.0, 2.0, 41.0, 4.0, 52.0, -1);
-}
-
-int test_main(int, char* [])
-{
- test_all<bg::model::point<double, 2, bg::cs::spherical<bg::degree> > >();
-
- double a = 0;
- double b = sin(a);
-
- return 0;
-}

Deleted: branches/release/libs/geometry/test/strategies/side_by_cross_track.vcproj
==============================================================================
--- branches/release/libs/geometry/test/strategies/side_by_cross_track.vcproj 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
+++ (empty file)
@@ -1,174 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="side_by_cross_track"
- ProjectGUID="{ADBE38D8-1828-48A2-BBA1-81F50B53C67C}"
- RootNamespace="side_by_cross_track"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\side_by_cross_track"
- ConfigurationType="1"
- InheritedPropertySheets="..\boost.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="../../../..;.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- ExceptionHandling="2"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- DebugInformationFormat="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)\side_by_cross_track"
- ConfigurationType="1"
- InheritedPropertySheets="..\boost.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../../..;.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- ExceptionHandling="2"
- UsePrecompiledHeader="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\side_by_cross_track.cpp"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>

Modified: branches/release/libs/geometry/test/strategies/strategies_tests.sln
==============================================================================
--- branches/release/libs/geometry/test/strategies/strategies_tests.sln (original)
+++ branches/release/libs/geometry/test/strategies/strategies_tests.sln 2011-06-05 10:43:07 EDT (Sun, 05 Jun 2011)
@@ -14,7 +14,7 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment_intersection_collinear", "segment_intersection_collinear.vcproj", "{2D0CB6D3-6ABC-4119-A235-66E6065A279E}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "side_by_cross_track", "side_by_cross_track.vcproj", "{ADBE38D8-1828-48A2-BBA1-81F50B53C67C}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spherical_side", "spherical_side.vcproj", "{ADBE38D8-1828-48A2-BBA1-81F50B53C67C}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "within", "within.vcproj", "{AB13D2AC-FD34-4DE4-BD8E-4D463050E5DD}"
 EndProject


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk