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

Method adder

kernels/TileKernel.cpp:287–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285
286
287void 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

Callers

nothing calls this directly

Calls 8

spatialReferenceChangedFunction · 0.85
processOneFunction · 0.85
readyFunction · 0.50
findMethod · 0.45
endMethod · 0.45
replaceMethod · 0.45
getNameMethod · 0.45
prepareMethod · 0.45

Tested by

no test coverage detected