Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 34 variants InvalidEpsgCode { code: u32, }, EpsgCodeNotFound { code: u32, }, InvalidProjString { reason: String, }, InvalidWkt { reason: String, }, WktParseError { position: usize, message: String, }, TransformationError { reason: String, }, UnsupportedCrs { crs_type: String, }, IncompatibleCrs { src: String, tgt: String, }, InvalidCoordinate { reason: String, }, CoordinateOutOfBounds { x: f64, y: f64, }, InvalidBoundingBox { reason: String, }, MissingParameter { parameter: String, }, InvalidParameter { parameter: String, reason: String, }, DatumTransformError { reason: String, }, ProjectionInitError { reason: String, }, UnsupportedProjection { projection: String, }, NumericalError { operation: String, }, ConvergenceError { iterations: usize, }, JsonError(Error), IoError(Error), Utf8Error(Utf8Error), Proj4rsError(String), OutOfAreaOfUse { lon: f64, lat: f64, crs: String, }, OutsideAreaOfUse { lon: f64, lat: f64, epsg: u32, west: f64, south: f64, east: f64, north: f64, }, Ntv2ParseError(String), Ntv2OutOfGrid { lon: f64, lat: f64, }, InvalidCompoundCrs { reason: String, }, GeoidNotAvailable { vertical_crs: String, }, GeoidFileFormat(String), NoGeoidAvailable, ProjDbError(String), Other(String), PipelineParseError(String), PipelineStepError { step: usize, inner: String, },
}
Expand description

Comprehensive error type for projection operations.

Variants§

§

InvalidEpsgCode

Invalid EPSG code

Fields

§code: u32

The invalid EPSG code

§

EpsgCodeNotFound

EPSG code not found in database

Fields

§code: u32

The EPSG code that was not found

§

InvalidProjString

Invalid PROJ string

Fields

§reason: String

Reason for the invalid PROJ string

§

InvalidWkt

Invalid WKT (Well-Known Text) string

Fields

§reason: String

Reason for the invalid WKT

§

WktParseError

WKT parsing error

Fields

§position: usize

Position in the WKT string where error occurred

§message: String

Error message

§

TransformationError

Coordinate transformation error

Fields

§reason: String

Reason for transformation failure

§

UnsupportedCrs

Unsupported CRS (Coordinate Reference System)

Fields

§crs_type: String

Type of CRS that is not supported

§

IncompatibleCrs

Incompatible source and target CRS

Fields

§src: String

Source CRS description

§tgt: String

Target CRS description

§

InvalidCoordinate

Invalid coordinate

Fields

§reason: String

Reason for invalid coordinate

§

CoordinateOutOfBounds

Out of bounds coordinate

Fields

§x: f64

X coordinate

§y: f64

Y coordinate

§

InvalidBoundingBox

Invalid bounding box

Fields

§reason: String

Reason for invalid bounding box

§

MissingParameter

Missing required parameter

Fields

§parameter: String

Name of missing parameter

§

InvalidParameter

Invalid parameter value

Fields

§parameter: String

Parameter name

§reason: String

Reason for invalid value

§

DatumTransformError

Datum transformation error

Fields

§reason: String

Reason for datum transformation failure

§

ProjectionInitError

Projection initialization error

Fields

§reason: String

Reason for initialization failure

§

UnsupportedProjection

Unsupported projection

Fields

§projection: String

Name of unsupported projection

§

NumericalError

Numerical error (e.g., division by zero, sqrt of negative)

Fields

§operation: String

Operation that caused the error

§

ConvergenceError

Convergence failure in iterative algorithms

Fields

§iterations: usize

Number of iterations attempted

§

JsonError(Error)

JSON serialization/deserialization error

§

IoError(Error)

I/O error

§

Utf8Error(Utf8Error)

UTF-8 conversion error

§

Proj4rsError(String)

Error from proj4rs library

§

OutOfAreaOfUse

Coordinate is outside the source CRS area of use

Fields

§lon: f64

Longitude

§lat: f64

Latitude

§crs: String

CRS description

§

OutsideAreaOfUse

Coordinate lies outside the registered area-of-use bounding box for the source EPSG (raised by Transformer when the per-instance check mode is AreaOfUseCheck::Strict).

Fields

§lon: f64

Longitude of the offending point (degrees, WGS84).

§lat: f64

Latitude of the offending point (degrees, WGS84).

§epsg: u32

Source EPSG code whose area-of-use was violated.

§west: f64

Western bound of the area-of-use (degrees).

§south: f64

Southern bound of the area-of-use (degrees).

§east: f64

Eastern bound of the area-of-use (degrees).

§north: f64

Northern bound of the area-of-use (degrees).

§

Ntv2ParseError(String)

NTv2 binary grid-shift parse error

§

Ntv2OutOfGrid

Coordinate is outside all loaded NTv2 sub-grid extents

Fields

§lon: f64

Longitude in degrees

§lat: f64

Latitude in degrees

§

InvalidCompoundCrs

Invalid arguments for compound CRS construction.

Fields

§reason: String

Reason the compound CRS is invalid

§

GeoidNotAvailable

Geoid model required for vertical datum transformation is not available.

Fields

§vertical_crs: String

Name/description of the vertical CRS that requires a geoid model

§

GeoidFileFormat(String)

Geoid grid file has an unexpected size, layout, or could not be read.

§

NoGeoidAvailable

No geoid model has been attached to a crate::transform::Transformer that is being asked to perform a compound-CRS transform requiring a vertical-datum shift.

§

ProjDbError(String)

Error from PROJ.db SQLite file (always present so non-proj-db builds also compile)

§

Other(String)

Generic error for cases not covered by specific error types

§

PipelineParseError(String)

Pipeline PROJ string could not be parsed.

§

PipelineStepError

A step inside a coordinate pipeline failed.

Fields

§step: usize

Zero-based index of the failing step

§inner: String

Error message from the step

Implementations§

Source§

impl Error

Source

pub fn invalid_epsg_code(code: u32) -> Self

Creates an invalid EPSG code error.

Source

pub fn epsg_not_found(code: u32) -> Self

Creates an EPSG code not found error.

Source

pub fn invalid_proj_string<S: Into<String>>(reason: S) -> Self

Creates an invalid PROJ string error.

Source

pub fn invalid_wkt<S: Into<String>>(reason: S) -> Self

Creates an invalid WKT error.

Source

pub fn wkt_parse_error<S: Into<String>>(position: usize, message: S) -> Self

Creates a WKT parsing error.

Source

pub fn transformation_error<S: Into<String>>(reason: S) -> Self

Creates a transformation error.

Source

pub fn unsupported_crs<S: Into<String>>(crs_type: S) -> Self

Creates an unsupported CRS error.

Source

pub fn incompatible_crs<S: Into<String>>(src: S, tgt: S) -> Self

Creates an incompatible CRS error.

Source

pub fn invalid_coordinate<S: Into<String>>(reason: S) -> Self

Creates an invalid coordinate error.

Source

pub fn coordinate_out_of_bounds(x: f64, y: f64) -> Self

Creates a coordinate out of bounds error.

Source

pub fn invalid_bounding_box<S: Into<String>>(reason: S) -> Self

Creates an invalid bounding box error.

Source

pub fn missing_parameter<S: Into<String>>(parameter: S) -> Self

Creates a missing parameter error.

Source

pub fn invalid_parameter<S: Into<String>>(parameter: S, reason: S) -> Self

Creates an invalid parameter error.

Source

pub fn datum_transform_error<S: Into<String>>(reason: S) -> Self

Creates a datum transform error.

Source

pub fn projection_init_error<S: Into<String>>(reason: S) -> Self

Creates a projection initialization error.

Source

pub fn unsupported_projection<S: Into<String>>(projection: S) -> Self

Creates an unsupported projection error.

Source

pub fn numerical_error<S: Into<String>>(operation: S) -> Self

Creates a numerical error.

Source

pub fn convergence_error(iterations: usize) -> Self

Creates a convergence error.

Source

pub fn from_proj4rs<S: Into<String>>(message: S) -> Self

Creates an error from proj4rs library.

Source

pub fn out_of_area_of_use<S: Into<String>>(lon: f64, lat: f64, crs: S) -> Self

Creates an out-of-area-of-use error.

Source

pub fn ntv2_parse_error<S: Into<String>>(message: S) -> Self

Creates an NTv2 parse error.

Source

pub fn ntv2_out_of_grid(lon: f64, lat: f64) -> Self

Creates an NTv2 out-of-grid error.

Source

pub fn invalid_compound_crs(reason: impl Into<String>) -> Self

Creates an invalid compound CRS error.

Source

pub fn geoid_not_available(vertical_crs: impl Into<String>) -> Self

Creates a geoid-not-available error.

Source

pub fn other<S: Into<String>>(message: S) -> Self

Creates a generic other error.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Available on crate feature std only.
Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Utf8Error> for Error

Source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.