mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-12 05:51:47 +00:00
[test][relops] Add spherical Pt/Areal test cases.
This commit is contained in:
parent
28e716e9e1
commit
a2eeba8f0e
@ -216,6 +216,30 @@ void test_multi_linestring_multi_linestring()
|
|||||||
false);
|
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>
|
template <typename P>
|
||||||
void test_all()
|
void test_all()
|
||||||
@ -232,6 +256,8 @@ void test_all()
|
|||||||
test_linestring_linestring<P>();
|
test_linestring_linestring<P>();
|
||||||
test_linestring_multi_linestring<P>();
|
test_linestring_multi_linestring<P>();
|
||||||
test_multi_linestring_multi_linestring<P>();
|
test_multi_linestring_multi_linestring<P>();
|
||||||
|
|
||||||
|
test_point_polygon<P>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -214,6 +214,30 @@ void test_multi_linestring_multi_linestring()
|
|||||||
false);
|
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>
|
template <typename P>
|
||||||
void test_all()
|
void test_all()
|
||||||
@ -230,6 +254,8 @@ void test_all()
|
|||||||
test_linestring_linestring<P>();
|
test_linestring_linestring<P>();
|
||||||
test_linestring_multi_linestring<P>();
|
test_linestring_multi_linestring<P>();
|
||||||
test_multi_linestring_multi_linestring<P>();
|
test_multi_linestring_multi_linestring<P>();
|
||||||
|
|
||||||
|
test_point_polygon<P>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -212,6 +212,30 @@ void test_multi_linestring_multi_linestring()
|
|||||||
true);
|
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>
|
template <typename P>
|
||||||
void test_all()
|
void test_all()
|
||||||
@ -228,6 +252,8 @@ void test_all()
|
|||||||
test_linestring_linestring<P>();
|
test_linestring_linestring<P>();
|
||||||
test_linestring_multi_linestring<P>();
|
test_linestring_multi_linestring<P>();
|
||||||
test_multi_linestring_multi_linestring<P>();
|
test_multi_linestring_multi_linestring<P>();
|
||||||
|
|
||||||
|
test_point_polygon<P>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,6 +216,30 @@ void test_multi_linestring_multi_linestring()
|
|||||||
false);
|
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>
|
template <typename P>
|
||||||
void test_all()
|
void test_all()
|
||||||
@ -232,6 +256,8 @@ void test_all()
|
|||||||
test_linestring_linestring<P>();
|
test_linestring_linestring<P>();
|
||||||
test_linestring_multi_linestring<P>();
|
test_linestring_multi_linestring<P>();
|
||||||
test_multi_linestring_multi_linestring<P>();
|
test_multi_linestring_multi_linestring<P>();
|
||||||
|
|
||||||
|
test_point_polygon<P>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user