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

#include <ossimMollweidProjection.h>

Inheritance diagram for ossimMollweidProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimMollweidProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimMollweidProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, const double falseEasting, const double falseNorthing)
 
 ~ossimMollweidProjection ()
 
virtual ossimObjectdup () const
 
virtual ossimGpt inverse (const ossimDpt &eastingNorthing) const
 Will take a point in meters and convert it to ground. More...
 
virtual ossimDpt forward (const ossimGpt &latLon) const
 All map projections will convert the world coordinate to an easting northing (Meters). More...
 
virtual void update ()
 
void setFalseEasting (double falseEasting)
 
void setFalseNorthing (double falseNorthing)
 
void setFalseEastingNorthing (double falseEasting, double falseNorthing)
 
void setDefaults ()
 
void setCentralMeridian (double centralMeridian)
 
double getFalseEasting () const
 
double getFalseNorthing () const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual bool operator== (const ossimProjection &projection) const
 Returns TRUE if principal parameters are within epsilon tolerance. More...
 
- 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 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_Mollweide_Parameters (double a, double f, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Mollweide_Parameters (double *a, double *f, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Mollweide (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Mollweide_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Moll_a
 
double Moll_f
 
double es2
 
double es4
 
double es6
 
double Sqrt2_Ra
 
double Sqrt8_Ra
 
double Moll_Origin_Long
 
double Moll_False_Easting
 
double Moll_False_Northing
 
double Moll_Delta_Northing
 
double Moll_Max_Easting
 
double Moll_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 18 of file ossimMollweidProjection.h.

Constructor & Destructor Documentation

◆ ossimMollweidProjection() [1/2]

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

Definition at line 41 of file ossimMollweidProjection.cpp.

References setDefaults(), and update().

43  :ossimMapProjection(ellipsoid, origin)
44 {
45  setDefaults();
46  update();
47 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimMollweidProjection() [2/2]

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

Definition at line 49 of file ossimMollweidProjection.cpp.

References Moll_Delta_Northing, Moll_False_Easting, Moll_False_Northing, Moll_Max_Easting, Moll_Min_Easting, and update().

53  :ossimMapProjection(ellipsoid, origin)
54 {
55 
56  Moll_False_Easting = falseEasting;
57  Moll_False_Northing = falseNorthing;
58  Moll_Delta_Northing = 9009965.0;
59  Moll_Max_Easting = 18019930.0;
60  Moll_Min_Easting = -18019930.0;
61 
62  update();
63 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimMollweidProjection()

ossimMollweidProjection::~ossimMollweidProjection ( )
inline

Definition at line 28 of file ossimMollweidProjection.h.

28 {}

Member Function Documentation

◆ Convert_Geodetic_To_Mollweide()

long ossimMollweidProjection::Convert_Geodetic_To_Mollweide ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

The function Convert_Geodetic_To_Mollweide converts geodetic (latitude and longitude) coordinates to Mollweide projection easting, and northing coordinates, according to the current ellipsoid and Mollweide projection parameters. If any errors occur, the error code(s) are returned by the function, otherwise MOLL_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 287 of file ossimMollweidProjection.cpp.

References M_PI, Moll_False_Easting, Moll_False_Northing, MOLL_NO_ERROR, Moll_Origin_Long, Sqrt2_Ra, and Sqrt8_Ra.

Referenced by forward().

292 { /* Begin Convert_Geodetic_To_Mollweide */
293 /*
294  * The function Convert_Geodetic_To_Mollweide converts geodetic (latitude and
295  * longitude) coordinates to Mollweide projection (easting and northing)
296  * coordinates, according to the current ellipsoid and Mollweide projection
297  * parameters. If any errors occur, the error code(s) are returned by the
298  * function, otherwise MOLL_NO_ERROR is returned.
299  *
300  * Latitude : Latitude (phi) in radians (input)
301  * Longitude : Longitude (lambda) in radians (input)
302  * Easting : Easting (X) in meters (output)
303  * Northing : Northing (Y) in meters (output)
304  */
305 
306  double PI_Sin_Latitude = M_PI * sin(Latitude);
307  double dlam; /* Longitude - Central Meridan */
308  double theta;
309  double theta_primed = Latitude;
310  double delta_theta_primed = 0.1745329; /* arbitrarily initialized to 10 deg */
311  double dtp_tolerance = 4.85e-10; /* approximately 1/1000th of
312  an arc second or 1/10th meter */
313  long Error_Code = MOLL_NO_ERROR;
314 
315 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
316 // { /* Latitude out of range */
317 // Error_Code |= MOLL_LAT_ERROR;
318 // }
319 // if ((Longitude < -PI) || (Longitude > TWO_PI))
320 // { /* Longitude out of range */
321 // Error_Code|= MOLL_LON_ERROR;
322 // }
323 
324  if (!Error_Code)
325  { /* no errors */
326  dlam = Longitude - Moll_Origin_Long;
327 // if (dlam > PI)
328 // {
329 // dlam -= TWO_PI;
330 // }
331 // if (dlam < -PI)
332 // {
333 // dlam += TWO_PI;
334 // }
335  while (fabs(delta_theta_primed) > dtp_tolerance)
336  {
337  delta_theta_primed = -(theta_primed + sin(theta_primed) -
338  PI_Sin_Latitude) / (1.0 + cos(theta_primed));
339  theta_primed += delta_theta_primed;
340  }
341  theta = theta_primed / 2.0;
342  *Easting = (Sqrt8_Ra / M_PI ) * dlam * cos(theta) +
344  *Northing = Sqrt2_Ra * sin(theta) + Moll_False_Northing;
345 
346  }
347  return (Error_Code);
348 
349 } /* End Convert_Geodetic_To_Mollweide */
#define MOLL_NO_ERROR
#define M_PI

◆ Convert_Mollweide_To_Geodetic()

long ossimMollweidProjection::Convert_Mollweide_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

The function Convert_Mollweide_To_Geodetic converts Mollweide projection easting and northing coordinates to geodetic (latitude and longitude) coordinates, according to the current ellipsoid and Mollweide projection coordinates. If any errors occur, the error code(s) are returned by the function, otherwise MOLL_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 352 of file ossimMollweidProjection.cpp.

References M_PI, MAX_LAT, Moll_False_Easting, Moll_False_Northing, MOLL_NO_ERROR, Moll_Origin_Long, PI_OVER_2, Sqrt2_Ra, and Sqrt8_Ra.

Referenced by inverse().

356 { /* Begin Convert_Mollweide_To_Geodetic */
357 /*
358  * The function Convert_Mollweide_To_Geodetic converts Mollweide projection
359  * (easting and northing) coordinates to geodetic (latitude and longitude)
360  * coordinates, according to the current ellipsoid and Mollweide projection
361  * coordinates. If any errors occur, the error code(s) are returned by the
362  * function, otherwise MOLL_NO_ERROR is returned.
363  *
364  * Easting : Easting (X) in meters (input)
365  * Northing : Northing (Y) in meters (input)
366  * Latitude : Latitude (phi) in radians (output)
367  * Longitude : Longitude (lambda) in radians (output)
368  */
369 
370  double dx, dy;
371  double theta = 0.0;
372  double two_theta;
373  double i;
374 
375  long Error_Code = MOLL_NO_ERROR;
376 
377 // if ((Easting < (Moll_False_Easting + Moll_Min_Easting))
378 // || (Easting > (Moll_False_Easting + Moll_Max_Easting)))
379 // { /* Easting out of range */
380 // Error_Code |= MOLL_EASTING_ERROR;
381 // }
382 // if ((Northing < (Moll_False_Northing - Moll_Delta_Northing)) ||
383 // (Northing >(Moll_False_Northing + Moll_Delta_Northing) ))
384 // { /* Northing out of range */
385 // Error_Code |= MOLL_NORTHING_ERROR;
386 // }
387 
388  if (!Error_Code)
389  {
390  dy = Northing - Moll_False_Northing;
391  dx = Easting - Moll_False_Easting;
392  i = dy / Sqrt2_Ra;
393  if (fabs(i) > 1.0)
394  {
395  *Latitude = MAX_LAT;
396  if (Northing < 0.0)
397  *Latitude *= -1.0;
398  }
399 
400  else
401  {
402  theta = asin(i);
403  two_theta = 2.0 * theta;
404  *Latitude = asin((two_theta + sin(two_theta)) / M_PI);
405 
406  if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
407  *Latitude = PI_OVER_2;
408  else if (*Latitude < -PI_OVER_2)
409  *Latitude = -PI_OVER_2;
410 
411  }
412  if (fabs(fabs(*Latitude) - MAX_LAT) < 1.0e-10)
413  *Longitude = Moll_Origin_Long;
414  else
415  *Longitude = Moll_Origin_Long + M_PI * dx /
416  (Sqrt8_Ra * cos(theta));
417 
418 // if (*Longitude > PI)
419 // *Longitude -= TWO_PI;
420 // if (*Longitude < -PI)
421 // *Longitude += TWO_PI;
422 
423 // if (*Longitude > PI) /* force distorted values to 180, -180 degrees */
424 // *Longitude = PI;
425 // else if (*Longitude < -PI)
426 // *Longitude = -PI;
427 
428 
429  }
430  return (Error_Code);
431 
432 } /* End Convert_Mollweide_To_Geodetic */
#define PI_OVER_2
#define MOLL_NO_ERROR
#define M_PI
#define MAX_LAT

◆ dup()

virtual ossimObject* ossimMollweidProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 30 of file ossimMollweidProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 129 of file ossimMollweidProjection.cpp.

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

130 {
131  double easting = 0.0;
132  double northing = 0.0;
133  ossimGpt gpt = latLon;
134 
135  if (theDatum)
136  {
137  if (theDatum->code() != latLon.datum()->code())
138  {
139  gpt.changeDatum(theDatum); // Shift to our datum.
140  }
141  }
142 
144  gpt.lonr(),
145  &easting,
146  &northing);
147 
148  return ossimDpt(easting, northing);
149 }
virtual const ossimString & code() const
Definition: ossimDatum.h:57
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
Definition: ossimGpt.cpp:316
long Convert_Geodetic_To_Mollweide(double Latitude, double Longitude, double *Easting, double *Northing) const
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
double latr() const
latr().
Definition: ossimGpt.h:66
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ Get_Mollweide_Parameters()

void ossimMollweidProjection::Get_Mollweide_Parameters ( double *  a,
double *  f,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Mollweide_Parameters returns the current ellipsoid parameters and Mollweide 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 257 of file ossimMollweidProjection.cpp.

References Moll_a, Moll_f, Moll_False_Easting, Moll_False_Northing, and Moll_Origin_Long.

262 { /* Begin Get_Mollweide_Parameters */
263 /*
264  * The function Get_Mollweide_Parameters returns the current ellipsoid
265  * parameters and Mollweide projection parameters.
266  *
267  * a : Semi-major axis of ellipsoid, in meters (output)
268  * f : Flattening of ellipsoid (output)
269  * Central_Meridian : Longitude in radians at the center of (output)
270  * the projection
271  * False_Easting : A coordinate value in meters assigned to the
272  * central meridian of the projection. (output)
273  * False_Northing : A coordinate value in meters assigned to the
274  * origin latitude of the projection (output)
275  */
276 
277  *a = Moll_a;
278  *f = Moll_f;
279  *Central_Meridian = Moll_Origin_Long;
280  *False_Easting = Moll_False_Easting;
281  *False_Northing = Moll_False_Northing;
282 
283  return;
284 } /* End Get_Mollweide_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 59 of file ossimMollweidProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 60 of file ossimMollweidProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 116 of file ossimMollweidProjection.cpp.

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

117 {
118  double lat = 0.0;
119  double lon = 0.0;
120 
121  Convert_Mollweide_To_Geodetic(eastingNorthing.x,
122  eastingNorthing.y,
123  &lat,
124  &lon);
125 
126  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
127 }
#define DEG_PER_RAD
long Convert_Mollweide_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 ossimMollweidProjection::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 156 of file ossimMollweidProjection.cpp.

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

158 {
159  bool flag = ossimMapProjection::loadState(kwl, prefix);
160 
161  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
162 
163  setDefaults();
164 
166  {
169  }
170  update();
171 
172  return flag;
173 }
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.

◆ operator==()

bool ossimMollweidProjection::operator== ( const ossimProjection projection) const
virtual

Returns TRUE if principal parameters are within epsilon tolerance.

Reimplemented from ossimMapProjection.

Definition at line 437 of file ossimMollweidProjection.cpp.

References ossim::almostEqual(), and Moll_Origin_Long.

438 {
439  if (!ossimMapProjection::operator==(proj))
440  return false;
441 
442  const ossimMollweidProjection* p = dynamic_cast<const ossimMollweidProjection*>(&proj);
443  if (!p) return false;
444 
446 
447  return true;
448 }
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53

◆ saveState()

bool ossimMollweidProjection::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 151 of file ossimMollweidProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Mollweide_Parameters()

long ossimMollweidProjection::Set_Mollweide_Parameters ( double  a,
double  f,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
private

The function Set_Mollweide_Parameters receives the ellipsoid parameters and Mollweide projcetion parameters as inputs, and sets the corresponding state variables. If any errors occur, the error code(s) are returned by the function, otherwise MOLL_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 181 of file ossimMollweidProjection.cpp.

References es2, es4, es6, Moll_a, Moll_f, Moll_False_Easting, Moll_False_Northing, Moll_Max_Easting, Moll_Min_Easting, MOLL_NO_ERROR, Moll_Origin_Long, Sqrt2_Ra, and Sqrt8_Ra.

Referenced by update().

186 { /* Begin Set_Mollweide_Parameters */
187 /*
188  * The function Set_Mollweide_Parameters receives the ellipsoid parameters and
189  * Mollweide projcetion parameters as inputs, and sets the corresponding state
190  * variables. If any errors occur, the error code(s) are returned by the
191  * function, otherwise MOLL_NO_ERROR is returned.
192  *
193  * a : Semi-major axis of ellipsoid, in meters (input)
194  * f : Flattening of ellipsoid (input)
195  * Central_Meridian : Longitude in radians at the center of (input)
196  * the projection
197  * False_Easting : A coordinate value in meters assigned to the
198  * central meridian of the projection. (input)
199  * False_Northing : A coordinate value in meters assigned to the
200  * origin latitude of the projection (input)
201  */
202 
203  double Ra; /* Spherical Radius */
204 // double inv_f = 1 / f;
205  long Error_Code = MOLL_NO_ERROR;
206 
207 // if (a <= 0.0)
208 // { /* Semi-major axis must be greater than zero */
209 // Error_Code |= MOLL_A_ERROR;
210 // }
211 // if ((inv_f < 250) || (inv_f > 350))
212 // { /* Inverse flattening must be between 250 and 350 */
213 // Error_Code |= MOLL_INV_F_ERROR;
214 // }
215 // if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
216 // { /* origin longitude out of range */
217 // Error_Code |= MOLL_CENT_MER_ERROR;
218 // }
219  if (!Error_Code)
220  { /* no errors */
221  Moll_a = a;
222  Moll_f = f;
223  es2 = 2 * Moll_f - Moll_f * Moll_f;
224  es4 = es2 * es2;
225  es6 = es4 * es2;
226  /* spherical radius */
227  Ra = Moll_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 / 3024.0);
228  Sqrt2_Ra = sqrt(2.0) * Ra;
229  Sqrt8_Ra = sqrt(8.0) * Ra;
230 // if (Central_Meridian > PI)
231 // Central_Meridian -= TWO_PI;
232  Moll_Origin_Long = Central_Meridian;
233  Moll_False_Easting = False_Easting;
234  Moll_False_Northing = False_Northing;
235 
236  if (Moll_Origin_Long > 0)
237  {
238  Moll_Max_Easting = 17919819.0;
239  Moll_Min_Easting = -18019930.0;
240  }
241  else if (Moll_Origin_Long < 0)
242  {
243  Moll_Max_Easting = 18019930.0;
244  Moll_Min_Easting = -17919819.0;
245  }
246  else
247  {
248  Moll_Max_Easting = 18019930.0;
249  Moll_Min_Easting = -18019930.0;
250  }
251 
252  } /* End if(!Error_Code) */
253  return (Error_Code);
254 } /* End Set_Mollweide_Parameters */
#define MOLL_NO_ERROR

◆ setCentralMeridian()

void ossimMollweidProjection::setCentralMeridian ( double  centralMeridian)

Definition at line 110 of file ossimMollweidProjection.cpp.

References Moll_Origin_Long, and update().

111 {
112  Moll_Origin_Long = centralMeridian;
113  update();
114 }

◆ setDefaults()

void ossimMollweidProjection::setDefaults ( )

◆ setFalseEasting()

void ossimMollweidProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 80 of file ossimMollweidProjection.cpp.

References Moll_False_Easting, and update().

81 {
82  Moll_False_Easting = falseEasting;
83  update();
84 }

◆ setFalseEastingNorthing()

void ossimMollweidProjection::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 101 of file ossimMollweidProjection.cpp.

References Moll_False_Easting, Moll_False_Northing, and update().

103 {
104  Moll_False_Easting = falseEasting;
105  Moll_False_Northing = falseNorthing;
106 
107  update();
108 }

◆ setFalseNorthing()

void ossimMollweidProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 86 of file ossimMollweidProjection.cpp.

References Moll_False_Northing, and update().

87 {
88  Moll_False_Northing = falseNorthing;
89  update();
90 }

◆ update()

void ossimMollweidProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 65 of file ossimMollweidProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::lonr(), Moll_False_Easting, Moll_False_Northing, Set_Mollweide_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

Referenced by loadState(), ossimMollweidProjection(), setCentralMeridian(), setFalseEasting(), setFalseEastingNorthing(), and setFalseNorthing().

66 {
67 
70  theOrigin.lonr(),
73 
76 
78 }
long Set_Mollweide_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

◆ es2

double ossimMollweidProjection::es2
mutableprivate

Definition at line 84 of file ossimMollweidProjection.h.

Referenced by Set_Mollweide_Parameters().

◆ es4

double ossimMollweidProjection::es4
mutableprivate

Definition at line 85 of file ossimMollweidProjection.h.

Referenced by Set_Mollweide_Parameters().

◆ es6

double ossimMollweidProjection::es6
mutableprivate

Definition at line 86 of file ossimMollweidProjection.h.

Referenced by Set_Mollweide_Parameters().

◆ Moll_a

double ossimMollweidProjection::Moll_a
mutableprivate

Definition at line 82 of file ossimMollweidProjection.h.

Referenced by Get_Mollweide_Parameters(), and Set_Mollweide_Parameters().

◆ Moll_Delta_Northing

double ossimMollweidProjection::Moll_Delta_Northing
mutableprivate

Definition at line 94 of file ossimMollweidProjection.h.

Referenced by ossimMollweidProjection(), and setDefaults().

◆ Moll_f

double ossimMollweidProjection::Moll_f
mutableprivate

Definition at line 83 of file ossimMollweidProjection.h.

Referenced by Get_Mollweide_Parameters(), and Set_Mollweide_Parameters().

◆ Moll_False_Easting

double ossimMollweidProjection::Moll_False_Easting
mutableprivate

◆ Moll_False_Northing

double ossimMollweidProjection::Moll_False_Northing
mutableprivate

◆ Moll_Max_Easting

double ossimMollweidProjection::Moll_Max_Easting
mutableprivate

◆ Moll_Min_Easting

double ossimMollweidProjection::Moll_Min_Easting
mutableprivate

◆ Moll_Origin_Long

double ossimMollweidProjection::Moll_Origin_Long
mutableprivate

◆ Sqrt2_Ra

double ossimMollweidProjection::Sqrt2_Ra
mutableprivate

◆ Sqrt8_Ra

double ossimMollweidProjection::Sqrt8_Ra
mutableprivate

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