]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/correct_multi.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-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)
8 #include <geometry_test_common.hpp>
10 #include <boost/geometry/algorithms/correct.hpp>
12 #include <boost/geometry/strategies/strategies.hpp>
14 #include <boost/geometry/io/wkt/wkt.hpp>
16 #include <boost/geometry/geometries/box.hpp>
17 #include <boost/geometry/geometries/ring.hpp>
18 #include <boost/geometry/geometries/linestring.hpp>
19 #include <boost/geometry/geometries/point_xy.hpp>
20 #include <boost/geometry/geometries/point.hpp>
21 #include <boost/geometry/geometries/polygon.hpp>
22 #include <boost/geometry/geometries/multi_polygon.hpp>
25 template <typename Geometry
>
26 void test_geometry(std::string
const& wkt
, std::string
const& expected
)
30 bg::read_wkt(wkt
, geometry
);
31 bg::correct(geometry
);
33 std::ostringstream out
;
34 out
<< bg::wkt(geometry
);
36 BOOST_CHECK_EQUAL(out
.str(), expected
);
42 typedef bg::model::multi_polygon
<bg::model::polygon
<P
> > cw_type
;
44 "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))";
45 test_geometry
<cw_type
>(cw_mp
, cw_mp
);
47 test_geometry
<cw_type
>("MULTIPOLYGON(((0 0,1 0,1 1,0 1,0 0)))",
51 int test_main( int , char* [] )
53 test_all
<bg::model::d2::point_xy
<double> >();