// Boost.Geometry (aka GGL, Generic Geometry Library) test file // // Copyright Barend Gehrels 2010, Geodan, Amsterdam, the Netherlands // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include #include #include #include #include #include template void test_areal() { test_one("simplex_multi", case_multi_simplex[0], case_multi_simplex[1], 2, 12, 6.42); test_one("case_multi_no_ip", case_multi_no_ip[0], case_multi_no_ip[1], 2, 8, 8.5); test_one("case_multi_2", case_multi_2[0], case_multi_2[1], 3, 12, 5.9); test_one("simplex_multi_mp_p", case_multi_simplex[0], case_single_simplex, 2, 12, 6.42); test_one("simplex_multi_r_mp", case_single_simplex, case_multi_simplex[0], 2, 12, 6.42); test_one("simplex_multi_mp_r", case_multi_simplex[0], case_single_simplex, 2, 12, 6.42); } template void test_all() { namespace bg = boost::geometry; typedef bg::linear_ring

ring; typedef bg::polygon

polygon; typedef bg::multi_polygon multi_polygon; test_areal(); typedef bg::linear_ring ring_ccw; typedef bg::polygon polygon_ccw; typedef bg::multi_polygon multi_polygon_ccw; test_areal(); typedef bg::linestring

linestring; typedef bg::multi_linestring multi_linestring; // linear test_one("case_multi_linear_1", "MULTILINESTRING((0 0,1 1))", "MULTILINESTRING((0 1,1 0))", 1, 1, 0); test_one("case_multi_linear_2", "MULTILINESTRING((0 0,1 1),(0.5 0,1.5 1))", "MULTILINESTRING((0 1,1 0),(0.5 1,1.5 0))", 4, 4, 0); test_one("case_multi_linear_3", "LINESTRING(0 0,1 1)", "MULTILINESTRING((0 1,1 0),(0.5 1,1.5 0))", 2, 2, 0); test_one("case_multi_linear_4", "MULTILINESTRING((0 1,1 0),(0.5 1,1.5 0))", "LINESTRING(0 0,1 1)", 2, 2, 0); } int test_main(int, char* []) { test_all >(); return 0; }