| 285 | |
| 286 | |
| 287 | void TileKernel::adder(PointRef& point, int xpos, int ypos) |
| 288 | { |
| 289 | Coord loc(xpos, ypos); |
| 290 | |
| 291 | Stage *w; |
| 292 | Streamable *sw; |
| 293 | |
| 294 | auto wi = m_writers.find(loc); |
| 295 | if (wi == m_writers.end()) |
| 296 | { |
| 297 | std::string filename(m_outputFile); |
| 298 | std::string xname(std::to_string(xpos)); |
| 299 | std::string yname(std::to_string(ypos)); |
| 300 | filename.replace(m_hashPos, 1, (xname + "_" + yname)); |
| 301 | |
| 302 | w = &m_manager.makeWriter(filename, ""); |
| 303 | if (!w) |
| 304 | throw pdal_error("Couldn't create writer for output file '" + |
| 305 | m_outputFile + "'."); |
| 306 | sw = dynamic_cast<Streamable *>(w); |
| 307 | if (!sw) |
| 308 | throw pdal_error("Driver '" + w->getName() + "' for output file '" + |
| 309 | m_outputFile + "' is not streamable."); |
| 310 | m_writers[loc] = sw; |
| 311 | |
| 312 | sw->prepare(m_table); |
| 313 | StreamableWrapper::spatialReferenceChanged(*sw, m_outSrs); |
| 314 | StreamableWrapper::ready(*sw, m_table); |
| 315 | } |
| 316 | else |
| 317 | sw = wi->second; |
| 318 | StreamableWrapper::processOne(*sw, point); |
| 319 | } |
| 320 | |
| 321 | } // namespace pdal |
nothing calls this directly
no test coverage detected