diff --git a/test/algorithms/relate.cpp b/test/algorithms/relate.cpp index 2414191d7..fbe309f2e 100644 --- a/test/algorithms/relate.cpp +++ b/test/algorithms/relate.cpp @@ -872,6 +872,46 @@ void polygon_polygon() BOOST_CHECK(bgdr::relate(p1, p3, bgdr::mask9("T*****FF*"))); // contains() BOOST_CHECK(bgdr::relate(p2, p3, bgdr::mask9("FF*FF****"))); // disjoint() } + + // CCW + { + typedef bg::model::polygon poly; + // within non-simple hole / simple + test_geometry("POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,5 6,10 5,5 5))", + "POLYGON((0 0,10 0,10 5,5 5,0 0))", + "212F11FF2"); + } + // OPEN + { + typedef bg::model::polygon poly; + // within non-simple hole / simple + test_geometry("POLYGON((0 0,0 10,10 10,10 0),(5 5,10 5,5 6))", + "POLYGON((0 0,5 5,10 5,10 0))", + "212F11FF2"); + } + // CCW, OPEN + { + typedef bg::model::polygon poly; + // within non-simple hole / simple + test_geometry("POLYGON((0 0,10 0,10 10,0 10),(5 5,5 6,10 5))", + "POLYGON((0 0,10 0,10 5,5 5))", + "212F11FF2"); + } +} + +template +void polygon_multi_polygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::ring

ring; + typedef bg::model::multi_polygon mpoly; + + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "MULTIPOLYGON(((5 5,5 10,6 10,6 5,5 5)),((0 20,0 30,10 30,10 20,0 20)))", + "212F11212"); + test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", + "MULTIPOLYGON(((5 5,5 10,6 10,6 5,5 5)),((0 20,0 30,10 30,10 20,0 20)))", + "212F11212"); } template @@ -910,6 +950,7 @@ void test_all() test_linestring_multi_polygon

(); test_multi_linestring_multi_polygon

(); polygon_polygon

(); + polygon_multi_polygon

(); multi_polygon_multi_polygon

(); }