OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ossimEckert4Projection Class Reference

#include <ossimEckert4Projection.h>

Inheritance diagram for ossimEckert4Projection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimEckert4Projection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimEckert4Projection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, double falseEasting, double falseNorthing)
 
 ~ossimEckert4Projection ()
 
virtual ossimObjectdup () const
 
virtual ossimDpt forward (const ossimGpt &worldPoint) const
 All map projections will convert the world coordinate to an easting northing (Meters). More...
 
virtual ossimGpt inverse (const ossimDpt &projectedPoint) const
 Will take a point in meters and convert it to ground. More...
 
virtual void update ()
 
void setFalseEasting (double falseEasting)
 
void setFalseNorthing (double falseNorthing)
 
void setFalseEastingNorthing (double falseEasting, double falseNorthing)
 
double getFalseEasting () const
 
double getFalseNorthing () const
 
void setDefaults ()
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
- Public Member Functions inherited from ossimMapProjection
 ossimMapProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimMapProjection (const ossimMapProjection &src)
 
virtual ossimGpt origin () const
 
virtual ossimDpt worldToLineSample (const ossimGpt &worldPoint) const
 
virtual void worldToLineSample (const ossimGpt &worldPoint, ossimDpt &lineSample) const
 
virtual ossimGpt lineSampleToWorld (const ossimDpt &projectedPoint) const
 
virtual void lineSampleToWorld (const ossimDpt &projectedPoint, ossimGpt &gpt) const
 
virtual void lineSampleHeightToWorld (const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const
 This is the pure virtual that projects the image point to the given elevation above ellipsoid, thereby bypassing reference to a DEM. More...
 
virtual void lineSampleToEastingNorthing (const ossimDpt &liineSample, ossimDpt &eastingNorthing) const
 
virtual void eastingNorthingToLineSample (const ossimDpt &eastingNorthing, ossimDpt &lineSample) const
 
virtual void eastingNorthingToWorld (const ossimDpt &eastingNorthing, ossimGpt &worldPt) const
 
virtual double getStandardParallel1 () const
 Derived classes should implement as needed. More...
 
virtual double getStandardParallel2 () const
 Derived classes should implement as needed. More...
 
virtual void setPcsCode (ossim_uint32 pcsCode)
 
virtual ossim_uint32 getPcsCode () const
 Returns the EPSG PCS code or 32767 if the projection is a custom (non-EPSG) projection. More...
 
virtual ossimString getProjectionName () const
 Returns the projection name. More...
 
virtual double getA () const
 ACCESS METHODS: More...
 
virtual double getB () const
 
virtual double getF () const
 
virtual ossimDpt getMetersPerPixel () const
 
virtual const ossimDptgetDecimalDegreesPerPixel () const
 Returns decimal degrees per pixel as an ossimDpt with "x" representing longitude and "y" representing latitude. More...
 
virtual const ossimDptgetUlEastingNorthing () const
 
virtual const ossimGptgetUlGpt () const
 
virtual const ossimDatumgetDatum () const
 
const ossimEllipsoidgetEllipsoid () const
 
const ossimGptgetOrigin () const
 
virtual bool isGeographic () const
 
virtual void applyScale (const ossimDpt &scale, bool recenterTiePoint)
 Applies scale to theDeltaLonPerPixel, theDeltaLatPerPixel and theMetersPerPixel data members (eg: theDeltaLonPerPixel *= scale.x). More...
 
virtual void setEllipsoid (const ossimEllipsoid &ellipsoid)
 SET METHODS: More...
 
virtual void setAB (double a, double b)
 
virtual void setDatum (const ossimDatum *datum)
 Sets theDatum to datum. More...
 
virtual void setOrigin (const ossimGpt &origin)
 Sets theOrigin to origin. More...
 
virtual void setMetersPerPixel (const ossimDpt &gsd)
 
virtual void setDecimalDegreesPerPixel (const ossimDpt &gsd)
 
virtual void setUlTiePoints (const ossimGpt &gpt)
 
virtual void setUlTiePoints (const ossimDpt &eastingNorthing)
 
virtual void setUlEastingNorthing (const ossimDpt &ulEastingNorthing)
 
virtual void setUlGpt (const ossimGpt &ulGpt)
 
virtual void assign (const ossimProjection &aProjection)
 
virtual std::ostream & print (std::ostream &out) const
 Prints data members to stream. More...
 
virtual bool operator== (const ossimProjection &projection) const
 Compares this to arg projection and returns TRUE if the same. More...
 
virtual void computeDegreesPerPixel ()
 Computes the approximate resolution in degrees/pixel. More...
 
virtual void computeMetersPerPixel ()
 This will go from the ground point and give you an approximate meters per pixel. More...
 
void setMatrix (double rotation, const ossimDpt &scale, const ossimDpt &translation)
 
void setMatrixScale (const ossimDpt &scale)
 
void setMatrixRotation (double rotation)
 
void setMatrixTranslation (const ossimDpt &translation)
 
void snapTiePointTo (ossim_float64 multiple, ossimUnitType unitType)
 Utility method to snap the tie point to some multiple. More...
 
void snapTiePointToOrigin ()
 
void setElevationLookupFlag (bool flag)
 
bool getElevationLookupFlag () const
 
ossimUnitType getModelTransformUnitType () const
 
void setModelTransformUnitType (ossimUnitType unit)
 
bool hasModelTransform () const
 
virtual bool isAffectedByElevation () const
 Implementation of pure virtual ossimProjection::isAffectedByElevation method. More...
 
void setProjectionUnits (ossimUnitType units)
 
ossimUnitType getProjectionUnits () const
 OSSIM considers all map projection coordinates (including false eastings and northings) to be in meters. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimProjection
 ossimProjection ()
 
virtual ~ossimProjection ()
 
virtual void getRoundTripError (const ossimDpt &imagePoint, ossimDpt &errorResult) const
 
virtual void getRoundTripError (const ossimGpt &groundPoint, ossimDpt &errorResult) const
 
virtual void getGroundClipPoints (ossimGeoPolygon &gpts) const
 
virtual bool operator!= (const ossimProjection &projection) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Private Member Functions

long Set_Eckert4_Parameters (double a, double f, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Eckert4_Parameters (double *a, double *f, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Eckert4 (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Eckert4_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Eck4_a
 
double Eck4_f
 
double es2
 
double es4
 
double es6
 
double Ra0
 
double Ra1
 
double Eck4_Origin_Long
 
double Eck4_False_Easting
 
double Eck4_False_Northing
 
double Eck4_Delta_Northing
 
double Eck4_Max_Easting
 
double Eck4_Min_Easting
 

Additional Inherited Members

- Protected Member Functions inherited from ossimMapProjection
virtual ~ossimMapProjection ()
 
void updateFromTransform ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimMapProjection
ossimEllipsoid theEllipsoid
 This method verifies that the projection parameters match the current pcs code. More...
 
ossimGpt theOrigin
 
const ossimDatumtheDatum
 This is only set if we want to have built in datum shifting. More...
 
ossimDpt theMetersPerPixel
 Holds the number of meters per pixel. More...
 
ossimDpt theDegreesPerPixel
 Hold the decimal degrees per pixel. More...
 
ossimGpt theUlGpt
 Hold tie point in decimal degrees. More...
 
ossimDpt theUlEastingNorthing
 Hold tie point as easting northing. More...
 
ossimDpt theFalseEastingNorthing
 Hold the false easting northing. More...
 
ossim_uint32 thePcsCode
 Projection Coordinate System(PCS) code. More...
 
bool theElevationLookupFlag
 
ossimMatrix4x4 theModelTransform
 
ossimMatrix4x4 theInverseModelTransform
 
ossimUnitType theModelTransformUnitType
 
ossimUnitType theProjectionUnits
 Linear units of the projection as indicated in the projection's specification: More...
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 16 of file ossimEckert4Projection.h.

Constructor & Destructor Documentation

◆ ossimEckert4Projection() [1/2]

ossimEckert4Projection::ossimEckert4Projection ( const ossimEllipsoid ellipsoid = ossimEllipsoid(),
const ossimGpt origin = ossimGpt() 
)

Definition at line 51 of file ossimEckert4Projection.cpp.

References setDefaults(), and update().

53  :ossimMapProjection(ellipsoid, origin)
54 {
55  setDefaults();
56  update();
57 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimEckert4Projection() [2/2]

ossimEckert4Projection::ossimEckert4Projection ( const ossimEllipsoid ellipsoid,
const ossimGpt origin,
double  falseEasting,
double  falseNorthing 
)

Definition at line 59 of file ossimEckert4Projection.cpp.

References Eck4_Delta_Northing, Eck4_False_Easting, Eck4_False_Northing, Eck4_Max_Easting, Eck4_Min_Easting, and update().

63  :ossimMapProjection(ellipsoid, origin)
64 {
65 
66  Eck4_False_Easting = falseEasting;
67  Eck4_False_Northing = falseNorthing;
68  Eck4_Delta_Northing = 8451144.0;
69  Eck4_Max_Easting = 16902288.0;
70  Eck4_Min_Easting = -16902288.0;
71 
72  update();
73 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimEckert4Projection()

ossimEckert4Projection::~ossimEckert4Projection ( )
inline

Definition at line 26 of file ossimEckert4Projection.h.

26 {}

Member Function Documentation

◆ Convert_Eckert4_To_Geodetic()

long ossimEckert4Projection::Convert_Eckert4_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

The function Convert_Eckert4_To_Geodetic converts Eckert IV projection easting and northing coordinates to geodetic (latitude and longitude) coordinates, according to the current ellipsoid and Eckert IV projection coordinates. If any errors occur, the error code(s) are returned by the function, otherwise ECK4_NO_ERROR is returned.

Easting : Easting (X) in meters (input) Northing : Northing (Y) in meters (input) Latitude : Latitude (phi) in radians (output) Longitude : Longitude (lambda) in radians (output)

Definition at line 359 of file ossimEckert4Projection.cpp.

References Eck4_False_Easting, Eck4_False_Northing, ECK4_NO_ERROR, Eck4_Origin_Long, NUM, Ra0, Ra1, and two_PLUS_PI_OVER_2.

Referenced by inverse().

363 { /* Begin Convert_Eckert4_To_Geodetic */
364 /*
365  * The function Convert_Eckert4_To_Geodetic converts Eckert IV projection
366  * (easting and northing) coordinates to geodetic (latitude and longitude)
367  * coordinates, according to the current ellipsoid, spherical radius and
368  * Eckert IV projection coordinates.
369  * If any errors occur, the error code(s) are returned by the
370  * function, otherwise ECK4_NO_ERROR is returned.
371  *
372  * Easting : Easting (X) in meters (input)
373  * Northing : Northing (Y) in meters (input)
374  * Latitude : Latitude (phi) in radians (output)
375  * Longitude : Longitude (lambda) in radians (output)
376  */
377 
378  double theta;
379  double sin_theta, cos_theta;
380  double num;
381  double dx, dy;
382  double i;
383 
384  long Error_Code = ECK4_NO_ERROR;
385 
386 // if ((Easting < (Eck4_False_Easting + Eck4_Min_Easting))
387 // || (Easting > (Eck4_False_Easting + Eck4_Max_Easting)))
388 // { /* Easting out of range */
389 // Error_Code |= ECK4_EASTING_ERROR;
390 // }
391 // if ((Northing < (Eck4_False_Northing - Eck4_Delta_Northing))
392 // || (Northing > (Eck4_False_Northing + Eck4_Delta_Northing)))
393 // { /* Northing out of range */
394 // Error_Code |= ECK4_NORTHING_ERROR;
395 // }
396 
397  if (!Error_Code)
398  {
399  dy = Northing - Eck4_False_Northing;
400  dx = Easting - Eck4_False_Easting;
401  i = dy / Ra1;
402  if (i > 1.0)
403  i = 1.0;
404  else if (i < -1.0)
405  i = -1.0;
406 
407  theta = asin(i);
408  sin_theta = sin(theta);
409  cos_theta = cos(theta);
410  num = NUM(theta, sin_theta, cos_theta);
411 
412  *Latitude = asin(num / two_PLUS_PI_OVER_2);
413  *Longitude = Eck4_Origin_Long + dx / (Ra0 * (1 + cos_theta));
414 
415 // if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
416 // *Latitude = PI_OVER_2;
417 // else if (*Latitude < -PI_OVER_2)
418 // *Latitude = -PI_OVER_2;
419 
420 // if (*Longitude > PI)
421 // *Longitude -= TWO_PI;
422 // if (*Longitude < -PI)
423 // *Longitude += TWO_PI;
424 
425 // if (*Longitude > PI) /* force distorted values to 180, -180 degrees */
426 // *Longitude = PI;
427 // else if (*Longitude < -PI)
428 // *Longitude = -PI;
429 
430  }
431  return (Error_Code);
432 
433 } /* End Convert_Eckert4_To_Geodetic */
#define ECK4_NO_ERROR
#define NUM(Theta, SinTheta, CosTheta)
const double two_PLUS_PI_OVER_2

◆ Convert_Geodetic_To_Eckert4()

long ossimEckert4Projection::Convert_Geodetic_To_Eckert4 ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

The function Convert_Geodetic_To_Eckert4 converts geodetic (latitude and longitude) coordinates to Eckert IV projection easting, and northing coordinates, according to the current ellipsoid and Eckert IV projection parameters. If any errors occur, the error code(s) are returned by the function, otherwise ECK4_NO_ERROR is returned.

Latitude : Latitude (phi) in radians (input) Longitude : Longitude (lambda) in radians (input) Easting : Easting (X) in meters (output) Northing : Northing (Y) in meters (output)

Definition at line 290 of file ossimEckert4Projection.cpp.

References Eck4_False_Easting, Eck4_False_Northing, ECK4_NO_ERROR, Eck4_Origin_Long, NUM, Ra0, Ra1, and two_PLUS_PI_OVER_2.

Referenced by forward().

295 { /* Begin Convert_Geodetic_To_Eckert4 */
296 /*
297  * The function Convert_Geodetic_To_Eckert4 converts geodetic (latitude and
298  * longitude) coordinates to Eckert IV projection (easting and northing)
299  * coordinates, according to the current ellipsoid, spherical radius and
300  * Eckert IV projection parameters.
301  * If any errors occur, the error code(s) are returned by the
302  * function, otherwise ECK4_NO_ERROR is returned.
303  *
304  * Latitude : Latitude (phi) in radians (input)
305  * Longitude : Longitude (lambda) in radians (input)
306  * Easting : Easting (X) in meters (output)
307  * Northing : Northing (Y) in meters (output)
308  */
309 
310  double slat = sin(Latitude);
311  double sin_theta, cos_theta;
312  double num;
313  double dlam; /* Longitude - Central Meridan */
314  double theta = Latitude / 2.0;
315  double delta_theta = 1.0;
316  double dt_tolerance = 4.85e-10; /* approximately 1/1000th of
317  an arc second or 1/10th meter */
318  long Error_Code = ECK4_NO_ERROR;
319 
320 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
321 // { /* Latitude out of range */
322 // Error_Code |= ECK4_LAT_ERROR;
323 // }
324 // if ((Longitude < -PI) || (Longitude > TWO_PI))
325 // { /* Longitude out of range */
326 // Error_Code|= ECK4_LON_ERROR;
327 // }
328 
329  if (!Error_Code)
330  { /* no errors */
331 
332  dlam = Longitude - Eck4_Origin_Long;
333 // if (dlam > PI)
334 // {
335 // dlam -= TWO_PI;
336 // }
337 // if (dlam < -PI)
338 // {
339 // dlam += TWO_PI;
340 // }
341  while (fabs(delta_theta) > dt_tolerance)
342  {
343  sin_theta = sin(theta);
344  cos_theta = cos(theta);
345  num = NUM(theta, sin_theta, cos_theta);
346  delta_theta = -(num - two_PLUS_PI_OVER_2 * slat) /
347  (2.0 * cos_theta * (1.0 + cos_theta));
348  theta += delta_theta;
349  }
350  *Easting = Ra0 * dlam * (1.0 + cos(theta)) + Eck4_False_Easting;
351  *Northing = Ra1 * sin(theta) + Eck4_False_Northing;
352  }
353 
354  return (Error_Code);
355 
356 } /* End Convert_Geodetic_To_Eckert4 */
#define ECK4_NO_ERROR
#define NUM(Theta, SinTheta, CosTheta)
const double two_PLUS_PI_OVER_2

◆ dup()

virtual ossimObject* ossimEckert4Projection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 27 of file ossimEckert4Projection.h.

28  {
29  return new ossimEckert4Projection(*this);
30  }
ossimEckert4Projection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ forward()

ossimDpt ossimEckert4Projection::forward ( const ossimGpt worldPoint) const
virtual

All map projections will convert the world coordinate to an easting northing (Meters).

Implements ossimMapProjection.

Definition at line 104 of file ossimEckert4Projection.cpp.

References ossimGpt::changeDatum(), ossimDatum::code(), Convert_Geodetic_To_Eckert4(), ossimGpt::datum(), ossimGpt::latr(), ossimGpt::lonr(), and ossimMapProjection::theDatum.

105 {
106  double easting = 0.0;
107  double northing = 0.0;
108  ossimGpt gpt = latLon;
109 
110  if (theDatum)
111  {
112  if (theDatum->code() != latLon.datum()->code())
113  {
114  gpt.changeDatum(theDatum); // Shift to our datum.
115  }
116  }
117 
119  gpt.lonr(),
120  &easting,
121  &northing);
122 
123  return ossimDpt(easting, northing);
124 }
virtual const ossimString & code() const
Definition: ossimDatum.h:57
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
Definition: ossimGpt.cpp:316
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
double latr() const
latr().
Definition: ossimGpt.h:66
long Convert_Geodetic_To_Eckert4(double Latitude, double Longitude, double *Easting, double *Northing) const
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ Get_Eckert4_Parameters()

void ossimEckert4Projection::Get_Eckert4_Parameters ( double *  a,
double *  f,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Eckert4_Parameters returns the current ellipsoid parameters and EckertIV projection parameters.

a : Semi-major axis of ellipsoid, in meters (output) f : Flattening of ellipsoid (output) Central_Meridian : Longitude in radians at the center of (output) the projection False_Easting : A coordinate value in meters assigned to the central meridian of the projection. (output) False_Northing : A coordinate value in meters assigned to the origin latitude of the projection (output)

Definition at line 261 of file ossimEckert4Projection.cpp.

References Eck4_a, Eck4_f, Eck4_False_Easting, Eck4_False_Northing, and Eck4_Origin_Long.

266 { /* Begin Get_Eckert4_Parameters */
267 /*
268  * The function Get_Eckert4_Parameters returns the current ellipsoid
269  * parameters and Eckert IV projection parameters.
270  *
271  * a : Semi-major axis of ellipsoid, in meters (output)
272  * f : Flattening of ellipsoid (output)
273  * Central_Meridian : Longitude in radians at the center of (output)
274  * the projection
275  * False_Easting : A coordinate value in meters assigned to the
276  * central meridian of the projection. (output)
277  * False_Northing : A coordinate value in meters assigned to the
278  * origin latitude of the projection (output)
279  */
280 
281  *a = Eck4_a;
282  *f = Eck4_f;
283  *Central_Meridian = Eck4_Origin_Long;
284  *False_Easting = Eck4_False_Easting;
285  *False_Northing = Eck4_False_Northing;
286  return;
287 } /* End Get_Eckert4_Parameters */

◆ getFalseEasting()

double ossimEckert4Projection::getFalseEasting ( ) const
inlinevirtual
Returns
The false easting.

Reimplemented from ossimMapProjection.

Definition at line 54 of file ossimEckert4Projection.h.

◆ getFalseNorthing()

double ossimEckert4Projection::getFalseNorthing ( ) const
inlinevirtual
Returns
The false northing.

Reimplemented from ossimMapProjection.

Definition at line 55 of file ossimEckert4Projection.h.

◆ inverse()

ossimGpt ossimEckert4Projection::inverse ( const ossimDpt projectedPoint) const
virtual

Will take a point in meters and convert it to ground.

Implements ossimMapProjection.

Definition at line 91 of file ossimEckert4Projection.cpp.

References Convert_Eckert4_To_Geodetic(), DEG_PER_RAD, ossimMapProjection::theDatum, ossimDpt::x, and ossimDpt::y.

92 {
93  double lat = 0.0;
94  double lon = 0.0;
95 
96  Convert_Eckert4_To_Geodetic(eastingNorthing.x,
97  eastingNorthing.y,
98  &lat,
99  &lon);
100 
101  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
102 }
#define DEG_PER_RAD
long Convert_Eckert4_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ loadState()

bool ossimEckert4Projection::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimMapProjection.

Definition at line 160 of file ossimEckert4Projection.cpp.

References Eck4_False_Easting, Eck4_False_Northing, ossimKeywordlist::find(), ossimMapProjection::loadState(), setDefaults(), STATIC_TYPE_NAME, ossimMapProjection::theFalseEastingNorthing, ossimKeywordNames::TYPE_KW, update(), ossimDpt::x, and ossimDpt::y.

161 {
162  bool flag = ossimMapProjection::loadState(kwl, prefix);
163 
164  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
165 
166  setDefaults();
167 
169  {
172  }
173 
174  update();
175 
176  return flag;
177 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
const char * find(const char *key) const
double y
Definition: ossimDpt.h:165
static const char * TYPE_KW
#define STATIC_TYPE_NAME(T)
Definition: ossimRtti.h:325
double x
Definition: ossimDpt.h:164
ossimDpt theFalseEastingNorthing
Hold the false easting northing.

◆ saveState()

bool ossimEckert4Projection::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list. Return true if ok or false on error.

Reimplemented from ossimMapProjection.

Definition at line 155 of file ossimEckert4Projection.cpp.

References ossimMapProjection::saveState().

156 {
157  return ossimMapProjection::saveState(kwl, prefix);
158 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ Set_Eckert4_Parameters()

long ossimEckert4Projection::Set_Eckert4_Parameters ( double  a,
double  f,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
private

The function Set_Eckert4_Parameters receives the ellipsoid parameters and Eckert IV projection parameters as inputs, and sets the corresponding state variables. If any errors occur, the error code(s) are returned by the function, otherwise ECK4_NO_ERROR is returned.

a : Semi-major axis of ellipsoid, in meters (input) f : Flattening of ellipsoid (input) Central_Meridian : Longitude in radians at the center of (input) the projection False_Easting : A coordinate value in meters assigned to the central meridian of the projection. (input) False_Northing : A coordinate value in meters assigned to the origin latitude of the projection (input)

Definition at line 185 of file ossimEckert4Projection.cpp.

References Eck4_a, Eck4_f, Eck4_False_Easting, Eck4_False_Northing, Eck4_Max_Easting, Eck4_Min_Easting, ECK4_NO_ERROR, Eck4_Origin_Long, es2, es4, es6, Ra0, and Ra1.

Referenced by update().

191 { /* Begin Set_Eckert4_Parameters */
192 /*
193  * The function Set_Eckert4_Parameters receives the ellipsoid parameters and
194  * projection parameters as inputs, and sets the corresponding state
195  * variables. If any errors occur, the error code(s) are returned by the
196  * function, otherwise ECK4_NO_ERROR is returned.
197  *
198  * a : Semi-major axis of ellipsoid, in meters (input)
199  * f : Flattening of ellipsoid (input)
200  * Central_Meridian : Longitude in radians at the center of (input)
201  * the projection
202  * False_Easting : A coordinate value in meters assigned to the
203  * central meridian of the projection. (input)
204  * False_Northing : A coordinate value in meters assigned to the
205  * origin latitude of the projection (input)
206  */
207 
208  double Ra; /* Spherical radius */
209 // double inv_f = 1 / f;
210  long Error_Code = ECK4_NO_ERROR;
211 
212 // if (a <= 0.0)
213 // { /* Semi-major axis must be greater than zero */
214 // Error_Code |= ECK4_A_ERROR;
215 // }
216 // if ((inv_f < 250) || (inv_f > 350))
217 // { /* Inverse flattening must be between 250 and 350 */
218 // Error_Code |= ECK4_INV_F_ERROR;
219 // }
220 // if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
221 // { /* origin longitude out of range */
222 // Error_Code |= ECK4_CENT_MER_ERROR;
223 // }
224  if (!Error_Code)
225  { /* no errors */
226  Eck4_a = a;
227  Eck4_f = f;
228  es2 = 2 * Eck4_f - Eck4_f * Eck4_f;
229  es4 = es2 * es2;
230  es6 = es4 * es2;
231  /* spherical radius */
232  Ra = Eck4_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 / 3024.0);
233  Ra0 = 0.4222382 * Ra;
234  Ra1 = 1.3265004 * Ra;
235 // if (Central_Meridian > PI)
236 // Central_Meridian -= TWO_PI;
237  Eck4_Origin_Long = Central_Meridian;
238  Eck4_False_Easting = False_Easting;
239  Eck4_False_Northing = False_Northing;
240  if (Eck4_Origin_Long > 0)
241  {
242  Eck4_Max_Easting = 16808386.0;
243  Eck4_Min_Easting = -16902288.0;
244  }
245  else if (Eck4_Origin_Long < 0)
246  {
247  Eck4_Max_Easting = 16902288.0;
248  Eck4_Min_Easting = -16808386.0;
249  }
250  else
251  {
252  Eck4_Max_Easting = 16902288.0;
253  Eck4_Min_Easting = -16902288.0;
254  }
255 
256  } /* End if(!Error_Code) */
257  return (Error_Code);
258 } /* End Set_Eckert4_Parameters */
#define ECK4_NO_ERROR

◆ setDefaults()

void ossimEckert4Projection::setDefaults ( )

Initialize all pramters to default and calls update for pre-computations.

Definition at line 146 of file ossimEckert4Projection.cpp.

References Eck4_Delta_Northing, Eck4_False_Easting, Eck4_False_Northing, Eck4_Max_Easting, and Eck4_Min_Easting.

Referenced by loadState(), and ossimEckert4Projection().

147 {
148  Eck4_Delta_Northing = 8451144.0;
149  Eck4_Max_Easting = 16902288.0;
150  Eck4_Min_Easting = -16902288.0;
151  Eck4_False_Easting = 0.0;
152  Eck4_False_Northing = 0.0;
153 }

◆ setFalseEasting()

void ossimEckert4Projection::setFalseEasting ( double  falseEasting)

SetFalseEasting. The value is in meters. Update is then called so we can pre-compute paramters

Definition at line 126 of file ossimEckert4Projection.cpp.

References Eck4_False_Easting, and update().

127 {
128  Eck4_False_Easting = falseEasting;
129  update();
130 }

◆ setFalseEastingNorthing()

void ossimEckert4Projection::setFalseEastingNorthing ( double  falseEasting,
double  falseNorthing 
)

Sets both false easting and northing values. The values are expected to be in meters. Update is then called so we can pre-compute paramters

Definition at line 138 of file ossimEckert4Projection.cpp.

References Eck4_False_Easting, Eck4_False_Northing, and update().

140 {
141  Eck4_False_Easting = falseEasting;
142  Eck4_False_Northing = falseNorthing;
143  update();
144 }

◆ setFalseNorthing()

void ossimEckert4Projection::setFalseNorthing ( double  falseNorthing)

SetFalseNorthing. The value is in meters. Update is then called so we can pre-compute paramters

Definition at line 132 of file ossimEckert4Projection.cpp.

References Eck4_False_Northing, and update().

133 {
134  Eck4_False_Northing = falseNorthing;
135  update();
136 }

◆ update()

void ossimEckert4Projection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 76 of file ossimEckert4Projection.cpp.

References Eck4_False_Easting, Eck4_False_Northing, ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::lonr(), Set_Eckert4_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

Referenced by loadState(), ossimEckert4Projection(), setFalseEasting(), setFalseEastingNorthing(), and setFalseNorthing().

77 {
78 
81  theOrigin.lonr(),
84 
87 
89 }
long Set_Eckert4_Parameters(double a, double f, double Central_Meridian, double False_Easting, double False_Northing)
double y
Definition: ossimDpt.h:165
const double & getA() const
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
double x
Definition: ossimDpt.h:164
const double & getFlattening() const
ossimEllipsoid theEllipsoid
This method verifies that the projection parameters match the current pcs code.
ossimDpt theFalseEastingNorthing
Hold the false easting northing.

Member Data Documentation

◆ Eck4_a

double ossimEckert4Projection::Eck4_a
mutableprivate

Definition at line 79 of file ossimEckert4Projection.h.

Referenced by Get_Eckert4_Parameters(), and Set_Eckert4_Parameters().

◆ Eck4_Delta_Northing

double ossimEckert4Projection::Eck4_Delta_Northing
mutableprivate

Definition at line 92 of file ossimEckert4Projection.h.

Referenced by ossimEckert4Projection(), and setDefaults().

◆ Eck4_f

double ossimEckert4Projection::Eck4_f
mutableprivate

Definition at line 80 of file ossimEckert4Projection.h.

Referenced by Get_Eckert4_Parameters(), and Set_Eckert4_Parameters().

◆ Eck4_False_Easting

double ossimEckert4Projection::Eck4_False_Easting
mutableprivate

◆ Eck4_False_Northing

double ossimEckert4Projection::Eck4_False_Northing
mutableprivate

◆ Eck4_Max_Easting

double ossimEckert4Projection::Eck4_Max_Easting
mutableprivate

◆ Eck4_Min_Easting

double ossimEckert4Projection::Eck4_Min_Easting
mutableprivate

◆ Eck4_Origin_Long

double ossimEckert4Projection::Eck4_Origin_Long
mutableprivate

◆ es2

double ossimEckert4Projection::es2
mutableprivate

Definition at line 81 of file ossimEckert4Projection.h.

Referenced by Set_Eckert4_Parameters().

◆ es4

double ossimEckert4Projection::es4
mutableprivate

Definition at line 82 of file ossimEckert4Projection.h.

Referenced by Set_Eckert4_Parameters().

◆ es6

double ossimEckert4Projection::es6
mutableprivate

Definition at line 83 of file ossimEckert4Projection.h.

Referenced by Set_Eckert4_Parameters().

◆ Ra0

double ossimEckert4Projection::Ra0
mutableprivate

◆ Ra1

double ossimEckert4Projection::Ra1
mutableprivate

The documentation for this class was generated from the following files: