| 170 | } |
| 171 | |
| 172 | std::unique_ptr<geos::geom::Geometry> |
| 173 | GeometryNoder::to_geometry(geos::noding::SegmentString::NonConstVect& noded_edges) |
| 174 | { |
| 175 | const auto* geom_factory = m_geometry.getFactory(); |
| 176 | std::set<geos::noding::OrientedCoordinateArray> ocas; |
| 177 | |
| 178 | std::vector<std::unique_ptr<geos::geom::Geometry>> lines; |
| 179 | lines.reserve(noded_edges.size()); |
| 180 | for (auto& ss : noded_edges) |
| 181 | { |
| 182 | auto* coords = ss->getCoordinates(); |
| 183 | |
| 184 | // Check if an equivalent edge is known |
| 185 | geos::noding::OrientedCoordinateArray oca(*coords); |
| 186 | // NOTE: Each coordinate sequence is expected to be exactly two coordinates. |
| 187 | if (ocas.insert(oca).second) |
| 188 | { |
| 189 | if (coords->front() == coords->back()) |
| 190 | { |
| 191 | lines.push_back(geom_factory->createPoint(coords->front())); |
| 192 | } else |
| 193 | { |
| 194 | lines.push_back(geom_factory->createLineString(coords->clone())); |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | return geom_factory->createGeometryCollection(std::move(lines)); |
| 200 | } |
| 201 | |
| 202 | } // namespace generative::noding |
nothing calls this directly
no outgoing calls
no test coverage detected