#include #include namespace bg = boost::geometry; typedef bg::model::point point_type; typedef bg::model::linestring linestring_type; typedef bg::point_iterator point_iterator_type; typedef bg::segment_iterator segment_iterator_type; int main() { linestring_type linestring; bg::read_wkt("LINESTRING(1 1,2 2,3 3,4 4,9 9)", linestring); std::cout << "geometry: " << bg::wkt(linestring) << std::endl; std::cout << "points:"; for (point_iterator_type it = bg::points_begin(linestring); it != bg::points_end(linestring); ++it) { std::cout << " " << bg::dsv(*it); } std::cout << std::endl; std::cout << "segments:"; for (segment_iterator_type it = bg::segments_begin(linestring); it != bg::segments_end(linestring); ++it) { std::cout << " " << bg::dsv(*it); } std::cout << std::endl; return 0; }