OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimTransCylEquAreaProjection.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks.com)
6 //
7 // Description:
8 //
9 // Calls Geotrans Transverse Cylindrical Equal Area
10 // projection code.
11 //*******************************************************************
12 // $Id: ossimTransCylEquAreaProjection.h 17815 2010-08-03 13:23:14Z dburken $
13 #ifndef ossimTransCylEquAreaProjection_HEADER
14 #define ossimTransCylEquAreaProjection_HEADER
15 
17 
19 {
20 public:
21  ossimTransCylEquAreaProjection(const ossimEllipsoid& ellipsoid = ossimEllipsoid(6378137, 6356752.3142),
22  const ossimGpt& origin = ossimGpt());
24  const ossimGpt& origin,
25  double falseEasting,
26  double falseNorthing,
27  double scaleFactor);
28 
30 
31  virtual ossimObject *dup()const{return new ossimTransCylEquAreaProjection(*this);}
32 
33  virtual ossimGpt inverse(const ossimDpt &eastingNorthing)const;
34  virtual ossimDpt forward(const ossimGpt &latLon)const;
35  virtual void update();
36 
41  void setFalseEasting(double falseEasting);
42 
47  void setFalseNorthing(double falseNorthing);
48 
49  /*
50  * Set's scale and then update.
51  */
52  void setScaleFactor(double scaleFactor);
58  void setFalseEastingNorthing(double falseEasting, double falseNorthing);
59 
60  void setParameters(double falseEasting,
61  double falseNorthing,
62  double scaleFactor);
63 
64  void setDefaults();
65 
66  double getFalseEasting()const{return Tcea_False_Easting;}
67  double getFalseNorthing()const{return Tcea_False_Northing;}
68  double getScaleFactor()const{return Tcea_Scale_Factor;}
69 
74  virtual bool saveState(ossimKeywordlist& kwl,
75  const char* prefix=0)const;
76 
81  virtual bool loadState(const ossimKeywordlist& kwl,
82  const char* prefix=0);
83 
85  virtual bool operator==(const ossimProjection& projection) const;
86 
87 private:
88 
89  mutable double Tcea_a; /* Semi-major axis of ellipsoid in meters */
90  mutable double Tcea_f; /* Flattening of ellipsoid */
91  mutable double es2; /* Eccentricity (0.08181919084262188000) squared */
92  mutable double es4; /* es2 * es2 */
93  mutable double es6; /* es4 * es2 */
94  mutable double es; /* sqrt(es2) */
95  mutable double M0;
96  mutable double qp;
97  mutable double One_MINUS_es2; /* 1.0 - es2 */
98  mutable double One_OVER_2es; /* 1.0 / (2.0 * es) */
99  mutable double a0; /* es2 / 3.0 + 31.0 * es4 / 180.0 + 517.0 * es6 / 5040.0 */
100  mutable double a1; /* 23.0 * es4 / 360.0 + 251.0 * es6 / 3780.0 */
101  mutable double a2; /* 761.0 * es6 / 45360.0 */
102  mutable double b0; /* 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0 */
103  mutable double b1; /* 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0 */
104  mutable double b2; /* 151.0 * e3 / 96.0 */
105  mutable double b3; /* 1097.0 * e4 / 512.0 */
106  mutable double c0;/* 1.0 - es2 / 4.0 - 3.0 * es4 / 64.0 - 5.0 * es6 / 256.0 */
107  mutable double c1;/* 3.0 * es2 / 8.0 + 3.0 * es4 / 32.0 + 45.0 * es6 / 1024.0 */
108  mutable double c2; /* 15.0 * es4 / 256.0 + 45.0 * es6 / 1024.0 */
109  mutable double c3; /* 35.0 * es6 / 3072.0 */
110 
111 /* Transverse Cylindrical Equal Area projection Parameters */
112  mutable double Tcea_Origin_Lat; /* Latitude of origin in radians */
113  mutable double Tcea_Origin_Long; /* Longitude of origin in radians */
114  mutable double Tcea_False_Northing; /* False northing in meters */
115  mutable double Tcea_False_Easting; /* False easting in meters */
116  mutable double Tcea_Scale_Factor; /* Scale factor */
117 
118 /* Maximum variance for easting and northing values for WGS 84.
119  */
120  mutable double Tcea_Min_Easting;
121  mutable double Tcea_Max_Easting;
122  mutable double Tcea_Min_Northing;
123  mutable double Tcea_Max_Northing;
124 
125 /*
126  * The function Set_Trans_Cyl_Eq_Area_Parameters receives the ellipsoid parameters and
127  * Transverse Cylindrical Equal Area projcetion parameters as inputs, and sets the corresponding
128  * state variables. If any errors occur, the error code(s) are returned by the function,
129  * otherwise TCEA_NO_ERROR is returned.
130  *
131  * a : Semi-major axis of ellipsoid, in meters (input)
132  * f : Flattening of ellipsoid (input)
133  * Origin_Latitude : Latitude in radians at which the (input)
134  * point scale factor is 1.0
135  * Central_Meridian : Longitude in radians at the center of (input)
136  * the projection
137  * False_Easting : A coordinate value in meters assigned to the
138  * central meridian of the projection. (input)
139  * False_Northing : A coordinate value in meters assigned to the
140  * origin latitude of the projection (input)
141  * Scale_Factor : Multiplier which reduces distances in the
142  * projection to the actual distance on the
143  * ellipsoid (input)
144  */
145  long Set_Trans_Cyl_Eq_Area_Parameters(double a,
146  double f,
147  double Origin_Latitude,
148  double Central_Meridian,
149  double False_Easting,
150  double False_Northing,
151  double Scale_Factor);
152 
153 
172  void Get_Trans_Cyl_Eq_Area_Parameters(double *a,
173  double *f,
174  double *Origin_Latitude,
175  double *Central_Meridian,
176  double *False_Easting,
177  double *False_Northing,
178  double *Scale_Factor)const;
179 
180 
193  long Convert_Geodetic_To_Trans_Cyl_Eq_Area (double Latitude,
194  double Longitude,
195  double *Easting,
196  double *Northing)const;
197 
198 
211  long Convert_Trans_Cyl_Eq_Area_To_Geodetic(double Easting,
212  double Northing,
213  double *Latitude,
214  double *Longitude)const;
215 
216 TYPE_DATA
217 };
218 
219 #endif
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
#define OSSIMDLLEXPORT
Represents serializable keyword/value map.
virtual ossimGpt inverse(const ossimDpt &projectedPoint) const =0
Will take a point in meters and convert it to ground.
virtual bool operator==(const ossimProjection &projection) const
Compares this to arg projection and returns TRUE if the same.
#define TYPE_DATA
Definition: ossimRtti.h:339
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual ossimDpt forward(const ossimGpt &worldPoint) const =0
All map projections will convert the world coordinate to an easting northing (Meters).