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

Method finishOutput

io/LasWriter.cpp:1107–1135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1105
1106
1107void LasWriter::finishOutput()
1108{
1109 if (d->opts.compression == las::Compression::True)
1110 finishLazPerfOutput();
1111 log()->get(LogLevel::Debug) << "Wrote " << (int)d->summary.getTotalNumPoints() <<
1112 " points to the LAS file" << std::endl;
1113
1114 // addVlr prevents any evlrs from being added before version 1.4.
1115 d->header.evlrOffset = (m_evlrs.size() ? (uint32_t)m_ostream->tellp() : 0);
1116 for (const las::Evlr& evlr : m_evlrs)
1117 {
1118 std::vector<char> buf = evlr.headerData();
1119 m_ostream->write((const char *)buf.data(), buf.size());
1120 m_ostream->write((const char *)evlr.data(), evlr.dataSize());
1121 }
1122
1123 // Refill the header since the offset/scale may have been auto-computed.
1124 fillHeader();
1125
1126 // The summary is calculated as points are written.
1127 las::setSummary(d->header, d->summary);
1128
1129 std::vector<char> buf = d->header.data();
1130 m_ostream->seekp(0);
1131 m_ostream->write(buf.data(), buf.size());
1132 //ABELL - This seemingly unnecessary line may have been necessary for NITF or LASzip.
1133 m_ostream->seekp(d->header.pointOffset);
1134 m_ostream->flush();
1135}
1136
1137
1138void LasWriter::finishLazPerfOutput()

Callers

nothing calls this directly

Calls 10

setSummaryFunction · 0.85
getTotalNumPointsMethod · 0.80
headerDataMethod · 0.80
dataSizeMethod · 0.80
flushMethod · 0.80
logFunction · 0.50
getMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected