| 6 | { |
| 7 | |
| 8 | void Path::writeRing(std::ostream& out) const |
| 9 | { |
| 10 | auto outputPoint = [&out](const Point& p) |
| 11 | { |
| 12 | out << p.m_x << " " << p.m_y; |
| 13 | }; |
| 14 | |
| 15 | const std::vector<Point>& pts = points(); |
| 16 | assert(pts.size() > 2); |
| 17 | out << "("; |
| 18 | outputPoint(pts.front()); |
| 19 | for (auto it = pts.begin() + 1; it != pts.end(); ++it) |
| 20 | { |
| 21 | out << ", "; |
| 22 | outputPoint(*it); |
| 23 | } |
| 24 | out << ")"; |
| 25 | } |
| 26 | |
| 27 | // WKT (or GeoJSON) doesn't allow nesting of polygons. You can just have |
| 28 | // polygons and holes. Islands within the holes need to be described as |
no test coverage detected