[test][relops] Add spherical Pt/Areal test cases.

This commit is contained in:
Adam Wulkiewicz 2016-06-06 17:21:57 +02:00
parent 28e716e9e1
commit a2eeba8f0e
4 changed files with 104 additions and 0 deletions

View File

@ -216,6 +216,30 @@ void test_multi_linestring_multi_linestring()
false);
}
template <typename P>
void test_point_polygon()
{
typedef bg::model::polygon<P> poly;
// https://svn.boost.org/trac/boost/ticket/9162
test_geometry<P, poly>("POINT(0 90)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
true);
test_geometry<P, poly>("POINT(-120 21)",
"POLYGON((30 0,30 30,90 30, 90 0, 30 0))",
false);
// extended
test_geometry<P, poly>("POINT(0 -90)",
"POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))",
true);
test_geometry<P, poly>("POINT(0 89)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
true);
test_geometry<P, poly>("POINT(-180 89)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
true);
}
template <typename P>
void test_all()
@ -232,6 +256,8 @@ void test_all()
test_linestring_linestring<P>();
test_linestring_multi_linestring<P>();
test_multi_linestring_multi_linestring<P>();
test_point_polygon<P>();
}

View File

@ -214,6 +214,30 @@ void test_multi_linestring_multi_linestring()
false);
}
template <typename P>
void test_point_polygon()
{
typedef bg::model::polygon<P> poly;
// https://svn.boost.org/trac/boost/ticket/9162
test_geometry<P, poly>("POINT(0 90)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
false);
test_geometry<P, poly>("POINT(-120 21)",
"POLYGON((30 0,30 30,90 30, 90 0, 30 0))",
true);
// extended
test_geometry<P, poly>("POINT(0 -90)",
"POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))",
false);
test_geometry<P, poly>("POINT(0 89)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
false);
test_geometry<P, poly>("POINT(-180 89)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
false);
}
template <typename P>
void test_all()
@ -230,6 +254,8 @@ void test_all()
test_linestring_linestring<P>();
test_linestring_multi_linestring<P>();
test_multi_linestring_multi_linestring<P>();
test_point_polygon<P>();
}

View File

@ -212,6 +212,30 @@ void test_multi_linestring_multi_linestring()
true);
}
template <typename P>
void test_point_polygon()
{
typedef bg::model::polygon<P> poly;
// https://svn.boost.org/trac/boost/ticket/9162
test_geometry<P, poly>("POINT(0 90)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
true);
test_geometry<P, poly>("POINT(-120 21)",
"POLYGON((30 0,30 30,90 30, 90 0, 30 0))",
false);
// extended
test_geometry<P, poly>("POINT(0 -90)",
"POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))",
true);
test_geometry<P, poly>("POINT(0 89)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
true);
test_geometry<P, poly>("POINT(-180 89)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
true);
}
template <typename P>
void test_all()
@ -228,6 +252,8 @@ void test_all()
test_linestring_linestring<P>();
test_linestring_multi_linestring<P>();
test_multi_linestring_multi_linestring<P>();
test_point_polygon<P>();
}

View File

@ -216,6 +216,30 @@ void test_multi_linestring_multi_linestring()
false);
}
template <typename P>
void test_point_polygon()
{
typedef bg::model::polygon<P> poly;
// https://svn.boost.org/trac/boost/ticket/9162
test_geometry<P, poly>("POINT(0 90)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
true);
test_geometry<P, poly>("POINT(-120 21)",
"POLYGON((30 0,30 30,90 30, 90 0, 30 0))",
false);
// extended
test_geometry<P, poly>("POINT(0 -90)",
"POLYGON((0 -80,90 -80, -180 -80, -90 -80, 0 -80))",
true);
test_geometry<P, poly>("POINT(0 89)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
true);
test_geometry<P, poly>("POINT(-180 89)",
"POLYGON((0 80,-90 80, -180 80, 90 80, 0 80))",
true);
}
template <typename P>
void test_all()
@ -232,6 +256,8 @@ void test_all()
test_linestring_linestring<P>();
test_linestring_multi_linestring<P>();
test_multi_linestring_multi_linestring<P>();
test_point_polygon<P>();
}