1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
11 #include <algorithms/test_for_each.hpp>
13 #include <boost/geometry/geometries/geometries.hpp>
33 test_geometry<bg::model::linestring<P> >
38 , "LINESTRING(101 1,102 2)"
39 , "LINESTRING(101 100,102 200)"
43 , "LINESTRING(10 1,2 2)"
45 test_geometry<bg::model::ring<P> >
47 "POLYGON((1 1,1 4,4 4,4 1,1 1))"
50 , "POLYGON((101 1,101 4,104 4,104 1,101 1))"
51 , "POLYGON((101 100,101 400,104 400,104 100,101 100))"
53 , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1))"
55 , "POLYGON((10 1,10 4,4 4,4 1,1 1))"
57 test_geometry<bg::model::ring<P, true, false> > // open ring
59 "POLYGON((1 1,1 4,4 4,4 1))"
62 , "POLYGON((101 1,101 4,104 4,104 1))"
63 , "POLYGON((101 100,101 400,104 400,104 100))"
65 , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1))"
67 , "POLYGON((10 1,10 4,4 4,4 1))"
69 test_geometry<bg::model::polygon<P> >
71 "POLYGON((1 1,1 4,4 4,4 1,1 1),(2 2,3 2,3 3,2 3,2 2))"
74 , "POLYGON((101 1,101 4,104 4,104 1,101 1),(102 2,103 2,103 3,102 3,102 2))"
75 , "POLYGON((101 100,101 400,104 400,104 100,101 100),(102 200,103 200,103 300,102 300,102 200))"
77 , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1)) "
78 "((2, 2), (3, 2)) ((3, 2), (3, 3)) ((3, 3), (2, 3)) ((2, 3), (2, 2))"
80 , "POLYGON((10 1,10 4,4 4,4 1,1 1,10 1),(2 2,3 2,3 3,2 3,2 2))"
82 test_geometry<bg::model::polygon<P, true, false> > // open polygon
84 "POLYGON((1 1,1 4,4 4,4 1),(2 2,3 2,3 3,2 3))"
87 , "POLYGON((101 1,101 4,104 4,104 1,101 1),(102 2,103 2,103 3,102 3,102 2))"
88 , "POLYGON((101 100,101 400,104 400,104 100,101 100),(102 200,103 200,103 300,102 300,102 200))"
90 , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1)) "
91 "((2, 2), (3, 2)) ((3, 2), (3, 3)) ((3, 3), (2, 3)) ((2, 3), (2, 2))"
93 , "POLYGON((10 1,10 4,4 4,4 1,10 1),(2 2,3 2,3 3,2 3,2 2))"
97 int test_main(int, char* [])
99 test_all<bg::model::point<double, 2, bg::cs::cartesian> >();
101 #if defined(HAVE_TTMATH)
102 test_all<bg::model::point<ttmath_big, 2, bg::cs::cartesian> >();