| 247 | } |
| 248 | |
| 249 | void Output::writeChunkTable() |
| 250 | { |
| 251 | // Write chunk table offset |
| 252 | pdal::OLeStream out(&m_f); |
| 253 | out.seek(m_chunkOffsetPos); |
| 254 | out << m_pointPos; |
| 255 | |
| 256 | // Write chunk table header. |
| 257 | out.seek(m_pointPos); |
| 258 | uint32_t version = 0; |
| 259 | out << version; |
| 260 | out << (uint32_t)m_chunkTable.size(); |
| 261 | |
| 262 | // Write the chunk table itself. |
| 263 | lazperf::OutFileStream stream(m_f); |
| 264 | lazperf::compress_chunk_table(stream.cb(), m_chunkTable, true); |
| 265 | |
| 266 | // The ELVRs start after the chunk table. Add one for the hierarchy VLR. |
| 267 | m_header.evlr_count = b.vlrs.size() + 1; |
| 268 | m_header.evlr_offset = out.position(); |
| 269 | } |
| 270 | |
| 271 | void Output::writeHierarchy(const CountMap& counts) |
| 272 | { |