Struct laz::laszip::LasZipAppender
source · pub struct LasZipAppender<'a, W: Write + Send + 'a> { /* private fields */ }
Expand description
Struct that handles appending compressed points to a LAZ file.
Implementations§
source§impl<'a, W> LasZipAppender<'a, W>
impl<'a, W> LasZipAppender<'a, W>
sourcepub fn new(data: W, vlr: LazVlr) -> Result<Self>
pub fn new(data: W, vlr: LazVlr) -> Result<Self>
data must be positioned at the start of point data
sourcepub fn done(&mut self) -> Result<()>
pub fn done(&mut self) -> Result<()>
Tells the compressor that no more points will be compressed
- Compresses & writes the rest of the points to form the last chunk
- Writes the chunk table
- update the offset to the chunk_table
pub fn get_mut(&mut self) -> &mut W
source§impl<'a, W> LasZipAppender<'a, W>
impl<'a, W> LasZipAppender<'a, W>
sourcepub fn compress_one(&mut self, input: &[u8]) -> Result<()>
pub fn compress_one(&mut self, input: &[u8]) -> Result<()>
Compress the point and write the compressed data to the destination given when the compressor was constructed
The data is written in the buffer is expected to be exactly as it would have been in a LAS File, that is:
- The fields/dimensions are in the same order as the LAS spec says
- The data in the buffer is in Little Endian order
sourcepub fn compress_many(&mut self, points: &[u8]) -> Result<()>
pub fn compress_many(&mut self, points: &[u8]) -> Result<()>
sourcepub fn compress_chunks<Chunks, Item>(&mut self, chunks: Chunks) -> Result<()>
pub fn compress_chunks<Chunks, Item>(&mut self, chunks: Chunks) -> Result<()>
Compresses multiple chunks
§Important
This must be called only when writing variable-size chunks. This will panic otherwise.
sourcepub fn finish_current_chunk(&mut self) -> Result<()>
pub fn finish_current_chunk(&mut self) -> Result<()>
Finished the current chunks.
All points compressed with the previous calls to compress_one
and compress_many
will form one chunk. And the subsequent calls to compress_one
and compress_many
will form a new chunk.
§Important
Only call this when writing variable-size chunks.