Exception: Proj4::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ffi-proj4/error.rb

Constant Summary collapse

ERRORS =
%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
  IllegalAxisOrientationCombination
  PointNotWithinAvailableDatumShiftGrids
  InvalidSweepAxis
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.error(errno) ⇒ Object



61
62
63
# File 'lib/ffi-proj4/error.rb', line 61

def self.error(errno)
  ERRORS[errno.abs] || 'Unknown'
end

.instantiate_error(errno) ⇒ Object



69
70
71
72
# File 'lib/ffi-proj4/error.rb', line 69

def self.instantiate_error(errno)
  name = self.error(errno)
  Proj4.const_get("#{name}Error").new(Proj4::FFIProj4.pj_strerrno(errno))
end

.listObject



57
58
59
# File 'lib/ffi-proj4/error.rb', line 57

def self.list
   ERRORS
end

.raise_error(errno) ⇒ Object

Raises:



65
66
67
# File 'lib/ffi-proj4/error.rb', line 65

def self.raise_error(errno)
  raise self.instantiate_error(errno), caller[0..-1]
end

Instance Method Details

#errnoObject Also known as: errnum



74
75
76
# File 'lib/ffi-proj4/error.rb', line 74

def errno
  self.class.errno
end