[test][algorithms][distance] add test case between linestring and open multipolygon

where the distance is realized between the linestring and an implicit segment of the
multipolygon
This commit is contained in:
Menelaos Karavelas 2014-10-01 09:35:46 +03:00
parent 439f570d02
commit 03d505061a

View File

@ -28,6 +28,7 @@ typedef bg::model::multi_linestring<linestring_type> multi_linestring_type;
typedef bg::model::polygon<point_type, false> polygon_type;
typedef bg::model::polygon<point_type, false, false> open_polygon_type;
typedef bg::model::multi_polygon<polygon_type> multi_polygon_type;
typedef bg::model::multi_polygon<open_polygon_type> open_multipolygon_type;
typedef bg::model::ring<point_type, false> ring_type;
typedef bg::model::box<point_type> box_type;
typedef bg::model::box<int_point_type> int_box_type;
@ -212,6 +213,29 @@ void test_distance_linestring_multipolygon(Strategy const& strategy)
//===========================================================================
template <typename Strategy>
void test_distance_linestring_open_multipolygon(Strategy const& strategy)
{
#ifdef BOOST_GEOMETRY_TEST_DEBUG
std::cout << std::endl;
std::cout << "linestring/open multipolygon distance tests" << std::endl;
#endif
typedef test_distance_of_geometries
<
linestring_type, open_multipolygon_type
> tester;
tester::apply("linestring(-5 1,-2 1)",
"multipolygon(((0 0,10 0,10 10,0 10)))",
2, 4, strategy, true);
tester::apply("linestring(-5 1,-3 1)",
"multipolygon(((20 20,21 20,21 21,20 21)),((0 0,10 0,10 10,0 10)))",
3, 9, strategy, true);
}
//===========================================================================
template <typename Strategy>
void test_distance_multilinestring_multipolygon(Strategy const& strategy)
{
@ -883,6 +907,7 @@ BOOST_AUTO_TEST_CASE( test_all_segment_multipolygon )
BOOST_AUTO_TEST_CASE( test_all_linestring_multipolygon )
{
test_distance_linestring_multipolygon(point_segment_strategy());
test_distance_linestring_open_multipolygon(point_segment_strategy());
}
BOOST_AUTO_TEST_CASE( test_all_multilinestring_multipolygon )