MCPcopy Create free account
hub / github.com/PDAL/PDAL / writeRing

Method writeRing

filters/private/hexer/Path.cpp:8–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6{
7
8void 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

Callers 1

writePolygonMethod · 0.80

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected