6 Aralık 2017 Çarşamba

geometry difference metodu

difference metodu - MultiPolygon
Şöyle yaparız.
MultiPolygonType polygon1;
boost::geometry::read_wkt("MULTIPOLYGON(((...)))", polygon1);

MultiPolygonType polygon2;
boost::geometry::read_wkt("MULTIPOLYGON(((...)))", polygon2);

MultiPolygonType differencePolygon;
boost::geometry::difference(polygon1, polygon2, differencePolygon);
difference metodu - Polygon
Şöyle yaparız.
typedef boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double> >
 polygon;

polygon green = ...;
polygon blue = ...;
std::list<polygon> output;
boost::geometry::difference(green, blue, output);
difference metodu - Ring
Şöyle yaparız.
typedef boost::geometry::model::point<double, 2, boost::geometry::cs::cartesian>
 point_t;

// CCW without repeating first vertex.
typedef boost::geometry::model::ring<point_t, false, false> ring_t;

ring_t polyA;
...

ring_t polyB;
...

std::vector<ring_t> out;
boost::geometry::difference(polyA, polyB, out);

Hiç yorum yok:

Yorum Gönder