diff --git a/test/algorithms/covered_by/covered_by_sph_geo.cpp b/test/algorithms/covered_by/covered_by_sph_geo.cpp index c3a1cd766..ce06bb3f9 100644 --- a/test/algorithms/covered_by/covered_by_sph_geo.cpp +++ b/test/algorithms/covered_by/covered_by_sph_geo.cpp @@ -56,6 +56,29 @@ void test_multi_point_box() test_geometry("MULTIPOINT(1 1,3 3)", "BOX(0 0, 2 2)", false); } +template +void test_areal_box() +{ + typedef bg::model::box

box_t; + typedef bg::model::ring

ring_t; + typedef bg::model::polygon

poly_t; + typedef bg::model::multi_polygon mpoly_t; + + test_geometry("POLYGON((0 0,0 3,3 3,3 0,0 0))", "BOX(0 0,4 4)", true); + test_geometry("POLYGON((0 0,0 3,3 3,5 0,0 0))", "BOX(0 0,4 4)", false); + test_geometry("POLYGON((0 0,0 3,3 3,3 0,0 0))", "BOX(0 0,4 4)", true); + test_geometry("POLYGON((0 0,0 3,3 3,5 0,0 0))", "BOX(0 0,4 4)", false); + // the following is true for cartesian but not for spherical or geographic + // because in non-cartesian boxes the horizontal edges are not geodesics + test_geometry("MULTIPOLYGON(((0 0,0 3,3 3,3 0,0 0)),((4 4,4 7,7 7,4 7,4 4)))", + "BOX(0 0,7 7)", false); + test_geometry("MULTIPOLYGON(((0 0,0 3,3 3,3 0,0 0)),((4 4,4 6.5,6.5 6.5,4 6.5,4 4)))", + "BOX(0 0,7 7)", true); + test_geometry("MULTIPOLYGON(((0 0,0 3,3 3,5 0,0 0)),((4 4,4 7,7 7,4 7,4 4)))", + "BOX(0 0,4 4)", false); + +} + template void test_box_box() { @@ -126,6 +149,7 @@ void test_cs() { test_point_box

(); test_multi_point_box

(); + test_areal_box

(); test_box_box

(); test_point_polygon

(); }