[strategies] [tests] Activating some tests for pt-seg distance with thomas formula

This commit is contained in:
Vissarion Fysikopoulos
2018-04-04 11:34:35 +03:00
parent 93bd8501b0
commit aee17ee094
2 changed files with 39 additions and 35 deletions

View File

@@ -338,6 +338,32 @@ void test_distance_point_segment(Strategy_pp const& strategy_pp,
"SEGMENT(0 0,180 0)",
0,
strategy_ps, true, true);
tester::apply("p-s-20",
"POINT(80 89)",
"SEGMENT(0 0,180 0)",
pp_distance("POINT(80 89)", "POINT(0 89.82633489283377)", strategy_pp),
strategy_ps, true, true);
tester::apply("p-s-21",
"POINT(80 89)",
"SEGMENT(0 -1,180 1)",
pp_distance("POINT(80 89)", "POINT(0 89.82633489283377)", strategy_pp),
strategy_ps, true, true);
// meridian special case
tester::apply("p-s-mer2",
"POINT(2.5 3)",
"SEGMENT(2 2,2 4)",
pp_distance("POINT(2.5 3)", "POINT(2 3.000114792872075)", strategy_pp),
strategy_ps, true, true);
tester::apply("p-s-mer4",
"POINT(1 80)",
"SEGMENT(0 0,0 90)",
pp_distance("POINT(1 80)", "POINT(0 80.00149225834545)", strategy_pp),
strategy_ps, true, true);
}
template <typename Strategy_pp, typename Strategy_ps>
@@ -352,37 +378,13 @@ void test_distance_point_segment_no_thomas(Strategy_pp const& strategy_pp,
typedef test_distance_of_geometries<point_type, segment_type> tester;
// thomas strategy is failing for those test cases
// this is because of inaccurate results for points close to poles
// meridian special case
tester::apply("p-s-mer2",
"POINT(2.5 3)",
"SEGMENT(2 2,2 4)",
pp_distance("POINT(2.5 3)", "POINT(2 3.000114792872075)", strategy_pp),
strategy_ps, true, true);
tester::apply("p-s-mer4",
"POINT(1 80)",
"SEGMENT(0 0,0 90)",
pp_distance("POINT(1 80)", "POINT(0 80.00149225834545)", strategy_pp),
strategy_ps, true, true);
// Half meridian segment passing through pole
tester::apply("p-s-19",
"POINT(90 89)",
"SEGMENT(0 0,180 0)",
pp_distance("POINT(90 89)", "POINT(90 90)", strategy_pp),
strategy_ps, true, true);
tester::apply("p-s-20",
"POINT(80 89)",
"SEGMENT(0 0,180 0)",
pp_distance("POINT(80 89)", "POINT(0 89.82633489283377)", strategy_pp),
strategy_ps, true, true);
tester::apply("p-s-21",
"POINT(80 89)",
"SEGMENT(0 -1,180 1)",
pp_distance("POINT(80 89)", "POINT(0 89.82633489283377)", strategy_pp),
strategy_ps, true, true);
}
//===========================================================================
@@ -677,9 +679,8 @@ BOOST_AUTO_TEST_CASE( test_all_point_segment )
test_distance_point_segment(thomas_pp(), thomas_strategy());
test_distance_point_segment(andoyer_pp(), andoyer_strategy());
test_distance_point_segment_no_thomas(vincenty_pp(), vincenty_strategy());
///test_distance_point_segment_no_thomas(thomas_pp(), thomas_strategy());
//test_distance_point_segment_no_thomas(thomas_pp(), thomas_strategy());
test_distance_point_segment_no_thomas(andoyer_pp(), andoyer_strategy());
test_distance_point_linestring(vincenty_pp(), vincenty_strategy());