diff --git a/test/algorithms/relational_operations/crosses/crosses.cpp b/test/algorithms/relational_operations/crosses/crosses.cpp index 5ab205e4b..21ed78d12 100644 --- a/test/algorithms/relational_operations/crosses/crosses.cpp +++ b/test/algorithms/relational_operations/crosses/crosses.cpp @@ -18,10 +18,14 @@ void test_pl() { typedef bg::model::multi_point

mpt; typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; test_geometry("MULTIPOINT(1 0,1 1)", "LINESTRING(0 0,1 0,3 3)", true); test_geometry("MULTIPOINT(0 0,1 1)", "LINESTRING(0 0,1 0,3 3)", false); test_geometry("MULTIPOINT(0 0,1 1)", "LINESTRING(0 0,1 1,3 3)", false); + + test_geometry("MULTIPOINT(0 0,3 0)", "MULTILINESTRING((0 0,0 1,1 1),(1 1,1 0,0 0))", true); + test_geometry("MULTIPOINT(0 0,1 1)", "MULTILINESTRING((0 0,0 1,1 1),(1 1,1 0,0 0))", false); } template @@ -34,6 +38,9 @@ void test_pa() test_geometry("MULTIPOINT(1 1,6 6)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", true); test_geometry("MULTIPOINT(0 0,6 6)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); test_geometry("MULTIPOINT(0 0,1 1)", "POLYGON((0 0,0 5,5 5,5 0,0 0))", false); + + test_geometry("MULTIPOINT(0 0,1 1)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 9,9 9,9 5,5 5)))", false); + test_geometry("MULTIPOINT(1 1,1 6)", "MULTIPOLYGON(((0 0,0 5,5 5,5 0,0 0)),((5 5,5 9,9 9,9 5,5 5)))", true); } template diff --git a/test/algorithms/relational_operations/relate/relate_pointlike_geometry.cpp b/test/algorithms/relational_operations/relate/relate_pointlike_geometry.cpp index 4868c3fe7..41926fd26 100644 --- a/test/algorithms/relational_operations/relate/relate_pointlike_geometry.cpp +++ b/test/algorithms/relational_operations/relate/relate_pointlike_geometry.cpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2013, 2014, 2015. -// Modifications copyright (c) 2013-2015 Oracle and/or its affiliates. +// This file was modified by Oracle on 2013, 2014, 2015, 2017. +// Modifications copyright (c) 2013-2017 Oracle and/or its affiliates. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -132,6 +132,92 @@ void test_multipoint_linestring() test_geometry("MULTIPOINT(0 0, 1 1)", "LINESTRING(0 0, 2 2, 3 2, 0 0)", "0FFFFF1F2"); test_geometry("MULTIPOINT(0 0, 3 3)", "LINESTRING(0 0, 2 2, 3 2, 0 0)", "0F0FFF1F2"); + + test_geometry("MULTIPOINT(0 0)", "LINESTRING(0 0, 2 2)", "F0FFFF102"); + test_geometry("MULTIPOINT(2 2)", "LINESTRING(0 0, 2 2)", "F0FFFF102"); + test_geometry("MULTIPOINT(0 0, 2 2)", "LINESTRING(0 0, 2 2)", "F0FFFF1F2"); + test_geometry("MULTIPOINT(0 0, 1 1, 0 1, 2 2)", "LINESTRING(0 0, 2 2)", "000FFF1F2"); +} + +template +void test_multipoint_multilinestring() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::linestring

ls; + typedef bg::model::multi_linestring mls; + + test_geometry("MULTIPOINT(0 0)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "F0FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "00FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "000FFF102"); + test_geometry("MULTIPOINT(0 0, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "F00FFF102"); + test_geometry("MULTIPOINT(1 1, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2))", "0F0FFF102"); + + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2, 0 0))", "0FFFFF1F2"); + test_geometry("MULTIPOINT(0 0, 3 3)", "MULTILINESTRING((0 0, 2 2),(2 2, 3 2, 0 0))", "0F0FFF1F2"); + + test_geometry("MULTIPOINT(0 0,1 1)", "MULTILINESTRING((0 0,0 1,1 1),(1 1,1 0,0 0))", "0FFFFF1F2"); + + test_geometry("MULTIPOINT(0 0)", "MULTILINESTRING((0 0,1 1),(1 1,2 2))", "F0FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTILINESTRING((0 0,1 1),(1 1,2 2))", "00FFFF102"); + test_geometry("MULTIPOINT(0 0, 1 1, 2 2)", "MULTILINESTRING((0 0,1 1),(1 1,2 2))", "00FFFF1F2"); + test_geometry("MULTIPOINT(0 0, 2 2)", "MULTILINESTRING((0 0,1 1),(1 1,2 2))", "F0FFFF1F2"); +} + +template +void test_point_ring_polygon() +{ + typedef bg::model::ring

ring; + typedef bg::model::polygon

poly; + + test_geometry("POINT(0 0)", "POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))", "F0FFFF212"); + + test_geometry("POINT(1 1)", "POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))", "0FFFFF212"); + test_geometry("POINT(1 3)", "POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))", "FF0FFF212"); +} + +template +void test_point_multipolygon() +{ + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("POINT(0 0)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "F0FFFF212"); + test_geometry("POINT(1 1)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "0FFFFF212"); + test_geometry("POINT(5 5)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "F0FFFF212"); + test_geometry("POINT(6 6)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "0FFFFF212"); + test_geometry("POINT(1 6)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "FF0FFF212"); +} + +template +void test_multipoint_ring_polygon() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::ring

ring; + typedef bg::model::polygon

poly; + + test_geometry("MULTIPOINT(0 0)", "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0))", "F0FFFF212"); + test_geometry("MULTIPOINT(0 0, 1 1)", "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0))", "00FFFF212"); + test_geometry("MULTIPOINT(0 0, 1 1, 4 4)", "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0))", "000FFF212"); + test_geometry("MULTIPOINT(1 1, 4 4)", "POLYGON((0 0, 0 3, 3 3, 3 0, 0 0))", "0F0FFF212"); + + test_geometry("MULTIPOINT(2 2)", "POLYGON((0 0, 0 4, 4 4, 4 0, 0 0),(1 1, 3 1, 3 3, 1 3, 1 1))", "FF0FFF212"); + test_geometry("MULTIPOINT(0 0, 1 1)", "POLYGON((0 0, 0 4, 4 4, 4 0, 0 0),(1 1, 3 1, 3 3, 1 3, 1 1))", "F0FFFF212"); + test_geometry("MULTIPOINT(0 0, 1 1, 2 2)", "POLYGON((0 0, 0 4, 4 4, 4 0, 0 0),(1 1, 3 1, 3 3, 1 3, 1 1))", "F00FFF212"); + test_geometry("MULTIPOINT(2 2, 4 4)", "POLYGON((0 0, 0 5, 5 5, 5 0, 0 0),(1 1, 3 1, 3 3, 1 3, 1 1))", "0F0FFF212"); +} + +template +void test_multipoint_multipolygon() +{ + typedef bg::model::multi_point

mpt; + typedef bg::model::polygon

poly; + typedef bg::model::multi_polygon mpoly; + + test_geometry("MULTIPOINT(0 0)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "F0FFFF212"); + test_geometry("MULTIPOINT(0 0, 1 1)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "00FFFF212"); + test_geometry("MULTIPOINT(1 1, 5 5)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "00FFFF212"); + test_geometry("MULTIPOINT(1 6, 6 6)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "0F0FFF212"); + test_geometry("MULTIPOINT(0 0, 1 6)", "MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)),((5 5, 5 9, 9 9, 9 5, 5 5)))", "F00FFF212"); } template @@ -140,9 +226,16 @@ void test_all() test_point_point

(); test_point_multipoint

(); test_multipoint_multipoint

(); + test_point_linestring

(); test_point_multilinestring

(); test_multipoint_linestring

(); + test_multipoint_multilinestring

(); + + test_point_ring_polygon

(); + test_point_multipolygon

(); + test_multipoint_ring_polygon

(); + test_multipoint_multipolygon

(); } int test_main( int , char* [] )