문제

I'm new to boost::geometry and can't find any examples in the documentation or here for this. I have a text file with wkt GEOMETRYCOLLECTION on each line. Every collection holds one or more MULTIPOINTS. Parsing MULTIPOINTS is no problem:

typedef boost::geometry::model::point<double, 3, boost::geometry::cs::cartesian> point;
typedef boost::geometry::model::multi_point<point> multipoint;
multipoint myPoints;
boost::geometry::read_wkt("MULTIPOINT ((123456.123 1234567.123 42.42), (654321.123 7654321.123 123.12))", myPoints);
// do something with myPoints
for (auto &point : myPoints) {
  std::cout << point.get<0>() << " " << point.get<1>() << " " << point.get<2>() << std::endl;
}

But I need to parse something like this:

bg::read_wkt("GEOMETRYCOLLECTION (MULTIPOINT ((1 2 3), (3 2 1)), MULTIPOINT ((4 5 6), (7 8 9)))", myCollection);

Any ideas how to do this?

도움이 되었습니까?

해결책

This will be the variant (a collection of Boost.Variant's), but it is not yet fully implemented, only a few algorithms support the variant.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top