• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 //
3 // Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
4 // Use, modification and distribution is subject to the Boost Software License,
5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 
8 
9 #include "test_equals.hpp"
10 
11 #include <boost/geometry/algorithms/area.hpp>
12 
13 #include <boost/geometry/geometries/geometries.hpp>
14 #include <boost/geometry/geometries/point_xy.hpp>
15 
16 
17 template <typename P>
test_all()18 void test_all()
19 {
20     std::string case1 = "MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)))";
21     std::string case1_p     = "POLYGON((0 0,0 7,4 2,2 0,0 0))";
22 
23     typedef bg::model::polygon<P> polygon;
24     typedef bg::model::multi_polygon<polygon> mp;
25     test_geometry<mp, mp>("c1", case1, case1, true);
26 
27     test_geometry<mp, mp>("c2",
28             "MULTIPOLYGON(((0 0,0 7.01,4 2,2 0,0 0)))",
29             case1, false);
30 
31     // Different order == equal
32     test_geometry<mp, mp>("c3",
33             "MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)),((10 10,10 12,12 10,10 10)))",
34             "MULTIPOLYGON(((10 10,10 12,12 10,10 10)),((0 0,0 7,4 2,2 0,0 0)))",
35             true);
36 
37     // check different types
38     test_geometry<polygon, mp>("c1_p_mp", case1_p, case1, true);
39     test_geometry<mp, polygon>("c1_mp_p", case1, case1_p, true);
40 
41 }
42 
test_main(int,char * [])43 int test_main( int , char* [] )
44 {
45     test_all<bg::model::d2::point_xy<double> >();
46 
47 #ifdef HAVE_TTMATH
48     test_all<bg::model::d2::point_xy<ttmath_big> >();
49 #endif
50 
51     return 0;
52 }
53