OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimMercatorProjection.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 Mercator projection code.
10 //*******************************************************************
11 // $Id: ossimMercatorProjection.h 17815 2010-08-03 13:23:14Z dburken $
12 
13 #ifndef ossimMercatorProjection_HEADER
14 #define ossimMercatorProjection_HEADER
15 
17 
19 {
20 public:
21 
23  const ossimGpt& origin = ossimGpt());
24 
25  ossimMercatorProjection(const ossimEllipsoid& ellipsoid,
26  const ossimGpt& origin,
27  double falseEasting,
28  double falseNorthing,
29  double scaleFactor);
31  virtual ossimObject *dup()const{return new ossimMercatorProjection(*this);}
32 
33  virtual ossimGpt inverse(const ossimDpt &eastingNorthing)const;
34  virtual ossimDpt forward(const ossimGpt &latLon)const;
35  virtual void update();
40  void setFalseEasting(double falseEasting);
41 
46  void setFalseNorthing(double falseNorthing);
47 
53  void setFalseEastingNorthing(double falseEasting, double falseNorthing);
54 
58  void setScaleFactor(double scaleFactor);
59 
65  void setParameters(double falseEasting,
66  double falseNorthing,
67  double scaleFactor);
68  void setDefaults();
69 
70  double getFalseEasting()const{return Merc_False_Easting;}
71  double getFalseNorthing()const{return Merc_False_Northing;}
72  double getScaleFactor()const{return Merc_Scale_Factor;}
73 
78  virtual bool saveState(ossimKeywordlist& kwl,
79  const char* prefix=0)const;
80 
85  virtual bool loadState(const ossimKeywordlist& kwl,
86  const char* prefix=0);
87 
89  virtual bool operator==(const ossimProjection& projection) const;
90 
91 private:
92  //_________________GEOTRANS STUFF____________________________
93 
94  mutable double Merc_a; /* Semi-major axis of ellipsoid in meters */
95  mutable double Merc_f; /* Flattening of ellipsoid */
96  mutable double Merc_e; /* Eccentricity of ellipsoid */
97  mutable double Merc_es; /* Eccentricity squared */
98 
99 /* Mercator projection Parameters */
100  mutable double Merc_Origin_Lat; /* Latitude of origin in radians */
101  mutable double Merc_Origin_Long; /* Longitude of origin in radians */
102  mutable double Merc_False_Northing; /* False northing in meters */
103  mutable double Merc_False_Easting; /* False easting in meters */
104  mutable double Merc_Scale_Factor; /* Scale factor */
105 
106 /* Isometric to geodetic latitude parameters, default to WGS 84 */
107  mutable double Merc_ab;
108  mutable double Merc_bb;
109  mutable double Merc_cb;
110  mutable double Merc_db;
111 
112 /* Maximum variance for easting and northing values for WGS 84.
113  */
114  mutable double Merc_Delta_Easting;
115  mutable double Merc_Delta_Northing;
116 
117 
140  long Set_Mercator_Parameters(double a,
141  double f,
142  double Origin_Latitude,
143  double Central_Meridian,
144  double False_Easting,
145  double False_Northing,
146  double *Scale_Factor);
147 
148 
167  void Get_Mercator_Parameters(double *a,
168  double *f,
169  double *Origin_Latitude,
170  double *Central_Meridian,
171  double *False_Easting,
172  double *False_Northing,
173  double *Scale_Factor)const;
174 
175 
188  long Convert_Geodetic_To_Mercator (double Latitude,
189  double Longitude,
190  double *Easting,
191  double *Northing)const;
192 
193 
206  long Convert_Mercator_To_Geodetic(double Easting,
207  double Northing,
208  double *Latitude,
209  double *Longitude)const;
210 
211 TYPE_DATA
212 };
213 
214 #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 ossimObject * dup() const
virtual ossimDpt forward(const ossimGpt &worldPoint) const =0
All map projections will convert the world coordinate to an easting northing (Meters).