diff --git a/test/algorithms/relational_operations/covered_by/covered_by_sph.cpp b/test/algorithms/relational_operations/covered_by/covered_by_sph.cpp index cf3d0906e..710742fd1 100644 --- a/test/algorithms/relational_operations/covered_by/covered_by_sph.cpp +++ b/test/algorithms/relational_operations/covered_by/covered_by_sph.cpp @@ -216,6 +216,30 @@ void test_multi_linestring_multi_linestring() false); } +template +void test_point_polygon() +{ + typedef bg::model::polygon

poly; + + // https://svn.boost.org/trac/boost/ticket/9162 + test_geometry("POINT(0 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-120 21)", + "POLYGON((30 0,30 30,90 30, 90 0, 30 0))", + false); + // extended + test_geometry("POINT(0 -90)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + true); + test_geometry("POINT(0 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-180 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); +} + template void test_all() @@ -232,6 +256,8 @@ void test_all() test_linestring_linestring

(); test_linestring_multi_linestring

(); test_multi_linestring_multi_linestring

(); + + test_point_polygon

(); } diff --git a/test/algorithms/relational_operations/disjoint/disjoint_sph.cpp b/test/algorithms/relational_operations/disjoint/disjoint_sph.cpp index 3d9ecd29c..cee4c8d16 100644 --- a/test/algorithms/relational_operations/disjoint/disjoint_sph.cpp +++ b/test/algorithms/relational_operations/disjoint/disjoint_sph.cpp @@ -214,6 +214,30 @@ void test_multi_linestring_multi_linestring() false); } +template +void test_point_polygon() +{ + typedef bg::model::polygon

poly; + + // https://svn.boost.org/trac/boost/ticket/9162 + test_geometry("POINT(0 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + false); + test_geometry("POINT(-120 21)", + "POLYGON((30 0,30 30,90 30, 90 0, 30 0))", + true); + // extended + test_geometry("POINT(0 -90)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + false); + test_geometry("POINT(0 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + false); + test_geometry("POINT(-180 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + false); +} + template void test_all() @@ -230,6 +254,8 @@ void test_all() test_linestring_linestring

(); test_linestring_multi_linestring

(); test_multi_linestring_multi_linestring

(); + + test_point_polygon

(); } diff --git a/test/algorithms/relational_operations/intersects/intersects_sph.cpp b/test/algorithms/relational_operations/intersects/intersects_sph.cpp index 4b935bff4..0981c0af4 100644 --- a/test/algorithms/relational_operations/intersects/intersects_sph.cpp +++ b/test/algorithms/relational_operations/intersects/intersects_sph.cpp @@ -212,6 +212,30 @@ void test_multi_linestring_multi_linestring() true); } +template +void test_point_polygon() +{ + typedef bg::model::polygon

poly; + + // https://svn.boost.org/trac/boost/ticket/9162 + test_geometry("POINT(0 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-120 21)", + "POLYGON((30 0,30 30,90 30, 90 0, 30 0))", + false); + // extended + test_geometry("POINT(0 -90)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + true); + test_geometry("POINT(0 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-180 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); +} + template void test_all() @@ -228,6 +252,8 @@ void test_all() test_linestring_linestring

(); test_linestring_multi_linestring

(); test_multi_linestring_multi_linestring

(); + + test_point_polygon

(); } diff --git a/test/algorithms/relational_operations/within/within_sph.cpp b/test/algorithms/relational_operations/within/within_sph.cpp index 22761af98..455a8db49 100644 --- a/test/algorithms/relational_operations/within/within_sph.cpp +++ b/test/algorithms/relational_operations/within/within_sph.cpp @@ -216,6 +216,30 @@ void test_multi_linestring_multi_linestring() false); } +template +void test_point_polygon() +{ + typedef bg::model::polygon

poly; + + // https://svn.boost.org/trac/boost/ticket/9162 + test_geometry("POINT(0 90)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-120 21)", + "POLYGON((30 0,30 30,90 30, 90 0, 30 0))", + false); + // extended + test_geometry("POINT(0 -90)", + "POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))", + true); + test_geometry("POINT(0 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); + test_geometry("POINT(-180 89)", + "POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))", + true); +} + template void test_all() @@ -232,6 +256,8 @@ void test_all() test_linestring_linestring

(); test_linestring_multi_linestring

(); test_multi_linestring_multi_linestring

(); + + test_point_polygon

(); }