| 1105 | |
| 1106 | |
| 1107 | void 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 | |
| 1138 | void LasWriter::finishLazPerfOutput() |
nothing calls this directly
no test coverage detected