0
std :: vectorを使用してブーストジオメトリポリゴンを作成する方法は?例えば、ブーストジオメトリとSTL
typedef double coordinate_type;
typedef boost::geometry::model::d2::point_xy<coordinate_type> point;
typedef boost::geometry::model::polygon<point> polygon;
boost::geometry::model::linestring<point> test_data;
boost::geometry::read_wkt("LINESTRING(1 2, 3 4)", test_data);
上記はうまくいきます。
std::deque<polygon> output;
boost::geometry::intersection(test1, test2, output);
BOOST_FOREACH(polygon const& p, output)
{
std::cout << boost::geometry::wkt(p) << std::endl;
}
:私が交差するポイントを持っている場合、どのように私は例えば、
boost::geometry::read_wkt("LINESTRING(1 2, 3 4)", test_data);
同様にデータを作成することができます
std::vector<double> x;
std::vector<double> y;
x.push_back(1);
x.push_back(3);
y.push_back(2);
y.push_back(4);
:私たちは、次のように私は2つのベクトルでのポリゴンのポイントを持っていると仮定しましょう
「p」からベクトルx、yにデータを取得するにはどうすればよいですか?
私は助けと指導を感謝します。ありがとう。このような