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

#include <ossimUpsProjection.h>

Inheritance diagram for ossimUpsProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimUpsProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
virtual ossimObjectdup () const
 
void setDefaults ()
 
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 ()
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
double getFalseEasting () const
 
double getFalseNorthing () const
 
void setHemisphere (char hemisphere)
 
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
 

Protected Member Functions

long Set_UPS_Parameters (double a, double f)
 
void Get_UPS_Parameters (double *a, double *f) const
 
long Convert_Geodetic_To_UPS (double Latitude, double Longitude, char *Hemisphere, double *Easting, double *Northing) const
 
long Convert_UPS_To_Geodetic (char Hemisphere, double Easting, double Northing, double *Latitude, double *Longitude) const
 
- Protected Member Functions inherited from ossimMapProjection
virtual ~ossimMapProjection ()
 
void updateFromTransform ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

char theHemisphere
 
double UPS_a
 
double UPS_f
 
double UPS_Origin_Latitude
 
double UPS_Origin_Longitude
 
double false_easting
 
double false_northing
 
double UPS_Easting
 
double UPS_Northing
 
double UPS_False_Easting
 
double UPS_False_Northing
 
- 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 15 of file ossimUpsProjection.h.

Constructor & Destructor Documentation

◆ ossimUpsProjection()

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

Definition at line 33 of file ossimUpsProjection.cpp.

References setDefaults(), and update().

35  :ossimMapProjection(ellipsoid, origin)
36 {
37  setDefaults();
38  update();
39 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

Member Function Documentation

◆ Convert_Geodetic_To_UPS()

long ossimUpsProjection::Convert_Geodetic_To_UPS ( double  Latitude,
double  Longitude,
char *  Hemisphere,
double *  Easting,
double *  Northing 
) const
protected

The function Convert_Geodetic_To_UPS converts geodetic (latitude and longitude) coordinates to UPS (hemisphere, easting, and northing) coordinates, according to the current ellipsoid parameters. If any errors occur, the error code(s) are returned by the function, otherwide UPS_NO_ERROR is returned.

Latitude : Latitude in radians (input) Longitude : Longitude in radians (input) Hemisphere : Hemisphere either 'N' or 'S' (output) Easting : Easting/X in meters (output) Northing : Northing/Y in meters (output)

Definition at line 197 of file ossimUpsProjection.cpp.

References Convert_Geodetic_To_Polar_Stereographic(), false_easting, false_northing, Set_Polar_Stereographic_Parameters(), UPS_a, UPS_Easting, UPS_f, UPS_False_Easting, UPS_False_Northing, UPS_NO_ERROR, UPS_Northing, UPS_Origin_Latitude, and UPS_Origin_Longitude.

Referenced by forward().

202 {
203 /*
204  * The function Convert_Geodetic_To_UPS converts geodetic (latitude and
205  * longitude) coordinates to UPS (hemisphere, easting, and northing)
206  * coordinates, according to the current ellipsoid parameters. If any
207  * errors occur, the error code(s) are returned by the function,
208  * otherwide UPS_NO_ERROR is returned.
209  *
210  * Latitude : Latitude in radians (input)
211  * Longitude : Longitude in radians (input)
212  * Hemisphere : Hemisphere either 'N' or 'S' (output)
213  * Easting : Easting/X in meters (output)
214  * Northing : Northing/Y in meters (output)
215  */
216 
217  double tempEasting, tempNorthing;
218  long Error_Code = UPS_NO_ERROR;
219 
220 // if ((Latitude < -MAX_LAT) || (Latitude > MAX_LAT))
221 // { /* latitude out of range */
222 // Error_Code |= UPS_LAT_ERROR;
223 // }
224 // if ((Latitude < 0) && (Latitude > MIN_SOUTH_LAT))
225 // Error_Code |= UPS_LAT_ERROR;
226 // if ((Latitude >= 0) && (Latitude < MIN_NORTH_LAT))
227 // Error_Code |= UPS_LAT_ERROR;
228 // if ((Longitude < -PI) || (Longitude > (2 * PI)))
229 // { /* slam out of range */
230 // Error_Code |= UPS_LON_ERROR;
231 // }
232 
233  if (!Error_Code)
234  { /* no errors */
235 // if (Latitude < 0)
236 // {
237 // UPS_Origin_Latitude = -MAX_ORIGIN_LAT;
238 // *Hemisphere = 'S';
239 // }
240 // else
241 // {
242 // UPS_Origin_Latitude = MAX_ORIGIN_LAT;
243 // *Hemisphere = 'N';
244 // }
245 
246 
248  UPS_f,
253 
255  Longitude,
256  &tempEasting,
257  &tempNorthing);
258 
259  UPS_Easting = UPS_False_Easting + tempEasting;
260  UPS_Northing = UPS_False_Northing + tempNorthing;
261 
262 
263  *Easting = UPS_Easting;
264  *Northing = UPS_Northing;
265  } /* END of if(!Error_Code) */
266 
267  return (Error_Code);
268 } /* END OF Convert_Geodetic_To_UPS */
long Set_Polar_Stereographic_Parameters(double a, double f, double Latitude_of_True_Scale, double Longitude_Down_from_Pole, double False_Easting, double False_Northing)
#define UPS_NO_ERROR
long Convert_Geodetic_To_Polar_Stereographic(double Latitude, double Longitude, double *Easting, double *Northing)

◆ Convert_UPS_To_Geodetic()

long ossimUpsProjection::Convert_UPS_To_Geodetic ( char  Hemisphere,
double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
protected

The function Convert_UPS_To_Geodetic converts UPS (hemisphere, easting, and northing) coordinates to geodetic (latitude and longitude) coordinates according to the current ellipsoid parameters. If any errors occur, the error code(s) are returned by the function, otherwise UPS_NO_ERROR is returned.

Hemisphere : Hemisphere either 'N' or 'S' (input) Easting : Easting/X in meters (input) Northing : Northing/Y in meters (input) Latitude : Latitude in radians (output) Longitude : Longitude in radians (output)

Definition at line 271 of file ossimUpsProjection.cpp.

References Convert_Polar_Stereographic_To_Geodetic(), MAX_ORIGIN_LAT, Set_Polar_Stereographic_Parameters(), UPS_a, UPS_f, UPS_False_Easting, UPS_False_Northing, UPS_NO_ERROR, UPS_Origin_Latitude, and UPS_Origin_Longitude.

Referenced by inverse().

276 {
277 /*
278  * The function Convert_UPS_To_Geodetic converts UPS (hemisphere, easting,
279  * and northing) coordinates to geodetic (latitude and longitude) coordinates
280  * according to the current ellipsoid parameters. If any errors occur, the
281  * error code(s) are returned by the function, otherwise UPS_NO_ERROR is
282  * returned.
283  *
284  * Hemisphere : Hemisphere either 'N' or 'S' (input)
285  * Easting : Easting/X in meters (input)
286  * Northing : Northing/Y in meters (input)
287  * Latitude : Latitude in radians (output)
288  * Longitude : Longitude in radians (output)
289  */
290 
291  long Error_Code = UPS_NO_ERROR;
292 
293 // if ((Hemisphere != 'N') && (Hemisphere != 'S'))
294 // Error_Code |= UPS_HEMISPHERE_ERROR;
295 // if ((Easting < MIN_EAST_NORTH) || (Easting > MAX_EAST_NORTH))
296 // Error_Code |= UPS_EASTING_ERROR;
297 // if ((Northing < MIN_EAST_NORTH) || (Northing > MAX_EAST_NORTH))
298 // Error_Code |= UPS_NORTHING_ERROR;
299 
300  if (Hemisphere =='N')
302  if (Hemisphere =='S')
304 
305  if (!Error_Code)
306  { /* no errors */
308  UPS_f,
313 
314 
315 
317  Northing,
318  Latitude,
319  Longitude);
320 
321 
322 // if ((*Latitude < 0) && (*Latitude > MIN_SOUTH_LAT))
323 // Error_Code |= UPS_LAT_ERROR;
324 // if ((*Latitude >= 0) && (*Latitude < MIN_NORTH_LAT))
325 // Error_Code |= UPS_LAT_ERROR;
326  } /* END OF if(!Error_Code) */
327  return (Error_Code);
328 } /* END OF Convert_UPS_To_Geodetic */
long Set_Polar_Stereographic_Parameters(double a, double f, double Latitude_of_True_Scale, double Longitude_Down_from_Pole, double False_Easting, double False_Northing)
#define MAX_ORIGIN_LAT
#define UPS_NO_ERROR
long Convert_Polar_Stereographic_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude)

◆ dup()

virtual ossimObject* ossimUpsProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 21 of file ossimUpsProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 85 of file ossimUpsProjection.cpp.

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

86 {
87  double easting = 0.0;
88  double northing = 0.0;
89  ossimGpt gpt = latLon;
90 
91  if (theDatum)
92  {
93  if (theDatum->code() != latLon.datum()->code())
94  {
95  gpt.changeDatum(theDatum); // Shift to our datum.
96  }
97  }
98 
100  gpt.lonr(),
101  &theHemisphere,
102  &easting,
103  &northing);
104 
105  return ossimDpt(easting, northing);
106 }
long Convert_Geodetic_To_UPS(double Latitude, double Longitude, char *Hemisphere, double *Easting, double *Northing) const
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
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ Get_UPS_Parameters()

void ossimUpsProjection::Get_UPS_Parameters ( double *  a,
double *  f 
) const
protected

The function Get_UPS_Parameters returns the current ellipsoid parameters.

a : Semi-major axis of ellipsoid, in meters (output) f : Flattening of ellipsoid (output)

Definition at line 180 of file ossimUpsProjection.cpp.

References UPS_a, and UPS_f.

182 {
183 /*
184  * The function Get_UPS_Parameters returns the current ellipsoid parameters.
185  *
186  * a : Semi-major axis of ellipsoid, in meters (output)
187  * f : Flattening of ellipsoid (output)
188  */
189 
190  *a = UPS_a;
191  *f = UPS_f;
192 
193  return;
194 } /* END OF Get_UPS_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 43 of file ossimUpsProjection.h.

43 {return UPS_False_Easting;}

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 44 of file ossimUpsProjection.h.

44 {return UPS_False_Northing;}

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 71 of file ossimUpsProjection.cpp.

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

72 {
73  double lat = 0.0;
74  double lon = 0.0;
75 
77  eastingNorthing.x,
78  eastingNorthing.y,
79  &lat,
80  &lon);
81 
82  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
83 }
#define DEG_PER_RAD
long Convert_UPS_To_Geodetic(char Hemisphere, 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 ossimUpsProjection::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 133 of file ossimUpsProjection.cpp.

References ossimMapProjection::loadState(), and setDefaults().

135 {
136  setDefaults();
137 
138  return ossimMapProjection::loadState(kwl, prefix);
139 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.

◆ operator==()

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

Returns TRUE if principal parameters are within epsilon tolerance.

Reimplemented from ossimMapProjection.

Definition at line 333 of file ossimUpsProjection.cpp.

References theHemisphere.

334 {
335  if (!ossimMapProjection::operator==(proj))
336  return false;
337 
338  const ossimUpsProjection* p = dynamic_cast<const ossimUpsProjection*>(&proj);
339  if (!p) return false;
340 
341  if (theHemisphere != p->theHemisphere) return false;
342 
343  return true;
344 }

◆ saveState()

bool ossimUpsProjection::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 123 of file ossimUpsProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_UPS_Parameters()

long ossimUpsProjection::Set_UPS_Parameters ( double  a,
double  f 
)
protected

The function SET_UPS_PARAMETERS receives the ellipsoid parameters and sets the corresponding state variables. If any errors occur, the error code(s) are returned by the function, otherwise UPS_NO_ERROR is returned.

a : Semi-major axis of ellipsoid in meters (input) f : Flattening of ellipsoid (input)

Definition at line 147 of file ossimUpsProjection.cpp.

References UPS_a, UPS_f, and UPS_NO_ERROR.

Referenced by update().

149 {
150 /*
151  * The function SET_UPS_PARAMETERS receives the ellipsoid parameters and sets
152  * the corresponding state variables. If any errors occur, the error code(s)
153  * are returned by the function, otherwise UPS_NO_ERROR is returned.
154  *
155  * a : Semi-major axis of ellipsoid in meters (input)
156  * f : Flattening of ellipsoid (input)
157  */
158 
159 // double inv_f = 1 / f;
160  long Error_Code = UPS_NO_ERROR;
161 
162 // if (a <= 0.0)
163 // { /* Semi-major axis must be greater than zero */
164 // Error_Code |= UPS_A_ERROR;
165 // }
166 // if ((inv_f < 250) || (inv_f > 350))
167 // { /* Inverse flattening must be between 250 and 350 */
168 // Error_Code |= UPS_INV_F_ERROR;
169 // }
170 
171  if (!Error_Code)
172  { /* no errors */
173  UPS_a = a;
174  UPS_f = f;
175  }
176  return (Error_Code);
177 } /* END of Set_UPS_Parameters */
#define UPS_NO_ERROR

◆ setDefaults()

void ossimUpsProjection::setDefaults ( )

Definition at line 42 of file ossimUpsProjection.cpp.

References DEG_PER_RAD, false_easting, false_northing, FLT_EPSILON, ossimGpt::latd(), MAX_ORIGIN_LAT, theHemisphere, ossimMapProjection::theOrigin, UPS_Easting, UPS_False_Easting, UPS_False_Northing, UPS_Northing, UPS_Origin_Latitude, and UPS_Origin_Longitude.

Referenced by loadState(), and ossimUpsProjection().

43 {
44  if(theOrigin.latd() >= -FLT_EPSILON)
45  {
47  theHemisphere = 'N';
48  }
49  else
50  {
52  theHemisphere = 'S';
53  }
54  UPS_False_Easting = 2000000;
55  UPS_False_Northing = 2000000;
56  false_easting = 0.0;
57  false_northing = 0.0;
58  UPS_Easting = 0.0;
59  UPS_Northing = 0.0;
62  0.0,0.0);
63 }
#define DEG_PER_RAD
#define MAX_ORIGIN_LAT
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
#define FLT_EPSILON

◆ setHemisphere()

void ossimUpsProjection::setHemisphere ( char  hemisphere)

Definition at line 65 of file ossimUpsProjection.cpp.

References theHemisphere, and update().

66 {
67  theHemisphere = hemisphere;
68  update();
69 }

◆ update()

void ossimUpsProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 108 of file ossimUpsProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), Set_UPS_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::update(), UPS_False_Easting, UPS_False_Northing, ossimDpt::x, and ossimDpt::y.

Referenced by ossimUpsProjection(), and setHemisphere().

109 {
112 
115 
117 }
double y
Definition: ossimDpt.h:165
const double & getA() const
long Set_UPS_Parameters(double a, double f)
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

◆ false_easting

double ossimUpsProjection::false_easting
mutableprotected

Definition at line 60 of file ossimUpsProjection.h.

Referenced by Convert_Geodetic_To_UPS(), and setDefaults().

◆ false_northing

double ossimUpsProjection::false_northing
mutableprotected

Definition at line 61 of file ossimUpsProjection.h.

Referenced by Convert_Geodetic_To_UPS(), and setDefaults().

◆ theHemisphere

char ossimUpsProjection::theHemisphere
mutableprotected

Definition at line 52 of file ossimUpsProjection.h.

Referenced by forward(), inverse(), operator==(), setDefaults(), and setHemisphere().

◆ UPS_a

double ossimUpsProjection::UPS_a
mutableprotected

◆ UPS_Easting

double ossimUpsProjection::UPS_Easting
mutableprotected

Definition at line 62 of file ossimUpsProjection.h.

Referenced by Convert_Geodetic_To_UPS(), and setDefaults().

◆ UPS_f

double ossimUpsProjection::UPS_f
mutableprotected

◆ UPS_False_Easting

double ossimUpsProjection::UPS_False_Easting
protected

◆ UPS_False_Northing

double ossimUpsProjection::UPS_False_Northing
protected

◆ UPS_Northing

double ossimUpsProjection::UPS_Northing
mutableprotected

Definition at line 63 of file ossimUpsProjection.h.

Referenced by Convert_Geodetic_To_UPS(), and setDefaults().

◆ UPS_Origin_Latitude

double ossimUpsProjection::UPS_Origin_Latitude
mutableprotected

◆ UPS_Origin_Longitude

double ossimUpsProjection::UPS_Origin_Longitude
mutableprotected

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