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

#include <ossimCylEquAreaProjection.h>

Inheritance diagram for ossimCylEquAreaProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimCylEquAreaProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimCylEquAreaProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, double falseEasting, double falseNorthing)
 
 ~ossimCylEquAreaProjection ()
 
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_Cyl_Eq_Area_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Cyl_Eq_Area_Parameters (double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Cyl_Eq_Area (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Cyl_Eq_Area_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Cyeq_a
 
double Cyeq_f
 
double es2
 
double es
 
double es4
 
double es6
 
double k0
 
double Cyeq_a_k0
 
double two_k0
 
double c0
 
double c1
 
double c2
 
double Cyeq_Origin_Lat
 
double Cyeq_Origin_Long
 
double Cyeq_False_Northing
 
double Cyeq_False_Easting
 
double Cyeq_Max_Easting
 
double Cyeq_Min_Easting
 
double Cyeq_Delta_Northing
 

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 ossimCylEquAreaProjection.h.

Constructor & Destructor Documentation

◆ ossimCylEquAreaProjection() [1/2]

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

Definition at line 51 of file ossimCylEquAreaProjection.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())

◆ ossimCylEquAreaProjection() [2/2]

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

Definition at line 59 of file ossimCylEquAreaProjection.cpp.

References Cyeq_Delta_Northing, Cyeq_False_Easting, Cyeq_False_Northing, Cyeq_Max_Easting, Cyeq_Min_Easting, and update().

63  :ossimMapProjection(ellipsoid, origin)
64 {
65  Cyeq_False_Easting = falseEasting;
66  Cyeq_False_Northing = falseNorthing;
67  Cyeq_Max_Easting = 20037509.0;
68  Cyeq_Min_Easting = -20037509.0;
69  Cyeq_Delta_Northing = 6363886.0;
70 
71  update();
72 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimCylEquAreaProjection()

ossimCylEquAreaProjection::~ossimCylEquAreaProjection ( )
inline

Definition at line 27 of file ossimCylEquAreaProjection.h.

27 {}

Member Function Documentation

◆ Convert_Cyl_Eq_Area_To_Geodetic()

long ossimCylEquAreaProjection::Convert_Cyl_Eq_Area_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

The function Convert_Cyl_Eq_Area_To_Geodetic converts Cylindrical Equal Area projection easting and northing coordinates to geodetic (latitude and longitude) coordinates, according to the current ellipsoid and Cylindrical Equal Area projection coordinates. If any errors occur, the error code(s) are returned by the function, otherwise CYEQ_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 364 of file ossimCylEquAreaProjection.cpp.

References c0, c1, c2, Cyeq_a, Cyeq_a_k0, CYEQ_COEFF_TIMES_SIN, Cyeq_False_Easting, Cyeq_False_Northing, CYEQ_NO_ERROR, Cyeq_Origin_Long, CYLEQAR_Q, es, PI_OVER_2, two_k0, and x.

Referenced by inverse().

368 { /* Begin Convert_Cyl_Eq_Area_To_Geodetic */
369 /*
370  * The function Convert_Cyl_Eq_Area_To_Geodetic converts
371  * Cylindrical Equal Area projection (easting and northing) coordinates
372  * to geodetic (latitude and longitude) coordinates, according to the
373  * current ellipsoid and Cylindrical Equal Area projection
374  * coordinates. If any errors occur, the error code(s) are returned by the
375  * function, otherwise CYEQ_NO_ERROR is returned.
376  *
377  * Easting : Easting (X) in meters (input)
378  * Northing : Northing (Y) in meters (input)
379  * Latitude : Latitude (phi) in radians (output)
380  * Longitude : Longitude (lambda) in radians (output)
381  */
382 
383  double sin2beta, sin4beta, sin6beta;
384  double dx; /* Delta easting - Difference in easting (easting-FE) */
385  double dy; /* Delta northing - Difference in northing (northing-FN) */
386  double qp;
387  double beta;
388  double sin_lat = sin(PI_OVER_2);
389  double i;
390  double x;
391  long Error_Code = CYEQ_NO_ERROR;
392 
393 // if ((Easting < (Cyeq_False_Easting + Cyeq_Min_Easting))
394 // || (Easting > (Cyeq_False_Easting + Cyeq_Max_Easting)))
395 // { /* Easting out of range */
396 // Error_Code |= CYEQ_EASTING_ERROR;
397 // }
398 // if ((Northing < (Cyeq_False_Northing - fabs(Cyeq_Delta_Northing)))
399 // || (Northing > (Cyeq_False_Northing + fabs(Cyeq_Delta_Northing))))
400 // { /* Northing out of range */
401 // Error_Code |= CYEQ_NORTHING_ERROR;
402 // }
403  if (!Error_Code)
404  { /* no errors */
405  dy = Northing - Cyeq_False_Northing;
406  dx = Easting - Cyeq_False_Easting;
407  x = es * sin_lat;
408  qp = CYLEQAR_Q(sin_lat,x);
409  i = two_k0 * dy / (Cyeq_a * qp);
410  if (i > 1.0)
411  i = 1.0;
412  else if (i < -1.0)
413  i = -1.0;
414  beta = asin(i);
415  sin2beta = CYEQ_COEFF_TIMES_SIN(c0, 2.0, beta);
416  sin4beta = CYEQ_COEFF_TIMES_SIN(c1, 4.0, beta);
417  sin6beta = CYEQ_COEFF_TIMES_SIN(c2, 6.0, beta);
418  *Latitude = beta + sin2beta + sin4beta + sin6beta;
419  *Longitude = Cyeq_Origin_Long + dx / Cyeq_a_k0;
420 
421 // if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
422 // *Latitude = PI_OVER_2;
423 // else if (*Latitude < -PI_OVER_2)
424 // *Latitude = -PI_OVER_2;
425 
426 // if (*Longitude > PI)
427 // *Longitude -= TWO_PI;
428 // if (*Longitude < -PI)
429 // *Longitude += TWO_PI;
430 
431 // if (*Longitude > PI) /* force distorted values to 180, -180 degrees */
432 // *Longitude = PI;
433 // else if (*Longitude < -PI)
434 // *Longitude = -PI;
435 
436 
437  }
438  return (Error_Code);
439 } /* End Convert_Cyl_Eq_Area_To_Geodetic */
ossim_uint32 x
#define CYEQ_NO_ERROR
#define CYEQ_COEFF_TIMES_SIN(coeff, c, Beta)
#define PI_OVER_2
#define CYLEQAR_Q(slat, x)

◆ Convert_Geodetic_To_Cyl_Eq_Area()

long ossimCylEquAreaProjection::Convert_Geodetic_To_Cyl_Eq_Area ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

The function Convert_Geodetic_To_Cyl_Eq_Area converts geodetic (latitude and longitude) coordinates to Cylindrical Equal Area projection easting, and northing coordinates, according to the current ellipsoid and Cylindrical Equal Area projection parameters. If any errors occur, the error code(s) are returned by the function, otherwise CYEQ_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 312 of file ossimCylEquAreaProjection.cpp.

References Cyeq_a, Cyeq_a_k0, Cyeq_False_Easting, Cyeq_False_Northing, CYEQ_NO_ERROR, Cyeq_Origin_Long, CYLEQAR_Q, es, two_k0, and x.

Referenced by forward(), and Set_Cyl_Eq_Area_Parameters().

316 { /* Begin Convert_Geodetic_To_Cyl_Eq_Area */
317 /*
318  * The function Convert_Geodetic_To_Cyl_Eq_Area converts geodetic (latitude and
319  * longitude) coordinates to Cylindrical Equal Area projection (easting and northing)
320  * coordinates, according to the current ellipsoid and Cylindrical Equal Area projection
321  * parameters. If any errors occur, the error code(s) are returned by the
322  * function, otherwise CYEQ_NO_ERROR is returned.
323  *
324  * Latitude : Latitude (phi) in radians (input)
325  * Longitude : Longitude (lambda) in radians (input)
326  * Easting : Easting (X) in meters (output)
327  * Northing : Northing (Y) in meters (output)
328  */
329 
330  double dlam; /* Longitude - Central Meridan */
331  double qq;
332  double x;
333  double sin_lat = sin(Latitude);
334  long Error_Code = CYEQ_NO_ERROR;
335 
336 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
337 // { /* Latitude out of range */
338 // Error_Code |= CYEQ_LAT_ERROR;
339 // }
340 // if ((Longitude < -PI) || (Longitude > TWO_PI))
341 // { /* Longitude out of range */
342 // Error_Code |= CYEQ_LON_ERROR;
343 // }
344  if (!Error_Code)
345  { /* no errors */
346  dlam = Longitude - Cyeq_Origin_Long;
347 // if (dlam > PI)
348 // {
349 // dlam -= TWO_PI;
350 // }
351 // if (dlam < -PI)
352 // {
353 // dlam += TWO_PI;
354 // }
355  x = es * sin_lat;
356  qq = CYLEQAR_Q(sin_lat,x);
357  *Easting = Cyeq_a_k0 * dlam + Cyeq_False_Easting;
358  *Northing = Cyeq_a * qq / two_k0 + Cyeq_False_Northing;
359  }
360  return (Error_Code);
361 } /* End Convert_Geodetic_To_Cyl_Eq_Area */
ossim_uint32 x
#define CYEQ_NO_ERROR
#define CYLEQAR_Q(slat, x)

◆ dup()

virtual ossimObject* ossimCylEquAreaProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 28 of file ossimCylEquAreaProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 135 of file ossimCylEquAreaProjection.cpp.

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

136 {
137  double easting = 0.0;
138  double northing = 0.0;
139  ossimGpt gpt = latLon;
140 
141  if (theDatum)
142  {
143  if (theDatum->code() != latLon.datum()->code())
144  {
145  gpt.changeDatum(theDatum); // Shift to our datum.
146  }
147  }
148 
150  gpt.lonr(),
151  &easting,
152  &northing);
153 
154  return ossimDpt(easting, northing);
155 
156 }
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_Cyl_Eq_Area(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_Cyl_Eq_Area_Parameters()

void ossimCylEquAreaProjection::Get_Cyl_Eq_Area_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Cyl_Eq_Area_Parameters returns the current ellipsoid parameters and Cylindrical Equal Area projection parameters.

a : Semi-major axis of ellipsoid, in meters (output) f : Flattening of ellipsoid (output) Origin_Latitude : Latitude in radians at which the (output) point scale factor is 1.0 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 279 of file ossimCylEquAreaProjection.cpp.

References Cyeq_a, Cyeq_f, Cyeq_False_Easting, Cyeq_False_Northing, Cyeq_Origin_Lat, and Cyeq_Origin_Long.

285 { /* Begin Get_Cyl_Eq_Area_Parameters */
286 /*
287  * The function Get_Cyl_Eq_Area_Parameters returns the current ellipsoid
288  * parameters, and Cylindrical Equal Area projection parameters.
289  *
290  * a : Semi-major axis of ellipsoid, in meters (output)
291  * f : Flattening of ellipsoid (output)
292  * Origin_Latitude : Latitude in radians at which the (output)
293  * point scale factor is 1.0
294  * Central_Meridian : Longitude in radians at the center of (output)
295  * the projection
296  * False_Easting : A coordinate value in meters assigned to the
297  * central meridian of the projection. (output)
298  * False_Northing : A coordinate value in meters assigned to the
299  * origin latitude of the projection (output)
300  */
301 
302  *a = Cyeq_a;
303  *f = Cyeq_f;
304  *Origin_Latitude = Cyeq_Origin_Lat;
305  *Central_Meridian = Cyeq_Origin_Long;
306  *False_Easting = Cyeq_False_Easting;
307  *False_Northing = Cyeq_False_Northing;
308  return;
309 } /* End Get_Cyl_Eq_Area_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 56 of file ossimCylEquAreaProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 57 of file ossimCylEquAreaProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 123 of file ossimCylEquAreaProjection.cpp.

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

124 {
125  double lat = 0.0;
126  double lon = 0.0;
127 
128  Convert_Cyl_Eq_Area_To_Geodetic(eastingNorthing.x,
129  eastingNorthing.y,
130  &lat,
131  &lon);
132  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0, theDatum);
133 }
#define DEG_PER_RAD
long Convert_Cyl_Eq_Area_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 ossimCylEquAreaProjection::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 163 of file ossimCylEquAreaProjection.cpp.

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

164 {
165  bool flag = ossimMapProjection::loadState(kwl, prefix);
166 
167  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
168 
169  setDefaults();
170 
172  {
175  }
176 
177  update();
178 
179  return flag;
180 }
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 ossimCylEquAreaProjection::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 158 of file ossimCylEquAreaProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Cyl_Eq_Area_Parameters()

long ossimCylEquAreaProjection::Set_Cyl_Eq_Area_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
private

The function Set_Cyl_Eq_Area_Parameters receives the ellipsoid parameters and Cylindrical Equal Area projcetion parameters as inputs, and sets the corresponding state variables. If any errors occur, the error code(s) are returned by the function, otherwise CYEQ_NO_ERROR is returned.

a : Semi-major axis of ellipsoid, in meters (input) f : Flattening of ellipsoid (input) Origin_Latitude : Latitude in radians at which the (input) point scale factor is 1.0 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 188 of file ossimCylEquAreaProjection.cpp.

References c0, c1, c2, Convert_Geodetic_To_Cyl_Eq_Area(), Cyeq_a, Cyeq_a_k0, Cyeq_Delta_Northing, Cyeq_f, Cyeq_False_Easting, Cyeq_False_Northing, Cyeq_Max_Easting, Cyeq_Min_Easting, CYEQ_NO_ERROR, Cyeq_Origin_Lat, Cyeq_Origin_Long, es, es2, es4, es6, k0, M_PI, ONE, PI_OVER_2, two_k0, and TWO_PI.

Referenced by update().

194 { /* Begin Set_Cyl_Eq_Area_Parameters */
195 /*
196  * The function Set_Cyl_Eq_Area_Parameters receives the ellipsoid parameters and
197  * Cylindrical Equal Area projcetion parameters as inputs, and sets the corresponding
198  * state variables. If any errors occur, the error code(s) are returned by the
199  * function, otherwise CYEQ_NO_ERROR is returned.
200  *
201  * a : Semi-major axis of ellipsoid, in meters (input)
202  * f : Flattening of ellipsoid (input)
203  * Origin_Latitude : Latitude in radians at which the (input)
204  * point scale factor is 1.0
205  * Central_Meridian : Longitude in radians at the center of (input)
206  * the projection
207  * False_Easting : A coordinate value in meters assigned to the
208  * central meridian of the projection. (input)
209  * False_Northing : A coordinate value in meters assigned to the
210  * origin latitude of the projection (input)
211  */
212 
213  double Sin_Cyeq_Origin_Lat;
214  double temp;
215 // double inv_f = 1 / f;
216  long Error_Code = CYEQ_NO_ERROR;
217 
218 // if (a <= 0.0)
219 // { /* Semi-major axis must be greater than zero */
220 // Error_Code |= CYEQ_A_ERROR;
221 // }
222 // if ((inv_f < 250) || (inv_f > 350))
223 // { /* Inverse flattening must be between 250 and 350 */
224 // Error_Code |= CYEQ_INV_F_ERROR;
225 // }
226 // if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
227 // { /* origin latitude out of range */
228 // Error_Code |= CYEQ_ORIGIN_LAT_ERROR;
229 // }
230 // if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
231 // { /* origin longitude out of range */
232 // Error_Code |= CYEQ_CENT_MER_ERROR;
233 // }
234  if (!Error_Code)
235  { /* no errors */
236  Cyeq_a = a;
237  Cyeq_f = f;
238  Cyeq_Origin_Lat = Origin_Latitude;
239  if (Central_Meridian > M_PI)
240  Central_Meridian -= TWO_PI;
241  Cyeq_Origin_Long = Central_Meridian;
242  Cyeq_False_Northing = False_Northing;
243  Cyeq_False_Easting = False_Easting;
244  es2 = 2 * Cyeq_f - Cyeq_f * Cyeq_f;
245  es4 = es2 * es2;
246  es6 = es4 * es2;
247  es = sqrt(es2);
248  c0 = es2 / 3.0 + 31.0 * es4 / 180.0 + 517.0 * es6 / 5040.0;
249  c1 = 23.0 * es4 / 360.0 + 251.0 * es6 / 3780.0;
250  c2 = 761.0 * es6 / 45360.0;
251  Sin_Cyeq_Origin_Lat = sin(Cyeq_Origin_Lat);
252  k0 = cos(Cyeq_Origin_Lat) / sqrt(1.0 - es2 * Sin_Cyeq_Origin_Lat * Sin_Cyeq_Origin_Lat);
253  Cyeq_a_k0 = Cyeq_a * k0;
254  two_k0 = 2.0 * k0;
255 
256  if (Cyeq_Origin_Long > 0)
257  {
261  }
262  else if (Cyeq_Origin_Long < 0)
263  {
267  }
268  else
269  {
272  }
273 
274  } /* End if(!Error_Code) */
275  return (Error_Code);
276 } /* End Set_Cyl_Eq_Area_Parameters */
#define CYEQ_NO_ERROR
#define PI_OVER_2
#define TWO_PI
#define M_PI
long Convert_Geodetic_To_Cyl_Eq_Area(double Latitude, double Longitude, double *Easting, double *Northing) const

◆ setDefaults()

void ossimCylEquAreaProjection::setDefaults ( )

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

Definition at line 94 of file ossimCylEquAreaProjection.cpp.

References Cyeq_Delta_Northing, Cyeq_False_Easting, Cyeq_False_Northing, Cyeq_Max_Easting, and Cyeq_Min_Easting.

Referenced by loadState(), and ossimCylEquAreaProjection().

◆ setFalseEasting()

void ossimCylEquAreaProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 74 of file ossimCylEquAreaProjection.cpp.

References Cyeq_False_Easting, and update().

75 {
76  Cyeq_False_Easting = falseEasting;
77  update();
78 }

◆ setFalseEastingNorthing()

void ossimCylEquAreaProjection::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 86 of file ossimCylEquAreaProjection.cpp.

References Cyeq_False_Easting, Cyeq_False_Northing, and update().

88 {
89  Cyeq_False_Easting = falseEasting;
90  Cyeq_False_Northing = falseNorthing;
91  update();
92 }

◆ setFalseNorthing()

void ossimCylEquAreaProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 80 of file ossimCylEquAreaProjection.cpp.

References Cyeq_False_Northing, and update().

81 {
82  Cyeq_False_Northing = falseNorthing;
83  update();
84 }

◆ update()

void ossimCylEquAreaProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 103 of file ossimCylEquAreaProjection.cpp.

References Cyeq_Delta_Northing, Cyeq_False_Easting, Cyeq_False_Northing, Cyeq_Max_Easting, Cyeq_Min_Easting, ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::latr(), ossimGpt::lonr(), Set_Cyl_Eq_Area_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

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

104 {
105  Cyeq_Max_Easting = 20037509.0;
106  Cyeq_Min_Easting = -20037509.0;
107  Cyeq_Delta_Northing = 6363886.0;
108 
111  theOrigin.latr(),
112  theOrigin.lonr(),
115 
118 
120 }
double y
Definition: ossimDpt.h:165
long Set_Cyl_Eq_Area_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
const double & getA() const
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
double x
Definition: ossimDpt.h:164
double latr() const
latr().
Definition: ossimGpt.h:66
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

◆ c0

double ossimCylEquAreaProjection::c0
mutableprivate

◆ c1

double ossimCylEquAreaProjection::c1
mutableprivate

◆ c2

double ossimCylEquAreaProjection::c2
mutableprivate

◆ Cyeq_a

double ossimCylEquAreaProjection::Cyeq_a
mutableprivate

◆ Cyeq_a_k0

double ossimCylEquAreaProjection::Cyeq_a_k0
mutableprivate

◆ Cyeq_Delta_Northing

double ossimCylEquAreaProjection::Cyeq_Delta_Northing
mutableprivate

◆ Cyeq_f

double ossimCylEquAreaProjection::Cyeq_f
mutableprivate

◆ Cyeq_False_Easting

double ossimCylEquAreaProjection::Cyeq_False_Easting
mutableprivate

◆ Cyeq_False_Northing

double ossimCylEquAreaProjection::Cyeq_False_Northing
mutableprivate

◆ Cyeq_Max_Easting

double ossimCylEquAreaProjection::Cyeq_Max_Easting
mutableprivate

◆ Cyeq_Min_Easting

double ossimCylEquAreaProjection::Cyeq_Min_Easting
mutableprivate

◆ Cyeq_Origin_Lat

double ossimCylEquAreaProjection::Cyeq_Origin_Lat
mutableprivate

◆ Cyeq_Origin_Long

double ossimCylEquAreaProjection::Cyeq_Origin_Long
mutableprivate

◆ es

double ossimCylEquAreaProjection::es
mutableprivate

◆ es2

double ossimCylEquAreaProjection::es2
mutableprivate

Definition at line 85 of file ossimCylEquAreaProjection.h.

Referenced by Set_Cyl_Eq_Area_Parameters().

◆ es4

double ossimCylEquAreaProjection::es4
mutableprivate

Definition at line 87 of file ossimCylEquAreaProjection.h.

Referenced by Set_Cyl_Eq_Area_Parameters().

◆ es6

double ossimCylEquAreaProjection::es6
mutableprivate

Definition at line 88 of file ossimCylEquAreaProjection.h.

Referenced by Set_Cyl_Eq_Area_Parameters().

◆ k0

double ossimCylEquAreaProjection::k0
mutableprivate

Definition at line 89 of file ossimCylEquAreaProjection.h.

Referenced by Set_Cyl_Eq_Area_Parameters().

◆ two_k0

double ossimCylEquAreaProjection::two_k0
mutableprivate

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