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::linestring<P> >
57 test_geometry<bg::model::ring<P> >
59 "POLYGON((1 1,1 4,4 4,4 1,1 1))"
62 , "POLYGON((101 1,101 4,104 4,104 1,101 1))"
63 , "POLYGON((101 100,101 400,104 400,104 100,101 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,1 1))"
69 test_geometry<bg::model::ring<P> >
81 test_geometry<bg::model::ring<P, true, false> > // open ring
83 "POLYGON((1 1,1 4,4 4,4 1))"
86 , "POLYGON((101 1,101 4,104 4,104 1))"
87 , "POLYGON((101 100,101 400,104 400,104 100))"
89 , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1))"
91 , "POLYGON((10 1,10 4,4 4,4 1))"
93 test_geometry<bg::model::polygon<P> >
95 "POLYGON((1 1,1 4,4 4,4 1,1 1),(2 2,3 2,3 3,2 3,2 2))"
98 , "POLYGON((101 1,101 4,104 4,104 1,101 1),(102 2,103 2,103 3,102 3,102 2))"
99 , "POLYGON((101 100,101 400,104 400,104 100,101 100),(102 200,103 200,103 300,102 300,102 200))"
101 , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1)) "
102 "((2, 2), (3, 2)) ((3, 2), (3, 3)) ((3, 3), (2, 3)) ((2, 3), (2, 2))"
104 , "POLYGON((10 1,10 4,4 4,4 1,1 1,10 1),(2 2,3 2,3 3,2 3,2 2))"
106 test_geometry<bg::model::polygon<P, true, false> > // open polygon
108 "POLYGON((1 1,1 4,4 4,4 1),(2 2,3 2,3 3,2 3))"
111 , "POLYGON((101 1,101 4,104 4,104 1,101 1),(102 2,103 2,103 3,102 3,102 2))"
112 , "POLYGON((101 100,101 400,104 400,104 100,101 100),(102 200,103 200,103 300,102 300,102 200))"
114 , "((1, 1), (1, 4)) ((1, 4), (4, 4)) ((4, 4), (4, 1)) ((4, 1), (1, 1)) "
115 "((2, 2), (3, 2)) ((3, 2), (3, 3)) ((3, 3), (2, 3)) ((2, 3), (2, 2))"
117 , "POLYGON((10 1,10 4,4 4,4 1,10 1),(2 2,3 2,3 3,2 3,2 2))"
121 int test_main(int, char* [])
123 test_all<bg::model::point<double, 2, bg::cs::cartesian> >();
125 #if defined(HAVE_TTMATH)
126 test_all<bg::model::point<ttmath_big, 2, bg::cs::cartesian> >();