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

#include <ossimTransCylEquAreaProjection.h>

Inheritance diagram for ossimTransCylEquAreaProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimTransCylEquAreaProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(6378137, 6356752.3142), const ossimGpt &origin=ossimGpt())
 
 ossimTransCylEquAreaProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, double falseEasting, double falseNorthing, double scaleFactor)
 
 ~ossimTransCylEquAreaProjection ()
 
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 setScaleFactor (double scaleFactor)
 
void setFalseEastingNorthing (double falseEasting, double falseNorthing)
 
void setParameters (double falseEasting, double falseNorthing, double scaleFactor)
 
void setDefaults ()
 
double getFalseEasting () const
 
double getFalseNorthing () const
 
double getScaleFactor () 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_Trans_Cyl_Eq_Area_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing, double Scale_Factor)
 
void Get_Trans_Cyl_Eq_Area_Parameters (double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing, double *Scale_Factor) const
 
long Convert_Geodetic_To_Trans_Cyl_Eq_Area (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Trans_Cyl_Eq_Area_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Tcea_a
 
double Tcea_f
 
double es2
 
double es4
 
double es6
 
double es
 
double M0
 
double qp
 
double One_MINUS_es2
 
double One_OVER_2es
 
double a0
 
double a1
 
double a2
 
double b0
 
double b1
 
double b2
 
double b3
 
double c0
 
double c1
 
double c2
 
double c3
 
double Tcea_Origin_Lat
 
double Tcea_Origin_Long
 
double Tcea_False_Northing
 
double Tcea_False_Easting
 
double Tcea_Scale_Factor
 
double Tcea_Min_Easting
 
double Tcea_Max_Easting
 
double Tcea_Min_Northing
 
double Tcea_Max_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 ossimTransCylEquAreaProjection.h.

Constructor & Destructor Documentation

◆ ossimTransCylEquAreaProjection() [1/2]

ossimTransCylEquAreaProjection::ossimTransCylEquAreaProjection ( const ossimEllipsoid ellipsoid = ossimEllipsoid(6378137, 6356752.3142),
const ossimGpt origin = ossimGpt() 
)

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

◆ ossimTransCylEquAreaProjection() [2/2]

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

Definition at line 59 of file ossimTransCylEquAreaProjection.cpp.

References Tcea_False_Easting, Tcea_False_Northing, Tcea_Max_Easting, Tcea_Max_Northing, Tcea_Min_Easting, Tcea_Min_Northing, Tcea_Scale_Factor, and update().

64  :ossimMapProjection(ellipsoid, origin)
65 {
66  Tcea_False_Easting = falseEasting;
67  Tcea_False_Northing = falseNorthing;
68  Tcea_Scale_Factor = scaleFactor;
69  Tcea_Min_Easting = -6398628.0;
70  Tcea_Max_Easting = 6398628.0;
71  Tcea_Min_Northing = -20003931.0;
72  Tcea_Max_Northing = 20003931.0;
73 
74  update();
75 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimTransCylEquAreaProjection()

ossimTransCylEquAreaProjection::~ossimTransCylEquAreaProjection ( )
inline

Definition at line 29 of file ossimTransCylEquAreaProjection.h.

29 {}

Member Function Documentation

◆ Convert_Geodetic_To_Trans_Cyl_Eq_Area()

long ossimTransCylEquAreaProjection::Convert_Geodetic_To_Trans_Cyl_Eq_Area ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

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

References a0, a1, a2, c0, c1, c2, c3, es, es2, M0, M_PI, PI_OVER_2, qp, Tcea_a, TCEA_COEFF_TIMES_SIN, Tcea_False_Easting, Tcea_False_Northing, TCEA_L, TCEA_LON_WARNING, TCEA_M, TCEA_NO_ERROR, Tcea_Origin_Long, TCEA_Q, Tcea_Scale_Factor, TWO_PI, and x.

Referenced by forward(), and Set_Trans_Cyl_Eq_Area_Parameters().

380 { /* BEGIN Convert_Geodetic_To_Trans_Cyl_Eq_Area */
381 /*
382  * The function Convert_Geodetic_To_Trans_Cyl_Eq_Area converts geodetic (latitude and
383  * longitude) coordinates to Transverse Cylindrical Equal Area projection (easting and
384  * northing) coordinates, according to the current ellipsoid and Transverse Cylindrical
385  * Equal Area projection parameters. If any errors occur, the error code(s) are returned
386  * by the function, otherwise TCEA_NO_ERROR is returned.
387  *
388  * Latitude : Latitude (phi) in radians (input)
389  * Longitude : Longitude (lambda) in radians (input)
390  * Easting : Easting (X) in meters (output)
391  * Northing : Northing (Y) in meters (output)
392  */
393 
394  double x;
395  double dlam; /* Longitude - Central Meridan */
396  double sin_lat = sin(Latitude);
397  double qq, qq_OVER_qp;
398  double beta, betac;
399  double sin2betac, sin4betac, sin6betac;
400  double PHIc;
401  double phi, sin2phi, sin4phi, sin6phi;
402  double sinPHIc;
403  double Mc;
404  long Error_Code = TCEA_NO_ERROR;
405 
406 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
407 // { /* Latitude out of range */
408 // Error_Code |= TCEA_LAT_ERROR;
409 // }
410 // if ((Longitude < -M_PI) || (Longitude > TWO_PI))
411 // { /* Longitude out of range */
412 // Error_Code |= TCEA_LON_ERROR;
413 // }
414  if (!Error_Code)
415  { /* no errors */
416  dlam = Longitude - Tcea_Origin_Long;
417  if (fabs(dlam) >= (M_PI / 2.0))
418  { /* Distortion will result if Longitude is more than 90 degrees from the Central Meridian */
419  Error_Code |= TCEA_LON_WARNING;
420  }
421 
422  if (dlam > M_PI)
423  {
424  dlam -= TWO_PI;
425  }
426  if (dlam < -M_PI)
427  {
428  dlam += TWO_PI;
429  }
430  if (Latitude == PI_OVER_2)
431  {
432  qq = qp;
433  qq_OVER_qp = 1.0;
434  }
435  else
436  {
437  x = es * sin_lat;
438  qq = TCEA_Q(sin_lat, x);
439  qq_OVER_qp = qq / qp;
440  }
441 
442 
443  if (qq_OVER_qp > 1.0)
444  qq_OVER_qp = 1.0;
445  else if (qq_OVER_qp < -1.0)
446  qq_OVER_qp = -1.0;
447 
448  beta = asin(qq_OVER_qp);
449  betac = atan(tan(beta) / cos(dlam));
450 
451  if ((fabs(betac) - PI_OVER_2) > 1.0e-8)
452  PHIc = betac;
453  else
454  {
455  sin2betac = TCEA_COEFF_TIMES_SIN(a0, 2.0, betac);
456  sin4betac = TCEA_COEFF_TIMES_SIN(a1, 4.0, betac);
457  sin6betac = TCEA_COEFF_TIMES_SIN(a2, 6.0, betac);
458  PHIc = TCEA_L(betac, sin2betac, sin4betac, sin6betac);
459  }
460 
461  sinPHIc = sin(PHIc);
462  *Easting = Tcea_a * cos(beta) * cos(PHIc) * sin(dlam) /
463  (Tcea_Scale_Factor * cos(betac) * sqrt(1.0 - es2 *
464  sinPHIc * sinPHIc)) + Tcea_False_Easting;
465 
466  phi = c0 * PHIc;
467  sin2phi = TCEA_COEFF_TIMES_SIN(c1, 2.0, PHIc);
468  sin4phi = TCEA_COEFF_TIMES_SIN(c2, 4.0, PHIc);
469  sin6phi = TCEA_COEFF_TIMES_SIN(c3, 6.0, PHIc);
470  Mc = TCEA_M(phi, sin2phi, sin4phi, sin6phi);
471 
472  *Northing = Tcea_Scale_Factor * (Mc - M0) + Tcea_False_Northing;
473  }
474  return (Error_Code);
475 } /* END OF Convert_Geodetic_To_Trans_Cyl_Eq_Area */
ossim_uint32 x
#define TCEA_LON_WARNING
#define TCEA_COEFF_TIMES_SIN(coeff, x, latit)
#define M_PI
#define TCEA_M(c0lat, c1lat, c2lat, c3lat)
#define TCEA_Q(sinlat, x)
#define TCEA_L(Beta, c0lat, c1lat, c2lat)

◆ Convert_Trans_Cyl_Eq_Area_To_Geodetic()

long ossimTransCylEquAreaProjection::Convert_Trans_Cyl_Eq_Area_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

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

References a0, a1, a2, b0, b1, b2, b3, c0, es, es2, M0, qp, Tcea_a, TCEA_COEFF_TIMES_SIN, Tcea_False_Easting, Tcea_False_Northing, TCEA_L, TCEA_NO_ERROR, Tcea_Origin_Long, TCEA_Q, Tcea_Scale_Factor, and x.

Referenced by inverse().

482 { /* BEGIN Convert_Trans_Cyl_Eq_Area_To_Geodetic */
483 /*
484  * The function Convert_Trans_Cyl_Eq_Area_To_Geodetic converts Transverse
485  * Cylindrical Equal Area projection (easting and northing) coordinates
486  * to geodetic (latitude and longitude) coordinates, according to the
487  * current ellipsoid and Transverse Cylindrical Equal Area projection
488  * coordinates. If any errors occur, the error code(s) are returned by the
489  * function, otherwise TCEA_NO_ERROR is returned.
490  *
491  * Easting : Easting (X) in meters (input)
492  * Northing : Northing (Y) in meters (input)
493  * Latitude : Latitude (phi) in radians (output)
494  * Longitude : Longitude (lambda) in radians (output)
495  */
496 
497  double x;
498  double dx; /* Delta easting - Difference in easting (easting-FE) */
499  double dy; /* Delta northing - Difference in northing (northing-FN) */
500  double Mc;
501  double MUc;
502  double sin2mu, sin4mu, sin6mu, sin8mu;
503  double PHIc;
504  double Qc;
505  double sin_lat;
506  double beta, betac, beta_prime;
507  double sin2beta, sin4beta, sin6beta;
508  double cosbetac;
509  double Qc_OVER_qp;
510  double temp;
511 
512  long Error_Code = TCEA_NO_ERROR;
513 
514 // if ((Easting < (Tcea_False_Easting + Tcea_Min_Easting))
515 // || (Easting > (Tcea_False_Easting + Tcea_Max_Easting)))
516 // { /* Easting out of range */
517 // Error_Code |= TCEA_EASTING_ERROR;
518 // }
519 // if ((Northing < (Tcea_False_Northing + Tcea_Min_Northing))
520 // || (Northing > (Tcea_False_Northing + Tcea_Max_Northing)))
521 // { /* Northing out of range */
522 // Error_Code |= TCEA_NORTHING_ERROR;
523 // }
524  if (!Error_Code)
525  { /* no errors */
526  dy = Northing - Tcea_False_Northing;
527  dx = Easting - Tcea_False_Easting;
528  Mc = M0 + dy / Tcea_Scale_Factor;
529  MUc = Mc / (Tcea_a * c0);
530 
531  sin2mu = TCEA_COEFF_TIMES_SIN(b0, 2.0, MUc);
532  sin4mu = TCEA_COEFF_TIMES_SIN(b1, 4.0, MUc);
533  sin6mu = TCEA_COEFF_TIMES_SIN(b2, 6.0, MUc);
534  sin8mu = TCEA_COEFF_TIMES_SIN(b3, 8.0, MUc);
535  PHIc = MUc + sin2mu + sin4mu + sin6mu + sin8mu;
536 
537  sin_lat = sin(PHIc);
538  x = es * sin_lat;
539  Qc = TCEA_Q(sin_lat, x);
540  Qc_OVER_qp = Qc / qp;
541 
542  if (Qc_OVER_qp < -1.0)
543  Qc_OVER_qp = -1.0;
544  else if (Qc_OVER_qp > 1.0)
545  Qc_OVER_qp = 1.0;
546 
547  betac = asin(Qc_OVER_qp);
548  cosbetac = cos(betac);
549  temp = Tcea_Scale_Factor * dx * cosbetac * sqrt(1.0 -
550  es2 * sin_lat * sin_lat) / (Tcea_a * cos(PHIc));
551  if (temp > 1.0)
552  temp = 1.0;
553  else if (temp < -1.0)
554  temp = -1.0;
555  beta_prime = -asin(temp);
556  beta = asin(cos(beta_prime) * sin(betac));
557 
558  sin2beta = TCEA_COEFF_TIMES_SIN(a0, 2.0, beta);
559  sin4beta = TCEA_COEFF_TIMES_SIN(a1, 4.0, beta);
560  sin6beta = TCEA_COEFF_TIMES_SIN(a2, 6.0, beta);
561  *Latitude = TCEA_L(beta, sin2beta, sin4beta, sin6beta);
562 
563  *Longitude = Tcea_Origin_Long - atan(tan(beta_prime) / cosbetac);
564 
565 // if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
566 // *Latitude = PI_OVER_2;
567 // else if (*Latitude < -PI_OVER_2)
568 // *Latitude = -PI_OVER_2;
569 
570 // if (*Longitude > M_PI)
571 // *Longitude -= TWO_PI;
572 // if (*Longitude < -M_PI)
573 // *Longitude += TWO_PI;
574 
575 // if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
576 // *Longitude = M_PI;
577 // else if (*Longitude < -M_PI)
578 // *Longitude = -M_PI;
579  }
580  return (Error_Code);
581 } /* END OF Convert_Trans_Cyl_Eq_Area_To_Geodetic */
ossim_uint32 x
#define TCEA_COEFF_TIMES_SIN(coeff, x, latit)
#define TCEA_Q(sinlat, x)
#define TCEA_L(Beta, c0lat, c1lat, c2lat)

◆ dup()

virtual ossimObject* ossimTransCylEquAreaProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 31 of file ossimTransCylEquAreaProjection.h.

31 {return new ossimTransCylEquAreaProjection(*this);}
ossimTransCylEquAreaProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(6378137, 6356752.3142), const ossimGpt &origin=ossimGpt())

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 160 of file ossimTransCylEquAreaProjection.cpp.

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

161 {
162  double easting = 0.0;
163  double northing = 0.0;
164  ossimGpt gpt = latLon;
165 
166  if (theDatum)
167  {
168  if (theDatum->code() != latLon.datum()->code())
169  {
170  gpt.changeDatum(theDatum); // Shift to our datum.
171  }
172  }
173 
175  gpt.lonr(),
176  &easting,
177  &northing);
178 
179  return ossimDpt(easting, northing);
180 }
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
long Convert_Geodetic_To_Trans_Cyl_Eq_Area(double Latitude, double Longitude, double *Easting, double *Northing) const
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_Trans_Cyl_Eq_Area_Parameters()

void ossimTransCylEquAreaProjection::Get_Trans_Cyl_Eq_Area_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing,
double *  Scale_Factor 
) const
private

The function Get_Trans_Cyl_Eq_Area_Parameters returns the current ellipsoid parameters, Transverse Cylindrical Equal Area projection parameters, and scale factor.

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) Scale_Factor : Multiplier which reduces distances in the projection to the actual distance on the ellipsoid (output)

Definition at line 337 of file ossimTransCylEquAreaProjection.cpp.

References Tcea_a, Tcea_f, Tcea_False_Easting, Tcea_False_Northing, Tcea_Origin_Lat, Tcea_Origin_Long, and Tcea_Scale_Factor.

344 { /* BEGIN Get_Trans_Cyl_Eq_Area_Parameters */
345 /*
346  * The function Get_Trans_Cyl_Eq_Area_Parameters returns the current ellipsoid
347  * parameters, Transverse Cylindrical Equal Area projection parameters, and scale factor.
348  *
349  * a : Semi-major axis of ellipsoid, in meters (output)
350  * f : Flattening of ellipsoid (output)
351  * Origin_Latitude : Latitude in radians at which the (output)
352  * point scale factor is 1.0
353  * Central_Meridian : Longitude in radians at the center of (output)
354  * the projection
355  * False_Easting : A coordinate value in meters assigned to the
356  * central meridian of the projection. (output)
357  * False_Northing : A coordinate value in meters assigned to the
358  * origin latitude of the projection (output)
359  * Scale_Factor : Multiplier which reduces distances in the
360  * projection to the actual distance on the
361  * ellipsoid (output)
362  */
363 
364  *a = Tcea_a;
365  *f = Tcea_f;
366  *Origin_Latitude = Tcea_Origin_Lat;
367  *Central_Meridian = Tcea_Origin_Long;
368  *False_Easting = Tcea_False_Easting;
369  *False_Northing = Tcea_False_Northing;
370  *Scale_Factor = Tcea_Scale_Factor;
371 
372  return;
373 } /* END OF Get_Trans_Cyl_Eq_Area_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 66 of file ossimTransCylEquAreaProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 67 of file ossimTransCylEquAreaProjection.h.

◆ getScaleFactor()

double ossimTransCylEquAreaProjection::getScaleFactor ( ) const
inline

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 147 of file ossimTransCylEquAreaProjection.cpp.

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

148 {
149  double lat = 0.0;
150  double lon = 0.0;
151 
152  Convert_Trans_Cyl_Eq_Area_To_Geodetic(eastingNorthing.x,
153  eastingNorthing.y,
154  &lat,
155  &lon);
156 
157  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
158 }
#define DEG_PER_RAD
long Convert_Trans_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 ossimTransCylEquAreaProjection::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 192 of file ossimTransCylEquAreaProjection.cpp.

References ossimKeywordlist::find(), ossimMapProjection::loadState(), ossimKeywordNames::SCALE_FACTOR_KW, setDefaults(), STATIC_TYPE_NAME, Tcea_False_Easting, Tcea_False_Northing, Tcea_Scale_Factor, ossimMapProjection::theFalseEastingNorthing, ossimString::toDouble(), ossimKeywordNames::TYPE_KW, update(), ossimDpt::x, and ossimDpt::y.

194 {
195  bool flag = ossimMapProjection::loadState(kwl, prefix);
196  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
197  const char* scaleFactor = kwl.find(prefix, ossimKeywordNames::SCALE_FACTOR_KW);
198 
199  setDefaults();
200 
202  {
205 
206  if(scaleFactor)
207  {
208  Tcea_Scale_Factor = ossimString(scaleFactor).toDouble();
209  }
210  }
211 
212  update();
213 
214  return flag;
215 }
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 toDouble() const
double x
Definition: ossimDpt.h:164
static const char * SCALE_FACTOR_KW
ossimDpt theFalseEastingNorthing
Hold the false easting northing.

◆ operator==()

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

Returns TRUE if principal parameters are within epsilon tolerance.

Reimplemented from ossimMapProjection.

Definition at line 586 of file ossimTransCylEquAreaProjection.cpp.

References ossim::almostEqual(), and Tcea_Scale_Factor.

587 {
588  if (!ossimMapProjection::operator==(proj))
589  return false;
590 
592  dynamic_cast<const ossimTransCylEquAreaProjection*>(&proj);
593  if (!p) return false;
594 
596 
597  return true;
598 }
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53

◆ saveState()

bool ossimTransCylEquAreaProjection::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 182 of file ossimTransCylEquAreaProjection.cpp.

References ossimKeywordlist::add(), ossimMapProjection::saveState(), ossimKeywordNames::SCALE_FACTOR_KW, and Tcea_Scale_Factor.

183 {
184  kwl.add(prefix,
187  true);
188 
189  return ossimMapProjection::saveState(kwl, prefix);
190 }
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
static const char * SCALE_FACTOR_KW

◆ Set_Trans_Cyl_Eq_Area_Parameters()

long ossimTransCylEquAreaProjection::Set_Trans_Cyl_Eq_Area_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  False_Easting,
double  False_Northing,
double  Scale_Factor 
)
private

Definition at line 217 of file ossimTransCylEquAreaProjection.cpp.

References a0, a1, a2, b0, b1, b2, b3, c0, c1, c2, c3, Convert_Geodetic_To_Trans_Cyl_Eq_Area(), es, es2, es4, es6, M0, M_PI, One_MINUS_es2, One_OVER_2es, PI_OVER_2, qp, Tcea_a, TCEA_COEFF_TIMES_SIN, Tcea_f, Tcea_False_Easting, Tcea_False_Northing, TCEA_M, Tcea_Max_Northing, Tcea_Min_Northing, TCEA_NO_ERROR, Tcea_Origin_Lat, Tcea_Origin_Long, TCEA_Q, Tcea_Scale_Factor, TWO_PI, and x.

Referenced by update().

224 { /* BEGIN Set_Trans_Cyl_Eq_Area_Parameters */
225 /*
226  * The function Set_Trans_Cyl_Eq_Area_Parameters receives the ellipsoid parameters and
227  * Transverse Cylindrical Equal Area projection parameters as inputs, and sets the
228  * corresponding state variables. If any errors occur, the error code(s) are returned
229  * by the function, otherwise TCEA_NO_ERROR is returned.
230  *
231  * a : Semi-major axis of ellipsoid, in meters (input)
232  * f : Flattening of ellipsoid (input)
233  * Origin_Latitude : Latitude in radians at which the (input)
234  * point scale factor is 1.0
235  * Central_Meridian : Longitude in radians at the center of (input)
236  * the projection
237  * False_Easting : A coordinate value in meters assigned to the
238  * central meridian of the projection. (input)
239  * False_Northing : A coordinate value in meters assigned to the
240  * origin latitude of the projection (input)
241  * Scale_Factor : Multiplier which reduces distances in the
242  * projection to the actual distance on the
243  * ellipsoid (input)
244  */
245 
246  double sin_lat_90 = sin(PI_OVER_2);
247  double x, j, three_es4;
248  double Sqrt_One_MINUS_es2;
249  double e1, e2, e3, e4;
250  double lat, sin2lat, sin4lat, sin6lat;
251  double temp, temp_northing;
252 // double inv_f = 1 / f;
253  long Error_Code = TCEA_NO_ERROR;
254 
255 // if (a <= 0.0)
256 // { /* Semi-major axis must be greater than zero */
257 // Error_Code |= TCEA_A_ERROR;
258 // }
259 // if ((inv_f < 250) || (inv_f > 350))
260 // { /* Inverse flattening must be between 250 and 350 */
261 // Error_Code |= TCEA_INV_F_ERROR;
262 // }
263 // if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
264 // { /* origin latitude out of range */
265 // Error_Code |= TCEA_ORIGIN_LAT_ERROR;
266 // }
267 // if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
268 // { /* origin longitude out of range */
269 // Error_Code |= TCEA_CENT_MER_ERROR;
270 // }
271 // if ((Scale_Factor < MIN_SCALE_FACTOR) || (Scale_Factor > MAX_SCALE_FACTOR))
272 // {
273 // Error_Code |= TCEA_SCALE_FACTOR_ERROR;
274 // }
275 
276  if (!Error_Code)
277  { /* no errors */
278  Tcea_a = a;
279  Tcea_f = f;
280  Tcea_Origin_Lat = Origin_Latitude;
281  if (Central_Meridian > M_PI)
282  Central_Meridian -= TWO_PI;
283  Tcea_Origin_Long = Central_Meridian;
284  Tcea_False_Northing = False_Northing;
285  Tcea_False_Easting = False_Easting;
286  Tcea_Scale_Factor = Scale_Factor;
287 
288  es2 = 2 * Tcea_f - Tcea_f * Tcea_f;
289  es = sqrt(es2);
290  One_MINUS_es2 = 1.0 - es2;
291  Sqrt_One_MINUS_es2 = sqrt(One_MINUS_es2);
292  One_OVER_2es = 1.0 / (2.0 * es);
293  es4 = es2 * es2;
294  es6 = es4 * es2;
295  x = es * sin_lat_90;
296  qp = TCEA_Q(sin_lat_90,x);
297 
298  a0 = es2 / 3.0 + 31.0 * es4 / 180.0 + 517.0 * es6 / 5040.0;
299  a1 = 23.0 * es4 / 360.0 + 251.0 * es6 / 3780.0;
300  a2 = 761.0 * es6 / 45360.0;
301 
302  e1 = (1.0 - Sqrt_One_MINUS_es2) / (1.0 + Sqrt_One_MINUS_es2);
303  e2 = e1 * e1;
304  e3 = e2 * e1;
305  e4 = e3 * e1;
306  b0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0;
307  b1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
308  b2 = 151.0 * e3 / 96.0;
309  b3 = 1097.0 * e4 / 512.0;
310 
311  j = 45.0 * es6 / 1024.0;
312  three_es4 = 3.0 * es4;
313  c0 = 1.0 - es2 / 4.0 - three_es4 / 64.0 - 5.0 * es6 / 256.0;
314  c1 = 3.0 * es2 / 8.0 + three_es4 / 32.0 + j;
315  c2 = 15.0 * es4 / 256.0 + j;
316  c3 = 35.0 * es6 / 3072.0;
317  lat = c0 * Tcea_Origin_Lat;
318  sin2lat = TCEA_COEFF_TIMES_SIN(c1, 2.0, Tcea_Origin_Lat);
319  sin4lat = TCEA_COEFF_TIMES_SIN(c2, 4.0, Tcea_Origin_Lat);
320  sin6lat = TCEA_COEFF_TIMES_SIN(c3, 6.0, Tcea_Origin_Lat);
321  M0 = TCEA_M(lat, sin2lat, sin4lat, sin6lat);
322  Convert_Geodetic_To_Trans_Cyl_Eq_Area(PI_OVER_2, M_PI, &temp, &temp_northing);
323  if (temp_northing > 0)
324  {
325  Tcea_Min_Northing = temp_northing - 20003931.458986;
326  Tcea_Max_Northing = temp_northing;
327  }
328  else if (temp_northing < 0)
329  {
330  Tcea_Max_Northing = temp_northing + 20003931.458986;
331  Tcea_Min_Northing = temp_northing;
332  }
333  } /* END OF if(!Error_Code) */
334  return (Error_Code);
335 } /* END OF Set_Trans_Cyl_Eq_Area_Parameters */
ossim_uint32 x
#define TCEA_COEFF_TIMES_SIN(coeff, x, latit)
#define M_PI
long Convert_Geodetic_To_Trans_Cyl_Eq_Area(double Latitude, double Longitude, double *Easting, double *Northing) const
#define TCEA_M(c0lat, c1lat, c2lat, c3lat)
#define TCEA_Q(sinlat, x)

◆ setDefaults()

void ossimTransCylEquAreaProjection::setDefaults ( )

◆ setFalseEasting()

void ossimTransCylEquAreaProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 77 of file ossimTransCylEquAreaProjection.cpp.

References Tcea_False_Easting, and update().

◆ setFalseEastingNorthing()

void ossimTransCylEquAreaProjection::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 92 of file ossimTransCylEquAreaProjection.cpp.

References Tcea_False_Easting, Tcea_False_Northing, and update().

◆ setFalseNorthing()

void ossimTransCylEquAreaProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 85 of file ossimTransCylEquAreaProjection.cpp.

References Tcea_False_Northing, and update().

◆ setParameters()

void ossimTransCylEquAreaProjection::setParameters ( double  falseEasting,
double  falseNorthing,
double  scaleFactor 
)

◆ setScaleFactor()

void ossimTransCylEquAreaProjection::setScaleFactor ( double  scaleFactor)

Definition at line 101 of file ossimTransCylEquAreaProjection.cpp.

References Tcea_Scale_Factor, and update().

102 {
103  Tcea_Scale_Factor = scaleFactor;
104 
105  update();
106 }

◆ update()

void ossimTransCylEquAreaProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 130 of file ossimTransCylEquAreaProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::latr(), ossimGpt::lonr(), Set_Trans_Cyl_Eq_Area_Parameters(), Tcea_False_Easting, Tcea_False_Northing, Tcea_Scale_Factor, ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

Referenced by loadState(), ossimTransCylEquAreaProjection(), setFalseEasting(), setFalseEastingNorthing(), setFalseNorthing(), setParameters(), and setScaleFactor().

131 {
134  theOrigin.latr(),
135  theOrigin.lonr(),
139 
142 
144 }
double y
Definition: ossimDpt.h:165
const double & getA() const
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
long Set_Trans_Cyl_Eq_Area_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing, double Scale_Factor)
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

◆ a0

double ossimTransCylEquAreaProjection::a0
mutableprivate

◆ a1

double ossimTransCylEquAreaProjection::a1
mutableprivate

◆ a2

double ossimTransCylEquAreaProjection::a2
mutableprivate

◆ b0

double ossimTransCylEquAreaProjection::b0
mutableprivate

◆ b1

double ossimTransCylEquAreaProjection::b1
mutableprivate

◆ b2

double ossimTransCylEquAreaProjection::b2
mutableprivate

◆ b3

double ossimTransCylEquAreaProjection::b3
mutableprivate

◆ c0

double ossimTransCylEquAreaProjection::c0
mutableprivate

◆ c1

double ossimTransCylEquAreaProjection::c1
mutableprivate

◆ c2

double ossimTransCylEquAreaProjection::c2
mutableprivate

◆ c3

double ossimTransCylEquAreaProjection::c3
mutableprivate

◆ es

double ossimTransCylEquAreaProjection::es
mutableprivate

◆ es2

double ossimTransCylEquAreaProjection::es2
mutableprivate

◆ es4

double ossimTransCylEquAreaProjection::es4
mutableprivate

Definition at line 92 of file ossimTransCylEquAreaProjection.h.

Referenced by Set_Trans_Cyl_Eq_Area_Parameters().

◆ es6

double ossimTransCylEquAreaProjection::es6
mutableprivate

Definition at line 93 of file ossimTransCylEquAreaProjection.h.

Referenced by Set_Trans_Cyl_Eq_Area_Parameters().

◆ M0

double ossimTransCylEquAreaProjection::M0
mutableprivate

◆ One_MINUS_es2

double ossimTransCylEquAreaProjection::One_MINUS_es2
mutableprivate

Definition at line 97 of file ossimTransCylEquAreaProjection.h.

Referenced by Set_Trans_Cyl_Eq_Area_Parameters().

◆ One_OVER_2es

double ossimTransCylEquAreaProjection::One_OVER_2es
mutableprivate

Definition at line 98 of file ossimTransCylEquAreaProjection.h.

Referenced by Set_Trans_Cyl_Eq_Area_Parameters().

◆ qp

double ossimTransCylEquAreaProjection::qp
mutableprivate

◆ Tcea_a

double ossimTransCylEquAreaProjection::Tcea_a
mutableprivate

◆ Tcea_f

double ossimTransCylEquAreaProjection::Tcea_f
mutableprivate

◆ Tcea_False_Easting

double ossimTransCylEquAreaProjection::Tcea_False_Easting
mutableprivate

◆ Tcea_False_Northing

double ossimTransCylEquAreaProjection::Tcea_False_Northing
mutableprivate

◆ Tcea_Max_Easting

double ossimTransCylEquAreaProjection::Tcea_Max_Easting
mutableprivate

◆ Tcea_Max_Northing

double ossimTransCylEquAreaProjection::Tcea_Max_Northing
mutableprivate

◆ Tcea_Min_Easting

double ossimTransCylEquAreaProjection::Tcea_Min_Easting
mutableprivate

◆ Tcea_Min_Northing

double ossimTransCylEquAreaProjection::Tcea_Min_Northing
mutableprivate

◆ Tcea_Origin_Lat

double ossimTransCylEquAreaProjection::Tcea_Origin_Lat
mutableprivate

◆ Tcea_Origin_Long

double ossimTransCylEquAreaProjection::Tcea_Origin_Long
mutableprivate

◆ Tcea_Scale_Factor

double ossimTransCylEquAreaProjection::Tcea_Scale_Factor
mutableprivate

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