[geometry] added test file for relate(), fixed error in linear_linear, added tag-dispatched detail::relate()

This commit is contained in:
Adam Wulkiewicz
2013-12-21 01:49:40 +01:00
parent 02a32dee32
commit 382e975f2f
6 changed files with 224 additions and 18 deletions

View File

@@ -49,20 +49,6 @@ void test_linestring_linestring()
test_geometry<ls, ls>("LINESTRING(0 0,5 0,3 0,6 0)", "LINESTRING(0 0,6 0)", true);
test_geometry<ls, ls>("LINESTRING(0 0,2 2,3 3,1 1)", "LINESTRING(0 0,3 3,6 3)", true);
test_geometry<ls, ls>("LINESTRING(0 0,2 2,3 3,1 1,5 3)", "LINESTRING(0 0,3 3,6 3)", false);
// RELATE TEST
ls geometry1;
ls geometry2;
bg::read_wkt("LINESTRING(0 0,2 2,3 3,1 1,5 3)", geometry1);
bg::read_wkt("LINESTRING(0 0,3 3,6 3)", geometry2);
namespace bgr = bg::detail::relate;
bgr::result
res = bgr::linear_linear<ls, ls>::apply(geometry1, geometry2);
bool ii = res.template get<bgr::interior, bgr::interior>() != 'F';
bool ie = res.template get<bgr::interior, bgr::exterior>() != 'F';
bool be = res.template get<bgr::boundary, bgr::exterior>() != 'F';
bool w = ii && !ie && !be;
BOOST_CHECK(!w);
}
template <typename P>