Exception: Proj4::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Proj4::Error
- Defined in:
- lib/proj4.rb
Overview
Base class for all Proj.4 exceptions. Subclasses with the name <errorname>Error are available for each exception.
Constant Summary collapse
- ERRORS =
List of all Proj.4 errors. – (This list is created from the one in pj_strerrno.c in the Proj.4 distribution.) ++
%w{Unknown NoArgsInInitList NoOptionsInInitFile NoColonInInitString ProjectionNotNamed UnknownProjectionId EffectiveEccentricityEq1 UnknownUnitConversionId InvalidBooleanParamArgument UnknownEllipticalParameterName ReciprocalFlatteningIsZero RadiusReferenceLatitudeGt90 SquaredEccentricityLessThanZero MajorAxisOrRadiusIsZeroOrNotGiven LatitudeOrLongitudeExceededLimits InvalidXOrY ImproperlyFormedDMSValue NonConvergentInverseMeridinalDist NonConvergentInversePhi2 AcosOrAsinArgTooBig ToleranceCondition ConicLat1EqMinusLat2 Lat1GreaterThan90 Lat1IsZero LatTsGreater90 NoDistanceBetweenControlPoints ProjectionNotSelectedToBeRotated WSmallerZeroOrMSmallerZero LsatNotInRange PathNotInRange HSmallerZero KSmallerZero Lat0IsZeroOr90OrAlphaIsZero Lat1EqLat2OrLat1IsZeroOrLat2Is90 EllipticalUsageRequired InvalidUTMZoneNumber ArgsOutOfRangeForTchebyEval NoProjectionToBeRotated FailedToLoadNAD2783CorrectionFile BothNAndMMustBeSpecdAndGreaterZero NSmallerZeroOrNGreaterOneOrNotSpecified Lat1OrLat2NotSpecified AbsoluteLat1EqLat2 Lat0IsHalfPiFromMeanLat UnparseableCoordinateSystemDefinition GeocentricTransformationMissingZOrEllps UnknownPrimeMeridianConversionId}
Class Method Summary collapse
-
.error(errnum) ⇒ Object
Return name of error with given number.
-
.list ⇒ Object
Return list of all errors.
-
.raise_error(errnum) ⇒ Object
Raise an error with error number
errnum
.
Instance Method Summary collapse
-
#errnum ⇒ Object
Return error number of this error.
Class Method Details
.error(errnum) ⇒ Object
Return name of error with given number.
call-seq: error(errnum) -> String
39 40 41 |
# File 'lib/proj4.rb', line 39 def self.error(errnum) ERRORS[errnum.abs] || 'Unknown' end |
.list ⇒ Object
Return list of all errors.
call-seq: list -> Array
31 32 33 |
# File 'lib/proj4.rb', line 31 def self.list ERRORS end |
.raise_error(errnum) ⇒ Object
Raise an error with error number errnum
.
44 45 46 |
# File 'lib/proj4.rb', line 44 def self.raise_error(errnum) raise eval("#{error(errnum.abs)}Error"), (-(errnum.abs)), caller[0..-1] end |
Instance Method Details
#errnum ⇒ Object
Return error number of this error.
49 50 51 |
# File 'lib/proj4.rb', line 49 def errnum self.class.errnum end |