1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use thiserror::Error;
use crate::fields::Fields;
/// Errors that can occur when reading a COPC file.
#[derive(Debug, Error)]
pub enum CopcError {
/// I/O error from the underlying byte source.
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
/// Error parsing LAS header or VLR data.
#[error("LAS error: {0}")]
Las(#[from] las::Error),
/// Error during LAZ decompression.
#[error("LAZ error: {0}")]
Laz(#[from] laz::LasZipError),
/// The required COPC info VLR was not found.
#[error("COPC info VLR not found")]
CopcInfoNotFound,
/// The required LAZ VLR was not found.
#[error("LAZ VLR not found")]
LazVlrNotFound,
/// A hierarchy page was shorter than expected.
#[error("hierarchy page at offset {offset} truncated")]
TruncatedHierarchyPage {
/// File offset where the truncated page starts.
offset: u64,
},
/// The requested node is not in the loaded hierarchy.
#[error("node not found in hierarchy: {0:?}")]
NodeNotFound(crate::types::VoxelKey),
/// Attempted to materialize `las::Point` values from a chunk that was
/// decoded with a partial field mask.
///
/// A partially-decoded chunk leaves skipped field bytes as zeros in the
/// backing buffer, so producing `Point` values from it would silently
/// yield wrong data for those fields. Refetch the chunk with `Fields::ALL`
/// or use the column-level accessors on [`Chunk`](crate::Chunk) instead.
#[error("cannot materialize points from partially-decoded chunk (fields: {0:?})")]
PartialDecode(Fields),
/// Custom error from a [`ByteSource`](crate::ByteSource) implementation.
#[error("byte source error: {0}")]
ByteSource(Box<dyn std::error::Error + Send + Sync>),
}