I am using the following code to get the vertices from a boost:::geometry::polygon
using namespace boost::geometry;
using PointType = model::d2::point_xy<double>;
using PolygonType = model::polygon<PointType, false>; // clockwise ordering
PolygonType poly;
// set several vertices here
for(auto pos = 0; pos < num_points(poly); ++pos) {
PointType pt = poly.outer()[pos];
// do something with the point here
}
However, I can’t find an easy way to SET the values of a specific point in the polygon. I’d The following doesn’t work …
PointType new_pt{3, 3};
poly.outer()[pos] = new_pt;
What am I doing wrong?