#[non_exhaustive]pub enum ProjError {
Show 23 variants
InvalidOp,
WrongSyntax,
MissingArg,
IllegalArgValue,
MutuallyExclusiveArgs,
FileNotFound,
NotEllipsoid,
CoordTransfm,
InvalidCoord,
OutsideProjectionDomain,
NoOperation,
OutsideGrid,
GridAtNodata,
NoConvergence,
MissingTime,
InvalidCrs {
message: String,
suggestion: Option<String>,
},
OutOfBounds {
message: String,
suggestion: Option<String>,
},
ProjectionFailed {
message: String,
},
UnsupportedOperation,
Other,
ApiMisuse,
NoInverseOp,
NetworkError,
}Expand description
Error type mirroring PROJ’s PROJ_ERR_* codes.
The numeric codes are grouped by base values defined in src/proj.h:
PROJ_ERR_INVALID_OP(1024): invalid operation / wrong setup.PROJ_ERR_COORD_TRANSFM(2048): coordinate transformation failures.PROJ_ERR_OTHER(4096): all other errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidOp
Generic invalid operation (PROJ_ERR_INVALID_OP = 1024).
WrongSyntax
Invalid PROJ string syntax (PROJ_ERR_INVALID_OP_WRONG_SYNTAX = 1025).
MissingArg
Missing required operation parameter
(PROJ_ERR_INVALID_OP_MISSING_ARG = 1026).
IllegalArgValue
One of the operation parameters has an illegal value
(PROJ_ERR_INVALID_OP_ILLEGAL_ARG_VALUE = 1027).
MutuallyExclusiveArgs
Mutually exclusive arguments
(PROJ_ERR_INVALID_OP_MUTUALLY_EXCLUSIVE_ARGS = 1028).
FileNotFound
File not found or with invalid content
(PROJ_ERR_INVALID_OP_FILE_NOT_FOUND_OR_INVALID = 1029).
NotEllipsoid
Value does not correspond to an ellipsoid (maps to code 1027,
same as ProjError::IllegalArgValue).
CoordTransfm
Generic error of coordinate transformation
(PROJ_ERR_COORD_TRANSFM = 2048).
InvalidCoord
Invalid coordinate (PROJ_ERR_COORD_TRANSFM_INVALID_COORD = 2049).
OutsideProjectionDomain
Coordinate outside projection domain
(PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN = 2050).
NoOperation
No operation found matching criteria
(PROJ_ERR_COORD_TRANSFM_NO_OPERATION = 2051).
OutsideGrid
Point to transform falls outside grid or subgrid
(PROJ_ERR_COORD_TRANSFM_OUTSIDE_GRID = 2052).
GridAtNodata
Point to transform falls in a grid cell that evaluates to nodata
(PROJ_ERR_COORD_TRANSFM_GRID_AT_NODATA = 2053).
NoConvergence
Iterative algorithm did not converge
(PROJ_ERR_COORD_TRANSFM_NO_CONVERGENCE = 2054).
MissingTime
Missing required time coordinate
(PROJ_ERR_COORD_TRANSFM_MISSING_TIME = 2055).
InvalidCrs
Invalid CRS definition with a descriptive message.
Use this variant when the error is specifically a CRS definition problem and you can provide a helpful message (and optionally a suggestion for fixing it).
Fields
OutOfBounds
Coordinate out of bounds.
Carries a descriptive message and an optional suggestion.
Fields
ProjectionFailed
Projection computation failed.
Carries a descriptive message about the computation failure.
UnsupportedOperation
Operation not supported (e.g. AD path not implemented for this projection).
Other
Other error (PROJ_ERR_OTHER = 4096).
ApiMisuse
Error caused by incorrect use of PROJ API
(PROJ_ERR_OTHER_API_MISUSE = 4097).
NoInverseOp
No inverse operation (PROJ_ERR_OTHER_NO_INVERSE_OP = 4098).
NetworkError
Failure when accessing a network resource
(PROJ_ERR_OTHER_NETWORK_ERROR = 4099).
Implementations§
Source§impl ProjError
impl ProjError
Sourcepub fn suggestion(&self) -> Option<&str>
pub fn suggestion(&self) -> Option<&str>
Returns a human-readable suggestion for resolving this error, if one is available.
Returns Some for variants that carry a suggestion field (when one
was provided at construction time) as well as for several well-known
unit variants where a static hint is always useful.
Trait Implementations§
impl Eq for ProjError
Source§impl Error for ProjError
impl Error for ProjError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for ProjError
Auto Trait Implementations§
impl Freeze for ProjError
impl RefUnwindSafe for ProjError
impl Send for ProjError
impl Sync for ProjError
impl Unpin for ProjError
impl UnsafeUnpin for ProjError
impl UnwindSafe for ProjError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more