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

#include <ossimPolarStereoProjection.h>

Inheritance diagram for ossimPolarStereoProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimPolarStereoProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimPolarStereoProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, const double falseEasting, const double falseNorthing)
 
 ~ossimPolarStereoProjection ()
 
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 setFalseEastingNorthing (double falseEasting, double falseNorthing)
 
void setDefaults ()
 
double getFalseEasting () const
 
double getFalseNorthing () const
 
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_Polar_Stereographic_Parameters (double a, double f, double Latitude_of_True_Scale, double Longitude_Down_from_Pole, double False_Easting, double False_Northing)
 
void Get_Polar_Stereographic_Parameters (double *a, double *f, double *Latitude_of_True_Scale, double *Longitude_Down_from_Pole, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Polar_Stereographic (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Polar_Stereographic_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Polar_a
 
double Polar_f
 
double es
 
double es_OVER_2
 
double Southern_Hemisphere
 
double mc
 
double tc
 
double e4
 
double Polar_a_mc
 
double two_Polar_a
 
double Polar_Origin_Lat
 
double Polar_Origin_Long
 
double Polar_False_Easting
 
double Polar_False_Northing
 
double Polar_Delta_Easting
 
double Polar_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 ossimPolarStereoProjection.h.

Constructor & Destructor Documentation

◆ ossimPolarStereoProjection() [1/2]

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

Definition at line 51 of file ossimPolarStereoProjection.cpp.

References setDefaults(), and update().

53  :ossimMapProjection(ellipsoid, origin)
54 {
55  setDefaults();
56  update();
57 // Polar_Delta_Easting = 12713601.0;
58 // Polar_Delta_Northing = 12713601.0;
59 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimPolarStereoProjection() [2/2]

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

◆ ~ossimPolarStereoProjection()

ossimPolarStereoProjection::~ossimPolarStereoProjection ( )
inline

Definition at line 27 of file ossimPolarStereoProjection.h.

27 {}

Member Function Documentation

◆ Convert_Geodetic_To_Polar_Stereographic()

long ossimPolarStereoProjection::Convert_Geodetic_To_Polar_Stereographic ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

The function Convert_Geodetic_To_Polar_Stereographic converts geodetic coordinates (latitude and longitude) to Polar Stereographic coordinates (easting and northing), according to the current ellipsoid and Polar Stereographic projection parameters. If any errors occur, error code(s) are returned by the function, otherwise POLAR_NO_ERROR is returned.

Latitude : Latitude, in radians (input) Longitude : Longitude, in radians (input) Easting : Easting (X), in meters (output) Northing : Northing (Y), in meters (output)

Definition at line 321 of file ossimPolarStereoProjection.cpp.

References e4, es, PI_OVER_2, PI_Over_4, Polar_a_mc, Polar_False_Easting, Polar_False_Northing, POLAR_NO_ERROR, Polar_Origin_Lat, Polar_Origin_Long, POLAR_POW, Southern_Hemisphere, tc, and two_Polar_a.

Referenced by forward(), and Set_Polar_Stereographic_Parameters().

326 { /* BEGIN Convert_Geodetic_To_Polar_Stereographic */
327 
328 /*
329  * The function Convert_Geodetic_To_Polar_Stereographic converts geodetic
330  * coordinates (latitude and longitude) to Polar Stereographic coordinates
331  * (easting and northing), according to the current ellipsoid
332  * and Polar Stereographic projection parameters. If any errors occur, error
333  * code(s) are returned by the function, otherwise POLAR_NO_ERROR is returned.
334  *
335  * Latitude : Latitude, in radians (input)
336  * Longitude : Longitude, in radians (input)
337  * Easting : Easting (X), in meters (output)
338  * Northing : Northing (Y), in meters (output)
339  */
340 
341  double dlam;
342  double slat;
343  double essin;
344  double t;
345  double rho;
346  double pow_es;
347  long Error_Code = POLAR_NO_ERROR;
348 
349 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
350 // { /* Latitude out of range */
351 // Error_Code |= POLAR_LAT_ERROR;
352 // }
353 // if ((Latitude < 0) && (Southern_Hemisphere == 0))
354 // { /* Latitude and Origin Latitude in different hemispheres */
355 // Error_Code |= POLAR_LAT_ERROR;
356 // }
357 // if ((Latitude > 0) && (Southern_Hemisphere == 1))
358 // { /* Latitude and Origin Latitude in different hemispheres */
359 // Error_Code |= POLAR_LAT_ERROR;
360 // }
361 // if ((Longitude < -PI) || (Longitude > TWO_PI))
362 // { /* Longitude out of range */
363 // Error_Code |= POLAR_LON_ERROR;
364 // }
365 
366 
367  if (!Error_Code)
368  { /* no errors */
369 
370  if (fabs(fabs(Latitude) - PI_OVER_2) < 1.0e-10)
371  {
372  *Easting = 0.0;
373  *Northing = 0.0;
374  }
375  else
376  {
377  if (Southern_Hemisphere != 0)
378  {
379  Longitude *= -1.0;
380  Latitude *= -1.0;
381  }
382  dlam = Longitude - Polar_Origin_Long;
383 // if (dlam > M_PI)
384 // {
385 // dlam -= TWO_PI;
386 // }
387 // if (dlam < -M_PI)
388 // {
389 // dlam += TWO_PI;
390 // }
391  slat = sin(Latitude);
392  essin = es * slat;
393  pow_es = POLAR_POW(essin);
394  t = tan(PI_Over_4 - Latitude / 2.0) / pow_es;
395 
396  if (fabs(fabs(Polar_Origin_Lat) - PI_OVER_2) > 1.0e-10)
397  rho = Polar_a_mc * t / tc;
398  else
399  rho = two_Polar_a * t / e4;
400 
401  *Easting = rho * sin(dlam) + Polar_False_Easting;
402 
403  if (Southern_Hemisphere != 0)
404  {
405  *Easting *= -1.0;
406  *Northing = rho * cos(dlam) + Polar_False_Northing;
407  }
408  else
409  *Northing = -rho * cos(dlam) + Polar_False_Northing;
410 
411  }
412  }
413  return (Error_Code);
414 } /* END OF Convert_Geodetic_To_Polar_Stereographic */
#define POLAR_NO_ERROR
const double PI_Over_4
#define POLAR_POW(EsSin)
#define PI_OVER_2

◆ Convert_Polar_Stereographic_To_Geodetic()

long ossimPolarStereoProjection::Convert_Polar_Stereographic_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

The function Convert_Polar_Stereographic_To_Geodetic converts Polar Stereographic coordinates (easting and northing) to geodetic coordinates (latitude and longitude) according to the current ellipsoid and Polar Stereographic projection Parameters. If any errors occur, the code(s) are returned by the function, otherwise POLAR_NO_ERROR is returned.

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 417 of file ossimPolarStereoProjection.cpp.

References e4, es, PI_OVER_2, Polar_a_mc, Polar_False_Easting, Polar_False_Northing, POLAR_NO_ERROR, Polar_Origin_Lat, Polar_Origin_Long, POLAR_POW, Southern_Hemisphere, tc, and two_Polar_a.

Referenced by inverse().

422 { /* BEGIN Convert_Polar_Stereographic_To_Geodetic */
423 /*
424  * The function Convert_Polar_Stereographic_To_Geodetic converts Polar
425  * Stereographic coordinates (easting and northing) to geodetic
426  * coordinates (latitude and longitude) according to the current ellipsoid
427  * and Polar Stereographic projection Parameters. If any errors occur, the
428  * code(s) are returned by the function, otherwise POLAR_NO_ERROR
429  * is returned.
430  *
431  * Easting : Easting (X), in meters (input)
432  * Northing : Northing (Y), in meters (input)
433  * Latitude : Latitude, in radians (output)
434  * Longitude : Longitude, in radians (output)
435  *
436  */
437 
438  double dy, dx;
439  double rho;
440  double t;
441  double PHI, sin_PHI;
442  double tempPHI = 0.0;
443  double essin;
444  double pow_es;
445 // double temp;
446  long Error_Code = POLAR_NO_ERROR;
447 
448 // if ((Easting > (Polar_False_Easting + Polar_Delta_Easting)) ||
449 // (Easting < (Polar_False_Easting - Polar_Delta_Easting)))
450 // { /* Easting out of range */
451 // Error_Code |= POLAR_EASTING_ERROR;
452 // }
453 // if ((Northing > (Polar_False_Northing + Polar_Delta_Northing)) ||
454 // (Northing < (Polar_False_Northing - Polar_Delta_Northing)))
455 // { /* Northing out of range */
456 // Error_Code |= POLAR_NORTHING_ERROR;
457 // }
458 // if (!Error_Code)
459 // {
460 // temp = sqrt(Easting * Easting + Northing * Northing);
461 
462 // if ((temp > (Polar_False_Easting + Polar_Delta_Easting)) ||
463 // (temp > (Polar_False_Northing + Polar_Delta_Northing)) ||
464 // (temp < (Polar_False_Easting - Polar_Delta_Easting)) ||
465 // (temp < (Polar_False_Northing - Polar_Delta_Northing)))
466 // { /* Point is outside of projection area */
467 // Error_Code |= POLAR_RADIUS_ERROR;
468 // }
469 // }
470 
471  if (!Error_Code)
472  { /* no errors */
473 
474  dy = Northing - Polar_False_Northing;
475  dx = Easting - Polar_False_Easting;
476  if ((dy == 0.0) && (dx == 0.0))
477  {
478  *Latitude = PI_OVER_2;
479  *Longitude = Polar_Origin_Long;
480 
481  }
482  else
483  {
484  if (Southern_Hemisphere != 0)
485  {
486  dy *= -1.0;
487  dx *= -1.0;
488  }
489 
490  rho = sqrt(dx * dx + dy * dy);
491  if (fabs(fabs(Polar_Origin_Lat) - PI_OVER_2) > 1.0e-10)
492  t = rho * tc / (Polar_a_mc);
493  else
494  t = rho * e4 / (two_Polar_a);
495  PHI = PI_OVER_2 - 2.0 * atan(t);
496  while (fabs(PHI - tempPHI) > 1.0e-10)
497  {
498  tempPHI = PHI;
499  sin_PHI = sin(PHI);
500  essin = es * sin_PHI;
501  pow_es = POLAR_POW(essin);
502  PHI = PI_OVER_2 - 2.0 * atan(t * pow_es);
503  }
504  *Latitude = PHI;
505  *Longitude = Polar_Origin_Long + atan2(dx, -dy);
506 
507 // if (*Longitude > M_PI)
508 // *Longitude -= TWO_PI;
509 // else if (*Longitude < -M_PI)
510 // *Longitude += TWO_PI;
511 
512 
513 // if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
514 // *Latitude = PI_OVER_2;
515 // else if (*Latitude < -PI_OVER_2)
516 // *Latitude = -PI_OVER_2;
517 
518 // if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
519 // *Longitude = M_PI;
520 // else if (*Longitude < -M_PI)
521 // *Longitude = -M_PI;
522 
523  }
524  if (Southern_Hemisphere != 0)
525  {
526  *Latitude *= -1.0;
527  *Longitude *= -1.0;
528  }
529 
530  }
531  return (Error_Code);
532 } /* END OF Convert_Polar_Stereographic_To_Geodetic */
#define POLAR_NO_ERROR
#define POLAR_POW(EsSin)
#define PI_OVER_2

◆ dup()

virtual ossimObject* ossimPolarStereoProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 29 of file ossimPolarStereoProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 131 of file ossimPolarStereoProjection.cpp.

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

132 {
133  double easting = 0.0;
134  double northing = 0.0;
135  ossimGpt gpt = latLon;
136 
137  if (theDatum)
138  {
139  if (theDatum->code() != latLon.datum()->code())
140  {
141  gpt.changeDatum(theDatum); // Shift to our datum.
142  }
143  }
144 
146  gpt.lonr(),
147  &easting,
148  &northing);
149 
150  return ossimDpt(easting, northing);
151 }
virtual const ossimString & code() const
Definition: ossimDatum.h:57
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
Definition: ossimGpt.cpp:316
long Convert_Geodetic_To_Polar_Stereographic(double Latitude, double Longitude, double *Easting, double *Northing) const
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_Polar_Stereographic_Parameters()

void ossimPolarStereoProjection::Get_Polar_Stereographic_Parameters ( double *  a,
double *  f,
double *  Latitude_of_True_Scale,
double *  Longitude_Down_from_Pole,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Polar_Stereographic_Parameters returns the current ellipsoid parameters and Polar projection parameters.

a : Semi-major axis of ellipsoid, in meters (output) f : Flattening of ellipsoid (output) Latitude_of_True_Scale : Latitude of true scale, in radians (output) Longitude_Down_from_Pole : Longitude down from pole, in radians (output) False_Easting : Easting (X) at center of projection, in meters (output) False_Northing : Northing (Y) at center of projection, in meters (output)

Definition at line 290 of file ossimPolarStereoProjection.cpp.

References Polar_a, Polar_f, Polar_False_Easting, Polar_False_Northing, Polar_Origin_Lat, and Polar_Origin_Long.

297 { /* BEGIN Get_Polar_Stereographic_Parameters */
298 /*
299  * The function Get_Polar_Stereographic_Parameters returns the current
300  * ellipsoid parameters and Polar projection parameters.
301  *
302  * a : Semi-major axis of ellipsoid, in meters (output)
303  * f : Flattening of ellipsoid (output)
304  * Latitude_of_True_Scale : Latitude of true scale, in radians (output)
305  * Longitude_Down_from_Pole : Longitude down from pole, in radians (output)
306  * False_Easting : Easting (X) at center of projection, in meters (output)
307  * False_Northing : Northing (Y) at center of projection, in meters (output)
308  */
309 
310  *a = Polar_a;
311  *f = Polar_f;
312  *Latitude_of_True_Scale = Polar_Origin_Lat;
313  *Longitude_Down_from_Pole = Polar_Origin_Long;
314  *False_Easting = Polar_False_Easting;
315  *False_Northing = Polar_False_Northing;
316 
317  return;
318 } /* END OF Get_Polar_Stereographic_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 56 of file ossimPolarStereoProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 57 of file ossimPolarStereoProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 118 of file ossimPolarStereoProjection.cpp.

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

119 {
120  double lat = 0.0;
121  double lon = 0.0;
122 
123  Convert_Polar_Stereographic_To_Geodetic(eastingNorthing.x,
124  eastingNorthing.y,
125  &lat,
126  &lon);
127 
128  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
129 }
#define DEG_PER_RAD
long Convert_Polar_Stereographic_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 ossimPolarStereoProjection::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 158 of file ossimPolarStereoProjection.cpp.

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

160 {
161  bool flag = ossimMapProjection::loadState(kwl, prefix);
162  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
163 
164  setDefaults();
165 
167  {
170  }
171 
172  update();
173 
174  return flag;
175 }
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 ossimPolarStereoProjection::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 153 of file ossimPolarStereoProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Polar_Stereographic_Parameters()

long ossimPolarStereoProjection::Set_Polar_Stereographic_Parameters ( double  a,
double  f,
double  Latitude_of_True_Scale,
double  Longitude_Down_from_Pole,
double  False_Easting,
double  False_Northing 
)
private

The function Set_Polar_Stereographic_Parameters receives the ellipsoid parameters and Polar Stereograpic projection parameters as inputs, and sets the corresponding state variables. If any errors occur, error code(s) are returned by the function, otherwise POLAR_NO_ERROR is returned.

a : Semi-major axis of ellipsoid, in meters (input) f : Flattening of ellipsoid (input) Latitude_of_True_Scale : Latitude of true scale, in radians (input) Longitude_Down_from_Pole : Longitude down from pole, in radians (input) False_Easting : Easting (X) at center of projection, in meters (input) False_Northing : Northing (Y) at center of projection, in meters (input)

Definition at line 184 of file ossimPolarStereoProjection.cpp.

References Convert_Geodetic_To_Polar_Stereographic(), e4, es, es_OVER_2, M_PI, mc, PI_OVER_2, PI_Over_4, Polar_a, Polar_a_mc, Polar_Delta_Easting, Polar_Delta_Northing, Polar_f, Polar_False_Easting, Polar_False_Northing, POLAR_NO_ERROR, Polar_Origin_Lat, Polar_Origin_Long, POLAR_POW, Southern_Hemisphere, tc, TWO_PI, and two_Polar_a.

Referenced by update().

191 { /* BEGIN Set_Polar_Stereographic_Parameters */
192 /*
193  * The function Set_Polar_Stereographic_Parameters receives the ellipsoid
194  * parameters and Polar Stereograpic projection parameters as inputs, and
195  * sets the corresponding state variables. If any errors occur, error
196  * code(s) are returned by the function, otherwise POLAR_NO_ERROR is returned.
197  *
198  * a : Semi-major axis of ellipsoid, in meters (input)
199  * f : Flattening of ellipsoid (input)
200  * Latitude_of_True_Scale : Latitude of true scale, in radians (input)
201  * Longitude_Down_from_Pole : Longitude down from pole, in radians (input)
202  * False_Easting : Easting (X) at center of projection, in meters (input)
203  * False_Northing : Northing (Y) at center of projection, in meters (input)
204  */
205 
206  double es2;
207  double slat, clat;
208  double essin;
209  double one_PLUS_es, one_MINUS_es;
210  double pow_es;
211  double temp;
212 // double inv_f = 1 / f;
213  const double epsilon = 1.0e-2;
214  long Error_Code = POLAR_NO_ERROR;
215 
216 // if (a <= 0.0)
217 // { /* Semi-major axis must be greater than zero */
218 // Error_Code |= POLAR_A_ERROR;
219 // }
220 // if ((inv_f < 250) || (inv_f > 350))
221 // { /* Inverse flattening must be between 250 and 350 */
222 // Error_Code |= POLAR_INV_F_ERROR;
223 // }
224 // if ((Latitude_of_True_Scale < -PI_OVER_2) || (Latitude_of_True_Scale > PI_OVER_2))
225 // { /* Origin Latitude out of range */
226 // Error_Code |= POLAR_ORIGIN_LAT_ERROR;
227 // }
228 // if ((Longitude_Down_from_Pole < -PI) || (Longitude_Down_from_Pole > TWO_PI))
229 // { /* Origin Longitude out of range */
230 // Error_Code |= POLAR_ORIGIN_LON_ERROR;
231 // }
232 
233  if (!Error_Code)
234  { /* no errors */
235 
236  Polar_a = a;
237  two_Polar_a = 2.0 * Polar_a;
238  Polar_f = f;
239 
240  if (Longitude_Down_from_Pole > M_PI)
241  Longitude_Down_from_Pole -= TWO_PI;
242  if (Latitude_of_True_Scale < 0)
243  {
245  Polar_Origin_Lat = -Latitude_of_True_Scale;
246  Polar_Origin_Long = -Longitude_Down_from_Pole;
247  }
248  else
249  {
251  Polar_Origin_Lat = Latitude_of_True_Scale;
252  Polar_Origin_Long = Longitude_Down_from_Pole;
253  }
254  Polar_False_Easting = False_Easting;
255  Polar_False_Northing = False_Northing;
256 
257  es2 = 2 * Polar_f - Polar_f * Polar_f;
258  es = sqrt(es2);
259  es_OVER_2 = es / 2.0;
260 
261  if (fabs(fabs(Polar_Origin_Lat) - PI_OVER_2) > 1.0e-10)
262  {
263  slat = sin(Polar_Origin_Lat);
264  essin = es * slat;
265  pow_es = POLAR_POW(essin);
266  clat = cos(Polar_Origin_Lat);
267  mc = clat / sqrt(1.0 - essin * essin);
268  Polar_a_mc = Polar_a * mc;
269  tc = tan(PI_Over_4 - Polar_Origin_Lat / 2.0) / pow_es;
270  }
271  else
272  {
273  one_PLUS_es = 1.0 + es;
274  one_MINUS_es = 1.0 - es;
275  e4 = sqrt(pow(one_PLUS_es, one_PLUS_es) * pow(one_MINUS_es, one_MINUS_es));
276  }
277  }
278  /* Calculate Radius */
280  &temp, &Polar_Delta_Northing);
281  Polar_Delta_Northing = fabs(Polar_Delta_Northing) + epsilon;
283 
284 
285  return (Error_Code);
286 } /* END OF Set_Polar_Stereographic_Parameters */
#define TWO_PI
#define POLAR_NO_ERROR
#define M_PI
long Convert_Geodetic_To_Polar_Stereographic(double Latitude, double Longitude, double *Easting, double *Northing) const
const double PI_Over_4
#define POLAR_POW(EsSin)
#define PI_OVER_2

◆ setDefaults()

void ossimPolarStereoProjection::setDefaults ( )

◆ setFalseEasting()

void ossimPolarStereoProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 89 of file ossimPolarStereoProjection.cpp.

References Polar_False_Easting, and update().

90 {
91  Polar_False_Easting = falseEasting;
92 
93  update();
94 }

◆ setFalseEastingNorthing()

void ossimPolarStereoProjection::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 109 of file ossimPolarStereoProjection.cpp.

References Polar_False_Easting, Polar_False_Northing, and update().

111 {
112  Polar_False_Easting = falseEasting;
113  Polar_False_Northing = falseNorthing;
114 
115  update();
116 }

◆ setFalseNorthing()

void ossimPolarStereoProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 96 of file ossimPolarStereoProjection.cpp.

References Polar_False_Northing, and update().

97 {
98  Polar_False_Northing = falseNorthing;
99 
100  update();
101 }

◆ update()

void ossimPolarStereoProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 74 of file ossimPolarStereoProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::latr(), ossimGpt::lonr(), Polar_False_Easting, Polar_False_Northing, Set_Polar_Stereographic_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

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

75 {
78  theOrigin.latr(),
79  theOrigin.lonr(),
82 
85 
87 }
double y
Definition: ossimDpt.h:165
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)
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

◆ e4

double ossimPolarStereoProjection::e4
mutableprivate

◆ es

double ossimPolarStereoProjection::es
mutableprivate

◆ es_OVER_2

double ossimPolarStereoProjection::es_OVER_2
mutableprivate

Definition at line 78 of file ossimPolarStereoProjection.h.

Referenced by Set_Polar_Stereographic_Parameters().

◆ mc

double ossimPolarStereoProjection::mc
mutableprivate

Definition at line 80 of file ossimPolarStereoProjection.h.

Referenced by Set_Polar_Stereographic_Parameters().

◆ Polar_a

double ossimPolarStereoProjection::Polar_a
mutableprivate

◆ Polar_a_mc

double ossimPolarStereoProjection::Polar_a_mc
mutableprivate

◆ Polar_Delta_Easting

double ossimPolarStereoProjection::Polar_Delta_Easting
mutableprivate

◆ Polar_Delta_Northing

double ossimPolarStereoProjection::Polar_Delta_Northing
mutableprivate

◆ Polar_f

double ossimPolarStereoProjection::Polar_f
mutableprivate

◆ Polar_False_Easting

double ossimPolarStereoProjection::Polar_False_Easting
mutableprivate

◆ Polar_False_Northing

double ossimPolarStereoProjection::Polar_False_Northing
mutableprivate

◆ Polar_Origin_Lat

double ossimPolarStereoProjection::Polar_Origin_Lat
mutableprivate

◆ Polar_Origin_Long

double ossimPolarStereoProjection::Polar_Origin_Long
mutableprivate

◆ Southern_Hemisphere

double ossimPolarStereoProjection::Southern_Hemisphere
mutableprivate

◆ tc

double ossimPolarStereoProjection::tc
mutableprivate

◆ two_Polar_a

double ossimPolarStereoProjection::two_Polar_a
mutableprivate

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