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

Method writePointMajor

io/BpfWriter.cpp:286–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284
285
286void BpfWriter::writePointMajor(const PointView* data)
287{
288 // Blocks of 10,000 points will ensure that we're under 16MB, even
289 // for 255 dimensions.
290 size_t blockpoints = std::min<point_count_t>(10000UL, data->size());
291
292 // For compression we're going to write to a buffer so that it can be
293 // compressed before it's written to the file stream.
294 BpfCompressor compressor(m_stream,
295 blockpoints * sizeof(float) * m_dims.size());
296 PointId idx = 0;
297 while (idx < data->size())
298 {
299 if (m_header.m_compression)
300 compressor.startBlock();
301 size_t blockId;
302 for (blockId = 0; idx < data->size() && blockId < blockpoints;
303 ++idx, ++blockId)
304 {
305 for (auto & bpfDim : m_dims)
306 {
307 double d = getAdjustedValue(data, bpfDim, idx);
308 m_stream << (float)d;
309 }
310 }
311 if (m_header.m_compression)
312 {
313 compressor.compress();
314 compressor.finish();
315 }
316 }
317}
318
319
320void BpfWriter::writeDimMajor(const PointView* data)

Callers

nothing calls this directly

Calls 4

startBlockMethod · 0.80
sizeMethod · 0.45
compressMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected