use crate::tiles::neighbourhood::NeighbourhoodError;
#[derive(thiserror::Error, Debug)]
#[non_exhaustive]
pub enum ContourError {
#[error(
"The centre elevation tile was fetched but could not be decoded as an image. \
The upstream source served malformed data for this tile."
)]
CorruptCentreTile,
#[error("Failed to trace isolines through the elevation grid: {0}")]
Isolines(String),
#[error("Failed to encode the traced contours as MVT: {0}")]
Encoding(String),
}
impl From<NeighbourhoodError> for ContourError {
fn from(value: NeighbourhoodError) -> Self {
match value {
NeighbourhoodError::CorruptCentreTile => Self::CorruptCentreTile,
}
}
}