diff --git a/include/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp b/include/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp index e1af51a32..f4ed7a634 100644 --- a/include/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp +++ b/include/boost/geometry/strategies/agnostic/point_in_poly_winding.hpp @@ -167,7 +167,7 @@ struct winding_side_between template <> struct winding_side_between { - typedef typename strategy::side::services::default_strategy + typedef strategy::side::services::default_strategy < cartesian_tag >::type strategy_side_type; diff --git a/test/strategies/within.cpp b/test/strategies/within.cpp index 65d1a4d35..7742182b7 100644 --- a/test/strategies/within.cpp +++ b/test/strategies/within.cpp @@ -202,7 +202,7 @@ void test_all() void test_spherical() { - typedef bg::model::point point; + typedef bg::model::point > point; typedef bg::model::polygon polygon; // Ticket #9354 @@ -241,6 +241,74 @@ void test_spherical() point(0, 10.001)) == -1 // right side /*false*/); + test_geometry_default( + "sph3N", + "POINT(0 10)", + "POLYGON((-10 10, 10 10, 10 -10, -10 -10, -10 10))", + bg::strategy::side::spherical_side_formula<>::apply( + point(-10, 10), + point(10, 10), + point(0, 10.001)) == -1 // right side + /*true*/); + test_geometry_default( + "sph3S", + "POINT(0 -10)", + "POLYGON((-10 10, 10 10, 10 -10, -10 -10, -10 10))", + bg::strategy::side::spherical_side_formula<>::apply( + point(10, -10), + point(-10, -10), + point(0, -10.001)) == -1 // right side + /*true*/); + + test_geometry_default( + "sphEq1", + "POINT(179 10)", + "POLYGON((170 0, -170 0, -170 10, 170 10, 170 0))", + true, + false); + test_geometry_default( + "sphEq2", + "POINT(179 10)", + "POLYGON((170 10, -170 10, -170 20, 170 20, 170 10))", + true, + false); + test_geometry_default( + "sphEq3", + "POINT(-179 10)", + "POLYGON((170 0, -170 0, -170 10, 170 10, 170 0))", + true, + false); + test_geometry_default( + "sphEq4", + "POINT(-179 10)", + "POLYGON((170 10, -170 10, -170 20, 170 20, 170 10))", + true, + false); + + test_geometry_default( + "sphEq5", + "POINT(169 10)", + "POLYGON((170 10, -170 10, -170 20, 170 20, 170 10))", + false, + false); + test_geometry_default( + "sphEq6", + "POINT(-169 10)", + "POLYGON((170 10, -170 10, -170 20, 170 20, 170 10))", + false, + false); + test_geometry_default( + "sphEq7", + "POINT(169 10)", + "POLYGON((170 0, -170 0, -170 10, 170 10, 170 0))", + false, + false); + test_geometry_default( + "sphEq8", + "POINT(-169 10)", + "POLYGON((170 0, -170 0, -170 10, 170 10, 170 0))", + false, + false); } int test_main(int, char* [])