| 88 | } |
| 89 | |
| 90 | void emit_line_component( |
| 91 | std::ostream& os, |
| 92 | const std::vector<double>& vertices, |
| 93 | const std::vector<int>& component, |
| 94 | bool force_2d = false, |
| 95 | const char* const wkt_geometry_type=LINESTRING) |
| 96 | { |
| 97 | os << wkt_geometry_type << " "; |
| 98 | if (!force_2d) { |
| 99 | os << "Z"; |
| 100 | } |
| 101 | os << "("; |
| 102 | if (wkt_geometry_type == POLYGON) { |
| 103 | os << "("; |
| 104 | } |
| 105 | for (size_t i = 0; i < component.size() + (wkt_geometry_type == POLYGON ? 1 : 0); ++i) { |
| 106 | if (i != 0) { |
| 107 | os << ", "; |
| 108 | } |
| 109 | for (size_t l = 0; l < (force_2d ? 2 : 3); ++l) { |
| 110 | os << vertices[component[i % component.size()] * 3 + l]; |
| 111 | if (l != (force_2d ? 1 : 2)) { |
| 112 | os << " "; |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | os << ")"; |
| 117 | if (wkt_geometry_type == POLYGON) { |
| 118 | os << ")"; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | void emit_line_strings( |
| 123 | std::ostream& os, |
no test coverage detected