I’ve get several boost::geometry::model::ring
s stored in a vector (or list). I’m wondering is there any direct function that I can create a boost::geometry::model::polygon
with these rings, with the first in the list as the exterior, and the rest as interiors? (I don’t want to add points or rings one by one with iteration)
codes showing what I want:
#include<vector>
#include <boost/geometry/geometry.hpp>
namespace bg = boost::geometry;
typedef bg::model::d2::point_xy<double> DPoint;
typedef bg::model::ring<DPoint, true> DRing;
typedef bg::model::polygon<DPoint, true> DPolygon;
using namespace std;
int main(void)
{
vector<DRing> rings = {outer, inner1, inner2, ...}; // more than 1 rings
// I'm finding something like
DPolygon pg(rings);
// or
DPolygon pg(rings.begin(), rings.end());
return 0;
}