From 31513f344078706f29a643c9a3888d9d833d3a65 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Fri, 12 Sep 2014 14:53:52 +0800 Subject: [PATCH 1/2] [test][within] Add tests for spherical point in poly. --- test/strategies/within.cpp | 70 +++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) 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* []) From 585d59fce4f1bab90eb623eae876115fc97c09a5 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Fri, 12 Sep 2014 14:57:22 +0800 Subject: [PATCH 2/2] [within] Fix winding strategy MSVC compilation error. Remove the typename keyword from a type definition without dependent type. --- .../geometry/strategies/agnostic/point_in_poly_winding.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;