Skip to main content

proj4rs/
errors.rs

1//!
2//! Crate errors
3//!
4
5#[derive(thiserror::Error, Debug)]
6pub enum Error {
7    #[error("{0}")]
8    InputStringError(&'static str),
9    #[error("Missing value for parameter {0}")]
10    NoValueParameter(String),
11    #[error("Cannot retrieve value for parameter")]
12    ParameterValueError(String),
13    #[error("Missing projection name")]
14    MissingProjectionError,
15    #[error("Unrecognized datum")]
16    InvalidDatum,
17    #[error("Unrecognized ellipsoid")]
18    InvalidEllipsoid,
19    #[error("{0}")]
20    InvalidParameterValue(&'static str),
21    #[error("Invalid coordinate dimension")]
22    InvalidCoordinateDimension,
23    #[error("Latitude out of range")]
24    LatitudeOutOfRange,
25    #[error("NAD grid not available")]
26    NadGridNotAvailable,
27    #[error("Parent grid not found")]
28    NadGridParentNotFound,
29    #[error("Inverse grid shift failed to converge.")]
30    InverseGridShiftConvError,
31    #[error("Point outside of NAD outside Shift area")]
32    PointOutsideNadShiftArea,
33    #[error("Invalid 'towgs84' string")]
34    InvalidToWGS84String,
35    #[error("Invalid axis")]
36    InvalidAxis,
37    #[error("Unrecognized format")]
38    UnrecognizedFormat,
39    #[error("Latitude or longitude over range")]
40    LatOrLongExceedLimit,
41    #[error("Nan value for coordinate")]
42    NanCoordinateValue,
43    #[error("Coordinate out of range")]
44    CoordinateOutOfRange,
45    #[error("Invalid number of coordinates")]
46    InvalidNumberOfCoordinates,
47    #[error("Projection not found")]
48    ProjectionNotFound,
49    #[error("No forward projection defined for dest projection")]
50    NoForwardProjectionDefined,
51    #[error("No inverse projection defined for src projection")]
52    NoInverseProjectionDefined,
53    #[error("ProjErrConicLatEqual")]
54    ProjErrConicLatEqual,
55    #[error("Tolerance condition not satisfied")]
56    ToleranceConditionError,
57    #[error("Non convergence of phi2 calculation")]
58    NonInvPhi2Convergence,
59    #[error("Failed to compute forward projection")]
60    ForwardProjectionFailure,
61    #[error("Failed to compute inverse projection")]
62    InverseProjectionFailure,
63    #[error("Invalid UTM zone")]
64    InvalidUtmZone,
65    #[error("An ellipsoid is required")]
66    EllipsoidRequired,
67    #[error("Coordinate transform outside projection domain")]
68    CoordTransOutsideProjectionDomain,
69    #[error("No convergence for inv. meridian distance")]
70    InvMeridDistConvError,
71    #[error("JS parse error")]
72    JsParseError,
73    #[error("Invalid Ntv2 grid format: {0}")]
74    InvalidNtv2GridFormat(&'static str),
75    #[error("IO error")]
76    IoError(#[from] std::io::Error),
77    #[error("UTF8 error")]
78    Utf8Error(#[from] std::str::Utf8Error),
79    #[error("Grid file not found {0}")]
80    GridFileNotFound(String),
81    #[error("Unknown grid format")]
82    UnknownGridFormat,
83    #[error("Numerical argument too  large")]
84    ArgumentTooLarge,
85}
86
87pub type Result<T, E = Error> = std::result::Result<T, E>;