]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/doc/src/examples/algorithms/unique.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2011-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 //` Shows how to make a so-called minimal set of a polygon by removing duplicate points
15 #include <boost/geometry.hpp>
16 #include <boost/geometry/geometries/polygon.hpp>
17 #include <boost/geometry/geometries/adapted/boost_tuple.hpp>
19 BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian
)
23 boost::geometry::model::polygon
<boost::tuple
<double, double> > poly
;
24 boost::geometry::read_wkt("POLYGON((0 0,0 0,0 5,5 5,5 5,5 5,5 0,5 0,0 0,0 0,0 0,0 0))", poly
);
25 boost::geometry::unique(poly
);
26 std::cout
<< boost::geometry::wkt(poly
) << std::endl
;
38 POLYGON((0 0,0 5,5 5,5 0,0 0))