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

#include <ossimStereographicProjection.h>

Inheritance diagram for ossimStereographicProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimStereographicProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimStereographicProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, const double falseEasting, const double falseNorthing)
 
 ~ossimStereographicProjection ()
 
virtual ossimObjectdup () const
 
virtual void update ()
 
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...
 
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_Stereographic_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Stereographic_Parameters (double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Stereographic (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Stereographic_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Stereo_a
 
double Stereo_f
 
double Stereo_Ra
 
double Two_Stereo_Ra
 
long Stereo_At_Pole
 
double Stereo_Origin_Lat
 
double Stereo_Origin_Long
 
double Stereo_False_Easting
 
double Stereo_False_Northing
 
double Sin_Stereo_Origin_Lat
 
double Cos_Stereo_Origin_Lat
 
double Stereo_Delta_Easting
 
double Stereo_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 17 of file ossimStereographicProjection.h.

Constructor & Destructor Documentation

◆ ossimStereographicProjection() [1/2]

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

Definition at line 37 of file ossimStereographicProjection.cpp.

References setDefaults(), and update().

39  :ossimMapProjection(ellipsoid, origin)
40 {
41  setDefaults();
42  update();
43 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimStereographicProjection() [2/2]

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

Definition at line 45 of file ossimStereographicProjection.cpp.

References Stereo_Delta_Easting, Stereo_Delta_Northing, Stereo_False_Easting, Stereo_False_Northing, and update().

49  :ossimMapProjection(ellipsoid, origin)
50 {
51  Stereo_False_Easting = falseEasting;
52  Stereo_False_Northing = falseNorthing;
53  Stereo_Delta_Easting = 1460090226.0;
54  Stereo_Delta_Northing = 1460090226.0;
55 
56  update();
57 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimStereographicProjection()

ossimStereographicProjection::~ossimStereographicProjection ( )
inline

Definition at line 26 of file ossimStereographicProjection.h.

26 {}

Member Function Documentation

◆ Convert_Geodetic_To_Stereographic()

long ossimStereographicProjection::Convert_Geodetic_To_Stereographic ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

The function Convert_Geodetic_To_Stereographic converts geodetic coordinates (latitude and longitude) to Stereographic coordinates (easting and northing), according to the current ellipsoid and Stereographic projection parameters. If any errors occur, error code(s) are returned by the function, otherwise STEREO_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 286 of file ossimStereographicProjection.cpp.

References Cos_Stereo_Origin_Lat, PI_OVER_2, PI_OVER_4, Sin_Stereo_Origin_Lat, Stereo_At_Pole, Stereo_False_Easting, Stereo_False_Northing, STEREO_LON_ERROR, STEREO_NO_ERROR, Stereo_Origin_Lat, Stereo_Origin_Long, Stereo_Ra, and Two_Stereo_Ra.

Referenced by forward(), and Set_Stereographic_Parameters().

291 { /* BEGIN Convert_Geodetic_To_Stereographic */
292 
293 /*
294  * The function Convert_Geodetic_To_Stereographic converts geodetic
295  * coordinates (latitude and longitude) to Stereographic coordinates
296  * (easting and northing), according to the current ellipsoid
297  * and Stereographic projection parameters. If any errors occur, error
298  * code(s) are returned by the function, otherwise STEREO_NO_ERROR is returned.
299  *
300  * Latitude : Latitude, in radians (input)
301  * Longitude : Longitude, in radians (input)
302  * Easting : Easting (X), in meters (output)
303  * Northing : Northing (Y), in meters (output)
304  */
305 
306  double g, k;
307  double num = 0;
308  double Ra_k = 0;
309  double slat = sin(Latitude);
310  double clat = cos(Latitude);
311  double dlam; /* Longitude - Central Meridan */
312  double cos_dlam;
313  long Error_Code = STEREO_NO_ERROR;
314 
315 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
316 // { /* Latitude out of range */
317 // Error_Code |= STEREO_LAT_ERROR;
318 // }
319 // if ((Longitude < -M_PI) || (Longitude > TWO_PI))
320 // { /* Longitude out of range */
321 // Error_Code|= STEREO_LON_ERROR;
322 // }
323  if (!Error_Code)
324  { /* no errors */
325 
326 
327  dlam = Longitude - Stereo_Origin_Long;
328 // if (dlam > M_PI)
329 // {
330 // dlam -= TWO_PI;
331 // }
332 // if (dlam < -M_PI)
333 // {
334 // dlam += TWO_PI;
335 // }
336 
337  cos_dlam = cos(dlam);
338  g = 1.0 + Sin_Stereo_Origin_Lat * slat + Cos_Stereo_Origin_Lat * clat * cos_dlam;
339  if (fabs(g) <= 1.0e-10)
340  { /* Point is out of view. Will return longitude out of range message
341  since no point out of view is implemented. */
342  Error_Code |= STEREO_LON_ERROR;
343  }
344  else
345  {
346  if (Stereo_At_Pole)
347  {
348  if (fabs(fabs(Latitude) - PI_OVER_2) < 1.0e-10)
349  {
350  *Easting = Stereo_False_Easting;
351  *Northing = Stereo_False_Northing;
352  }
353  else
354  {
355  if (Stereo_Origin_Lat > 0)
356  {
357  num = Two_Stereo_Ra * tan(PI_OVER_4 - Latitude / 2.0);
358  *Easting = Stereo_False_Easting + num * sin(dlam);
359  *Northing = Stereo_False_Northing + (-num * cos_dlam);
360  }
361  else
362  {
363  num = Two_Stereo_Ra * tan(PI_OVER_4 + Latitude / 2.0);
364  *Easting = Stereo_False_Easting + num * sin(dlam);
365  *Northing = Stereo_False_Northing + num * cos_dlam;
366  }
367  }
368  }
369  else
370  {
371  if (fabs(Stereo_Origin_Lat) <= 1.0e-10)
372  {
373  k = 2.0 / (1.0 + clat * cos_dlam);
374  Ra_k = Stereo_Ra * k;
375  *Northing = Stereo_False_Northing + Ra_k * slat;
376  }
377  else
378  {
379  k = 2.0 / g;
380  Ra_k = Stereo_Ra * k;
381  *Northing = Stereo_False_Northing + Ra_k * (Cos_Stereo_Origin_Lat * slat - Sin_Stereo_Origin_Lat * clat * cos_dlam);
382  }
383  *Easting = Stereo_False_Easting + Ra_k * clat * sin(dlam);
384  }
385  }
386  }
387  return (Error_Code);
388 } /* END OF Convert_Geodetic_To_Stereographic */
#define STEREO_LON_ERROR
#define STEREO_NO_ERROR

◆ Convert_Stereographic_To_Geodetic()

long ossimStereographicProjection::Convert_Stereographic_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

The function Convert_Stereographic_To_Geodetic converts Stereographic projection (easting and northing) coordinates to geodetic (latitude and longitude) coordinates, according to the current ellipsoid and Stereographic projection coordinates. If any errors occur, the error code(s) are returned by the function, otherwise STEREO_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 390 of file ossimStereographicProjection.cpp.

References Cos_Stereo_Origin_Lat, Sin_Stereo_Origin_Lat, Stereo_At_Pole, Stereo_False_Easting, Stereo_False_Northing, STEREO_NO_ERROR, Stereo_Origin_Lat, Stereo_Origin_Long, and Two_Stereo_Ra.

Referenced by inverse().

394 { /* BEGIN Convert_Stereographic_To_Geodetic */
395 /*
396  * The function Convert_Stereographic_To_Geodetic converts Stereographic projection
397  * (easting and northing) coordinates to geodetic (latitude and longitude)
398  * coordinates, according to the current ellipsoid and Stereographic projection
399  * coordinates. If any errors occur, the error code(s) are returned by the
400  * function, otherwise STEREO_NO_ERROR is returned.
401  *
402  * Easting : Easting (X), in meters (input)
403  * Northing : Northing (Y), in meters (input)
404  * Latitude : Latitude (phi), in radians (output)
405  * Longitude : Longitude (lambda), in radians (output)
406  */
407 
408  double dx, dy;
409  double rho, c;
410  double sin_c, cos_c;
411  double dy_sin_c;
412  long Error_Code = STEREO_NO_ERROR;
413 
414 // if ((Easting < (Stereo_False_Easting - Stereo_Delta_Easting))
415 // ||(Easting > (Stereo_False_Easting + Stereo_Delta_Easting)))
416 // { /* Easting out of range */
417 // Error_Code |= STEREO_EASTING_ERROR;
418 // }
419 // if ((Northing < (Stereo_False_Northing - Stereo_Delta_Northing))
420 // || (Northing > (Stereo_False_Northing + Stereo_Delta_Northing)))
421 // { /* Northing out of range */
422 // Error_Code |= STEREO_NORTHING_ERROR;
423 // }
424  if (!Error_Code)
425  { /* no errors */
426 
427  dy = Northing - Stereo_False_Northing;
428  dx = Easting - Stereo_False_Easting;
429  rho = sqrt(dx * dx + dy * dy);
430  if (fabs(rho) <= 1.0e-10)
431  {
432  *Latitude = Stereo_Origin_Lat;
433  *Longitude = Stereo_Origin_Long;
434  }
435  else
436  {
437  c = 2.0 * atan(rho / (Two_Stereo_Ra));
438  sin_c = sin(c);
439  cos_c = cos(c);
440  dy_sin_c = dy * sin_c;
441  if (Stereo_At_Pole)
442  {
443  if (Stereo_Origin_Lat > 0)
444  *Longitude = Stereo_Origin_Long + atan2(dx, -dy);
445  else
446  *Longitude = Stereo_Origin_Long + atan2(dx, dy);
447  }
448  else
449  *Longitude = Stereo_Origin_Long + atan2(dx * sin_c, (rho * Cos_Stereo_Origin_Lat * cos_c - dy_sin_c * Sin_Stereo_Origin_Lat));
450  *Latitude = asin(cos_c * Sin_Stereo_Origin_Lat + ((dy_sin_c * Cos_Stereo_Origin_Lat) / rho));
451  }
452 
453 // if (fabs(*Latitude) < 2.2e-8) /* force lat to 0 to avoid -0 degrees */
454 // *Latitude = 0.0;
455 // if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
456 // *Latitude = PI_OVER_2;
457 // else if (*Latitude < -PI_OVER_2)
458 // *Latitude = -PI_OVER_2;
459 
460 // if (*Longitude > M_PI)
461 // {
462 // if (*Longitude - M_PI < 3.5e-6)
463 // *Longitude = M_PI;
464 // else
465 // *Longitude -= TWO_PI;
466 // }
467 // if (*Longitude < -M_PI)
468 // {
469 // if (fabs(*Longitude + M_PI) < 3.5e-6)
470 // *Longitude = -M_PI;
471 // else
472 // *Longitude += TWO_PI;
473 // }
474 //
475 // if (fabs(*Longitude) < 2.0e-7) /* force lon to 0 to avoid -0 degrees */
476 // *Longitude = 0.0;
477 // if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
478 // *Longitude = M_PI;
479 // else if (*Longitude < -M_PI)
480 // *Longitude = -M_PI;
481  }
482  return (Error_Code);
483 } /* END OF Convert_Stereographic_To_Geodetic */
#define STEREO_NO_ERROR

◆ dup()

virtual ossimObject* ossimStereographicProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 27 of file ossimStereographicProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 118 of file ossimStereographicProjection.cpp.

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

119 {
120  double easting = 0.0;
121  double northing = 0.0;
122  ossimGpt gpt = latLon;
123 
124  if (theDatum)
125  {
126  if (theDatum->code() != latLon.datum()->code())
127  {
128  gpt.changeDatum(theDatum); // Shift to our datum.
129  }
130  }
131 
133  gpt.lonr(),
134  &easting,
135  &northing);
136 
137  return ossimDpt(easting, northing);
138 }
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_Stereographic(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_Stereographic_Parameters()

void ossimStereographicProjection::Get_Stereographic_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Stereographic_Parameters returns the current ellipsoid parameters and Stereographic projection parameters.

a : Semi-major axis of ellipsoid, in meters (output) f : Flattening of ellipsoid (output) Origin_Latitude : Latitude, in radians, at the center of (output) the projection 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)

Definition at line 252 of file ossimStereographicProjection.cpp.

References Stereo_a, Stereo_f, Stereo_False_Easting, Stereo_False_Northing, Stereo_Origin_Lat, and Stereo_Origin_Long.

259 { /* BEGIN Get_Stereographic_Parameters */
260 /*
261  * The function Get_Stereographic_Parameters returns the current ellipsoid
262  * parameters and Stereographic projection parameters.
263  *
264  * a : Semi-major axis of ellipsoid, in meters (output)
265  * f : Flattening of ellipsoid (output)
266  * Origin_Latitude : Latitude, in radians, at the center of (output)
267  * the projection
268  * Central_Meridian : Longitude, in radians, at the center of (output)
269  * the projection
270  * False_Easting : A coordinate value, in meters, assigned to the
271  * central meridian of the projection. (output)
272  * False_Northing : A coordinate value, in meters, assigned to the
273  * origin latitude of the projection (output)
274  */
275 
276  *a = Stereo_a;
277  *f = Stereo_f;
278  *Origin_Latitude = Stereo_Origin_Lat;
279  *Central_Meridian = Stereo_Origin_Long;
280  *False_Easting = Stereo_False_Easting;
281  *False_Northing = Stereo_False_Northing;
282 
283  return;
284 } /* END OF Get_Stereographic_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 57 of file ossimStereographicProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 58 of file ossimStereographicProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 105 of file ossimStereographicProjection.cpp.

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

106 {
107  double lat = 0.0;
108  double lon = 0.0;
109 
110  Convert_Stereographic_To_Geodetic(eastingNorthing.x,
111  eastingNorthing.y,
112  &lat,
113  &lon);
114 
115  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
116 }
#define DEG_PER_RAD
long Convert_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 ossimStereographicProjection::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 145 of file ossimStereographicProjection.cpp.

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

147 {
148  bool flag = ossimMapProjection::loadState(kwl, prefix);
149 
150  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
151 
152  setDefaults();
153 
155  {
158  }
159 
160  update();
161 
162  return flag;
163 }
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 ossimStereographicProjection::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 140 of file ossimStereographicProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Stereographic_Parameters()

long ossimStereographicProjection::Set_Stereographic_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
private

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

a : Semi-major axis of ellipsoid, in meters (input) f : Flattening of ellipsoid (input) Origin_Latitude : Latitude, in radians, at the center of (input) the projection Central_Meridian : Longitude, in radians, at the center of (input) the projection 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 169 of file ossimStereographicProjection.cpp.

References Convert_Geodetic_To_Stereographic(), Cos_Stereo_Origin_Lat, M_PI, ONE, PI_OVER_2, Sin_Stereo_Origin_Lat, Stereo_a, Stereo_At_Pole, Stereo_Delta_Easting, Stereo_f, Stereo_False_Easting, Stereo_False_Northing, STEREO_NO_ERROR, Stereo_Origin_Lat, Stereo_Origin_Long, Stereo_Ra, and Two_Stereo_Ra.

Referenced by update().

176 { /* BEGIN Set_Stereographic_Parameters */
177 /*
178  * The function Set_Stereographic_Parameters receives the ellipsoid
179  * parameters and Stereograpic projection parameters as inputs, and
180  * sets the corresponding state variables. If any errors occur, error
181  * code(s) are returned by the function, otherwise STEREO_NO_ERROR is returned.
182  *
183  * a : Semi-major axis of ellipsoid, in meters (input)
184  * f : Flattening of ellipsoid (input)
185  * Origin_Latitude : Latitude, in radians, at the center of (input)
186  * the projection
187  * Central_Meridian : Longitude, in radians, at the center of (input)
188  * the projection
189  * False_Easting : Easting (X) at center of projection, in meters (input)
190  * False_Northing : Northing (Y) at center of projection, in meters (input)
191  */
192 
193  double es2, es4, es6;
194  double temp = 0;
195 // double inv_f = 1 / f;
196  long Error_Code = STEREO_NO_ERROR;
197 
198 // if (a <= 0.0)
199 // { /* Semi-major axis must be greater than zero */
200 // Error_Code |= STEREO_A_ERROR;
201 // }
202 // if ((inv_f < 250) || (inv_f > 350))
203 // { /* Inverse flattening must be between 250 and 350 */
204 // Error_Code |= STEREO_INV_F_ERROR;
205 // }
206 // if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
207 // { /* origin latitude out of range */
208 // Error_Code |= STEREO_ORIGIN_LAT_ERROR;
209 // }
210 // if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
211 // { /* origin longitude out of range */
212 // Error_Code |= STEREO_CENT_MER_ERROR;
213 // }
214  if (!Error_Code)
215  { /* no errors */
216  Stereo_a = a;
217  Stereo_f = f;
218  es2 = 2 * Stereo_f - Stereo_f * Stereo_f;
219  es4 = es2 * es2;
220  es6 = es4 * es2;
221  Stereo_Ra = Stereo_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 /3024.0);
222  Two_Stereo_Ra = 2.0 * Stereo_Ra;
223  Stereo_Origin_Lat = Origin_Latitude;
226 // if (Central_Meridian > M_PI)
227 // Central_Meridian -= TWO_PI;
228  Stereo_Origin_Long = Central_Meridian;
229  Stereo_False_Easting = False_Easting;
230  Stereo_False_Northing = False_Northing;
231  if(fabs(fabs(Stereo_Origin_Lat) - PI_OVER_2) < 1.0e-10)
232  Stereo_At_Pole = 1;
233  else
234  Stereo_At_Pole = 0;
235 
236  if ((Stereo_At_Pole) || (fabs(Stereo_Origin_Lat) < 1.0e-10))
237  {
238  Stereo_Delta_Easting = 1460090226.0;
239  }
240  else
241  {
242  if (Stereo_Origin_Long <= 0)
244  else
246  }
247 
248  } /* END OF if(!Error_Code) */
249  return (Error_Code);
250 } /* END OF Set_Stereographic_Parameters */
#define M_PI
long Convert_Geodetic_To_Stereographic(double Latitude, double Longitude, double *Easting, double *Northing) const
#define STEREO_NO_ERROR

◆ setDefaults()

void ossimStereographicProjection::setDefaults ( )

◆ setFalseEasting()

void ossimStereographicProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 74 of file ossimStereographicProjection.cpp.

References Stereo_False_Easting, and update().

75 {
76  Stereo_False_Easting = falseEasting;
77 
78  update();
79 }

◆ setFalseEastingNorthing()

void ossimStereographicProjection::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 96 of file ossimStereographicProjection.cpp.

References Stereo_False_Easting, Stereo_False_Northing, and update().

98 {
99  Stereo_False_Easting = falseEasting;
100  Stereo_False_Northing = falseNorthing;
101 
102  update();
103 }

◆ setFalseNorthing()

void ossimStereographicProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 81 of file ossimStereographicProjection.cpp.

References Stereo_False_Northing, and update().

82 {
83  Stereo_False_Northing = falseNorthing;
84 
85  update();
86 }

◆ update()

void ossimStereographicProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 59 of file ossimStereographicProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::latr(), ossimGpt::lonr(), Set_Stereographic_Parameters(), Stereo_False_Easting, Stereo_False_Northing, ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

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

60 {
63  theOrigin.latr(),
64  theOrigin.lonr(),
67 
70 
72 }
double y
Definition: ossimDpt.h:165
long Set_Stereographic_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, 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

◆ Cos_Stereo_Origin_Lat

double ossimStereographicProjection::Cos_Stereo_Origin_Lat
mutableprivate

◆ Sin_Stereo_Origin_Lat

double ossimStereographicProjection::Sin_Stereo_Origin_Lat
mutableprivate

◆ Stereo_a

double ossimStereographicProjection::Stereo_a
mutableprivate

◆ Stereo_At_Pole

long ossimStereographicProjection::Stereo_At_Pole
mutableprivate

◆ Stereo_Delta_Easting

double ossimStereographicProjection::Stereo_Delta_Easting
mutableprivate

◆ Stereo_Delta_Northing

double ossimStereographicProjection::Stereo_Delta_Northing
mutableprivate

Definition at line 96 of file ossimStereographicProjection.h.

Referenced by ossimStereographicProjection(), and setDefaults().

◆ Stereo_f

double ossimStereographicProjection::Stereo_f
mutableprivate

◆ Stereo_False_Easting

double ossimStereographicProjection::Stereo_False_Easting
mutableprivate

◆ Stereo_False_Northing

double ossimStereographicProjection::Stereo_False_Northing
mutableprivate

◆ Stereo_Origin_Lat

double ossimStereographicProjection::Stereo_Origin_Lat
mutableprivate

◆ Stereo_Origin_Long

double ossimStereographicProjection::Stereo_Origin_Long
mutableprivate

◆ Stereo_Ra

double ossimStereographicProjection::Stereo_Ra
mutableprivate

◆ Two_Stereo_Ra

double ossimStereographicProjection::Two_Stereo_Ra
mutableprivate

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