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

#include <ossimAzimEquDistProjection.h>

Inheritance diagram for ossimAzimEquDistProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimAzimEquDistProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimAzimEquDistProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, double falseEasting, double falseNorthing)
 
 ossimAzimEquDistProjection (const ossimAzimEquDistProjection &rhs)
 
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 ()
 
double getFalseEasting () const
 
double getFalseNorthing () const
 
void setFalseEasting (double falseEasting)
 
void setFalseNorthing (double falseNorthing)
 
void setFalseEastingNorthing (double falseEasting, double falseNorthing)
 
void setDefaults ()
 
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
 

Protected Member Functions

virtual ~ossimAzimEquDistProjection ()
 
long Set_Azimuthal_Equidistant_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Azimuthal_Equidistant_Parameters (double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Azimuthal_Equidistant (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Azimuthal_Equidistant_To_Geodetic (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

double abs_Azeq_Origin_Lat
 
double Azeq_a
 
double Azeq_f
 
double Ra
 
double Sin_Azeq_Origin_Lat
 
double Cos_Azeq_Origin_Lat
 
double Azeq_Origin_Lat
 
double Azeq_Origin_Long
 
double Azeq_False_Northing
 
double Azeq_False_Easting
 
double Azeq_Delta_Northing
 
double Azeq_Delta_Easting
 
- 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 ossimAzimEquDistProjection.h.

Constructor & Destructor Documentation

◆ ossimAzimEquDistProjection() [1/3]

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

Definition at line 34 of file ossimAzimEquDistProjection.cpp.

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

◆ ossimAzimEquDistProjection() [2/3]

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

Definition at line 42 of file ossimAzimEquDistProjection.cpp.

References setFalseEastingNorthing().

46  :ossimMapProjection(ellipsoid,
47  origin)
48 {
49  setFalseEastingNorthing(falseEasting, falseNorthing);
50 }
void setFalseEastingNorthing(double falseEasting, double falseNorthing)
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimAzimEquDistProjection() [3/3]

ossimAzimEquDistProjection::ossimAzimEquDistProjection ( const ossimAzimEquDistProjection rhs)
inline

Definition at line 29 of file ossimAzimEquDistProjection.h.

30  {
31  *this = rhs;
32  }

◆ ~ossimAzimEquDistProjection()

virtual ossimAzimEquDistProjection::~ossimAzimEquDistProjection ( )
inlineprotectedvirtual

Definition at line 85 of file ossimAzimEquDistProjection.h.

85 {}

Member Function Documentation

◆ Convert_Azimuthal_Equidistant_To_Geodetic()

long ossimAzimEquDistProjection::Convert_Azimuthal_Equidistant_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
protected

The function Convert_Azimuthal_Equidistant_To_Geodetic converts Azimuthal Equidistant projection (easting and northing) coordinates to geodetic (latitude and longitude) coordinates, according to the current ellipsoid and Azimuthal Equidistant projection coordinates. If any errors occur, the error code(s) are returned by the function, otherwise AZEQ_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 404 of file ossimAzimEquDistProjection.cpp.

References abs_Azeq_Origin_Lat, Azeq_False_Easting, Azeq_False_Northing, AZEQ_NO_ERROR, Azeq_Origin_Lat, Azeq_Origin_Long, Cos_Azeq_Origin_Lat, M_PI, PI_OVER_2, Ra, and Sin_Azeq_Origin_Lat.

Referenced by inverse().

408 { /* Begin Convert_Azimuthal_Equidistant_To_Geodetic */
409 /*
410  * The function Convert_Azimuthal_Equidistant_To_Geodetic converts Azimuthal_Equidistant projection
411  * (easting and northing) coordinates to geodetic (latitude and longitude)
412  * coordinates, according to the current ellipsoid and Azimuthal_Equidistant projection
413  * coordinates. If any errors occur, the error code(s) are returned by the
414  * function, otherwise AZEQ_NO_ERROR is returned.
415  *
416  * Easting : Easting (X) in meters (input)
417  * Northing : Northing (Y) in meters (input)
418  * Latitude : Latitude (phi) in radians (output)
419  * Longitude : Longitude (lambda) in radians (output)
420  */
421 
422  double dx, dy;
423  double rho; /* height above ellipsoid */
424  double c; /* angular distance from center */
425  double sin_c, cos_c, dy_sinc;
426  long Error_Code = AZEQ_NO_ERROR;
427 
428 // if ((Easting < (Azeq_False_Easting - Azeq_Delta_Easting))
429 // || (Easting > (Azeq_False_Easting + Azeq_Delta_Easting)))
430 // { /* Easting out of range */
431 // Error_Code |= AZEQ_EASTING_ERROR;
432 // }
433 // if ((Northing < (Azeq_False_Northing - Azeq_Delta_Northing))
434 // || (Northing > (Azeq_False_Northing + Azeq_Delta_Northing)))
435 // { /* Northing out of range */
436 // Error_Code |= AZEQ_NORTHING_ERROR;
437 // }
438 
439  if (!Error_Code)
440  {
441  dy = Northing - Azeq_False_Northing;
442  dx = Easting - Azeq_False_Easting;
443  rho = sqrt(dx * dx + dy * dy);
444  if (fabs(rho) <= 1.0e-10)
445  {
446  *Latitude = Azeq_Origin_Lat;
447  *Longitude = Azeq_Origin_Long;
448  }
449  else
450  {
451  c = rho / Ra;
452  sin_c = sin(c);
453  cos_c = cos(c);
454  dy_sinc = dy * sin_c;
455  *Latitude = asin((cos_c * Sin_Azeq_Origin_Lat) + ((dy_sinc * Cos_Azeq_Origin_Lat) / rho));
456  if (fabs(abs_Azeq_Origin_Lat - PI_OVER_2) < 1.0e-10)
457  {
458  if (Azeq_Origin_Lat >= 0.0)
459  *Longitude = Azeq_Origin_Long + atan2(dx, -dy);
460  else
461  *Longitude = Azeq_Origin_Long + atan2(dx, dy);
462  }
463  else
464  *Longitude = Azeq_Origin_Long + atan2((dx * sin_c), ((rho * Cos_Azeq_Origin_Lat * cos_c) - (dy_sinc * Sin_Azeq_Origin_Lat)));
465  }
466 
467  if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
468  *Latitude = PI_OVER_2;
469  else if (*Latitude < -PI_OVER_2)
470  *Latitude = -PI_OVER_2;
471 
472 // if (*Longitude > M_PI)
473 // *Longitude -= TWO_PI;
474 // if (*Longitude < -M_PI)
475 // *Longitude += TWO_PI;
476 
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  }
483  return (Error_Code);
484 } /* End Convert_Azimuthal_Equidistant_To_Geodetic */
#define AZEQ_NO_ERROR
#define M_PI
#define PI_OVER_2

◆ Convert_Geodetic_To_Azimuthal_Equidistant()

long ossimAzimEquDistProjection::Convert_Geodetic_To_Azimuthal_Equidistant ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
protected

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

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

Definition at line 282 of file ossimAzimEquDistProjection.cpp.

References abs_Azeq_Origin_Lat, Azeq_False_Easting, Azeq_False_Northing, AZEQ_NO_ERROR, Azeq_Origin_Lat, Azeq_Origin_Long, AZEQ_PROJECTION_ERROR, Cos_Azeq_Origin_Lat, M_PI, PI_OVER_2, Ra, Sin_Azeq_Origin_Lat, and TWO_PI.

Referenced by forward(), and Set_Azimuthal_Equidistant_Parameters().

286 {
287 /* Begin Convert_Geodetic_To_Azimuthal_Equidistant */
288 /*
289  * The function Convert_Geodetic_To_Azimuthal_Equidistant converts geodetic (latitude and
290  * longitude) coordinates to Azimuthal Equidistant projection (easting and northing)
291  * coordinates, according to the current ellipsoid and Azimuthal Equidistant projection
292  * parameters. If any errors occur, the error code(s) are returned by the
293  * function, otherwise AZEQ_NO_ERROR is returned.
294  *
295  * Latitude : Latitude (phi) in radians (input)
296  * Longitude : Longitude (lambda) in radians (input)
297  * Easting : Easting (X) in meters (output)
298  * Northing : Northing (Y) in meters (output)
299  */
300 
301  double dlam; /* Longitude - Central Meridan */
302  double k_prime; /* scale factor */
303  double c; /* angular distance from center */
304  double slat = sin(Latitude);
305  double clat = cos(Latitude);
306  double cos_c;
307  double sin_dlam, cos_dlam;
308  double Ra_kprime;
309  double Ra_PI_OVER_2_Lat;
310  long Error_Code = AZEQ_NO_ERROR;
311 
312 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
313 // { /* Latitude out of range */
314 // Error_Code |= AZEQ_LAT_ERROR;
315 // }
316 // if ((Longitude < -M_PI) || (Longitude > TWO_PI))
317 // { /* Longitude out of range */
318 // Error_Code |= AZEQ_LON_ERROR;
319 // }
320  if (!Error_Code)
321  { /* no errors */
322  dlam = Longitude - Azeq_Origin_Long;
323  if (dlam > M_PI)
324  {
325  dlam -= TWO_PI;
326  }
327  if (dlam < -M_PI)
328  {
329  dlam += TWO_PI;
330  }
331 
332  sin_dlam = sin(dlam);
333  cos_dlam = cos(dlam);
334  if (fabs(abs_Azeq_Origin_Lat - PI_OVER_2) < 1.0e-10)
335  {
336  if (Azeq_Origin_Lat >= 0.0)
337  {
338  Ra_PI_OVER_2_Lat = Ra * (PI_OVER_2 - Latitude);
339  *Easting = Ra_PI_OVER_2_Lat * sin_dlam + Azeq_False_Easting;
340  *Northing = -1.0 * (Ra_PI_OVER_2_Lat * cos_dlam) + Azeq_False_Northing;
341  }
342  else
343  {
344  Ra_PI_OVER_2_Lat = Ra * (PI_OVER_2 + Latitude);
345  *Easting = Ra_PI_OVER_2_Lat * sin_dlam + Azeq_False_Easting;
346  *Northing = Ra_PI_OVER_2_Lat * cos_dlam + Azeq_False_Northing;
347  }
348  }
349  else if (abs_Azeq_Origin_Lat <= 1.0e-10)
350  {
351  cos_c = clat * cos_dlam;
352  if (fabs(fabs(cos_c) - 1.0) < 1.0e-14)
353  {
354  if (cos_c >= 0.0)
355  {
356  *Easting = Azeq_False_Easting;
357  *Northing = Azeq_False_Northing;
358  }
359  else
360  {
361  /* if cos_c == -1 */
362  Error_Code |= AZEQ_PROJECTION_ERROR;
363  }
364  }
365  else
366  {
367  c = acos(cos_c);
368  k_prime = c / sin(c);
369  Ra_kprime = Ra * k_prime;
370  *Easting = Ra_kprime * clat * sin_dlam + Azeq_False_Easting;
371  *Northing = Ra_kprime * slat + Azeq_False_Northing;
372  }
373  }
374  else
375  {
376  cos_c = (Sin_Azeq_Origin_Lat * slat) + (Cos_Azeq_Origin_Lat * clat * cos_dlam);
377  if (fabs(fabs(cos_c) - 1.0) < 1.0e-14)
378  {
379  if (cos_c >= 0.0)
380  {
381  *Easting = Azeq_False_Easting;
382  *Northing = Azeq_False_Northing;
383  }
384  else
385  {
386  /* if cos_c == -1 */
387  Error_Code |= AZEQ_PROJECTION_ERROR;
388  }
389  }
390  else
391  {
392  c = acos(cos_c);
393  k_prime = c / sin(c);
394  Ra_kprime = Ra * k_prime;
395  *Easting = Ra_kprime * clat * sin_dlam + Azeq_False_Easting;
396  *Northing = Ra_kprime * (Cos_Azeq_Origin_Lat * slat - Sin_Azeq_Origin_Lat * clat * cos_dlam) + Azeq_False_Northing;
397  }
398  }
399  }
400  return (Error_Code);
401 } /* End Convert_Geodetic_To_Azimuthal_Equidistant */
#define AZEQ_NO_ERROR
#define M_PI
#define PI_OVER_2
#define AZEQ_PROJECTION_ERROR
#define TWO_PI

◆ dup()

virtual ossimObject* ossimAzimEquDistProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 33 of file ossimAzimEquDistProjection.h.

34  {
35  return new ossimAzimEquDistProjection(*this);
36  }
ossimAzimEquDistProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 79 of file ossimAzimEquDistProjection.cpp.

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

80 {
81  double easting = 0.0;
82  double northing = 0.0;
83  ossimGpt gpt = latLon;
84 
85  if (theDatum)
86  {
87  if (theDatum->code() != latLon.datum()->code())
88  {
89  gpt.changeDatum(theDatum); // Shift to our datum.
90  }
91  }
92 
94  gpt.lonr(),
95  &easting,
96  &northing);
97  return ossimDpt(easting, northing);
98 }
long Convert_Geodetic_To_Azimuthal_Equidistant(double Latitude, double Longitude, 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_Azimuthal_Equidistant_Parameters()

void ossimAzimEquDistProjection::Get_Azimuthal_Equidistant_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
protected

The function Get_Azimuthal_Equidistant_Parameters returns the current ellipsoid parameters and Azimuthal Equidistant projection parameters.

a : Semi-major axis of ellipsoid, in meters (output) f : Flattening of ellipsoid (output) Origin_Latitude : Latitude in radians at which the (output) point scale factor is 1.0 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 248 of file ossimAzimEquDistProjection.cpp.

References Azeq_a, Azeq_f, Azeq_False_Easting, Azeq_False_Northing, Azeq_Origin_Lat, and Azeq_Origin_Long.

254 {
255 /* Begin Get_Azimuthal_Equidistant_Parameters */
256 /*
257  * The function Get_Azimuthal_Equidistant_Parameters returns the current ellipsoid
258  * parameters and Azimuthal Equidistant projection parameters.
259  *
260  * a : Semi-major axis of ellipsoid, in meters (output)
261  * f : Flattening of ellipsoid (output)
262  * Origin_Latitude : Latitude in radians at which the (output)
263  * point scale factor is 1.0
264  * Central_Meridian : Longitude in radians at the center of (output)
265  * the projection
266  * False_Easting : A coordinate value in meters assigned to the
267  * central meridian of the projection. (output)
268  * False_Northing : A coordinate value in meters assigned to the
269  * origin latitude of the projection (output)
270  */
271 
272  *a = Azeq_a;
273  *f = Azeq_f;
274  *Origin_Latitude = Azeq_Origin_Lat;
275  *Central_Meridian = Azeq_Origin_Long;
276  *False_Easting = Azeq_False_Easting;
277  *False_Northing = Azeq_False_Northing;
278  return;
279 } /* End Get_Azimuthal_Equidistant_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 42 of file ossimAzimEquDistProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 43 of file ossimAzimEquDistProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 67 of file ossimAzimEquDistProjection.cpp.

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

68 {
69  double lat, lon;
70 
72  eastingNorthing.y,
73  &lat,
74  &lon);
75 
76  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
77 }
#define DEG_PER_RAD
long Convert_Azimuthal_Equidistant_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 ossimAzimEquDistProjection::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 135 of file ossimAzimEquDistProjection.cpp.

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

136 {
137  // Must do first...
138  bool flag = ossimMapProjection::loadState(kwl, prefix);
139 
140  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
141  setDefaults();
143  {
146  }
147 
148  update();
149 
150  return flag;
151 }
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 ossimAzimEquDistProjection::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 130 of file ossimAzimEquDistProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Azimuthal_Equidistant_Parameters()

long ossimAzimEquDistProjection::Set_Azimuthal_Equidistant_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
protected

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

a : Semi-major axis of ellipsoid, in meters (input) f : Flattening of ellipsoid (input) Origin_Latitude : Latitude in radians at which the (input) point scale factor is 1.0 Central_Meridian : Longitude in radians at the center of (input) the projection False_Easting : A coordinate value in meters assigned to the central meridian of the projection. (input) False_Northing : A coordinate value in meters assigned to the origin latitude of the projection (input)

Definition at line 153 of file ossimAzimEquDistProjection.cpp.

References abs_Azeq_Origin_Lat, Azeq_a, Azeq_Delta_Easting, Azeq_Delta_Northing, Azeq_f, Azeq_False_Easting, Azeq_False_Northing, AZEQ_NO_ERROR, Azeq_Origin_Lat, Azeq_Origin_Long, Convert_Geodetic_To_Azimuthal_Equidistant(), Cos_Azeq_Origin_Lat, M_PI, ONE, PI_OVER_2, Ra, and Sin_Azeq_Origin_Lat.

Referenced by update().

159 {
160 /* BEGIN Set_Azimuthal_Equidistant_Parameters */
161 /*
162  * The function Set_Azimuthal_Equidistant_Parameters receives the ellipsoid parameters and
163  * projection parameters as inputs, and sets the corresponding state
164  * variables. If any errors occur, the error code(s) are returned by the function,
165  * otherwise AZEQ_NO_ERROR is returned.
166  *
167  * a : Semi-major axis of ellipsoid, in meters (input)
168  * f : Flattening of ellipsoid (input)
169  * Origin_Latitude : Latitude in radians at which the (input)
170  * point scale factor is 1.0
171  * Central_Meridian : Longitude in radians at the center of (input)
172  * the projection
173  * False_Easting : A coordinate value in meters assigned to the
174  * central meridian of the projection. (input)
175  * False_Northing : A coordinate value in meters assigned to the
176  * origin latitude of the projection (input)
177  */
178 
179  double es2, es4, es6;
180 // double inv_f = 1 / f;
181  double temp_Northing = 0.0;
182  long Error_Code = AZEQ_NO_ERROR;
183 
184 // if (a <= 0.0)
185 // { /* Semi-major axis must be greater than zero */
186 // Error_Code |= AZEQ_A_ERROR;
187 // }
188 // if ((inv_f < 250) || (inv_f > 350))
189 // { /* Inverse flattening must be between 250 and 350 */
190 // Error_Code |= AZEQ_INV_F_ERROR;
191 // }
192 // if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
193 // { /* origin latitude out of range */
194 // Error_Code |= AZEQ_ORIGIN_LAT_ERROR;
195 // }
196 // if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
197 // { /* origin longitude out of range */
198 // Error_Code |= AZEQ_CENT_MER_ERROR;
199 // }
200  if (!Error_Code)
201  { /* no errors */
202  Azeq_a = a;
203  Azeq_f = f;
204  es2 = 2 * Azeq_f - Azeq_f * Azeq_f;
205  es4 = es2 * es2;
206  es6 = es4 * es2;
207  /* spherical radius */
208  Ra = Azeq_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 / 3024.0);
209  Azeq_Origin_Lat = Origin_Latitude;
213 // if (Central_Meridian > M_PI)
214 // Central_Meridian -= TWO_PI;
215  Azeq_Origin_Long = Central_Meridian;
216  Azeq_False_Northing = False_Northing;
217  Azeq_False_Easting = False_Easting;
218 
219  if (fabs(abs_Azeq_Origin_Lat - PI_OVER_2) < 1.0e-10)
220  {
221  Azeq_Delta_Northing = 20015110.0;
222  Azeq_Delta_Easting = 20015110.0;
223  }
224  else if (abs_Azeq_Origin_Lat >= 1.0e-10)
225  {
226  if (Azeq_Origin_Long > 0.0)
227  {
229  (Azeq_Origin_Long - M_PI - ONE), &Azeq_Delta_Easting, &temp_Northing);
230  }
231  else
232  {
234  (Azeq_Origin_Long + M_PI - ONE), &Azeq_Delta_Easting, &temp_Northing);
235  }
236  Azeq_Delta_Northing = 19903915.0;
237  }
238  else
239  {
240  Azeq_Delta_Northing = 19903915.0;
241  Azeq_Delta_Easting = 19903915.0;
242  }
243  } /* End if(!Error_Code) */
244  return (Error_Code);
245 } /* End Set_Azimuthal_Equidistant_Parameters */
long Convert_Geodetic_To_Azimuthal_Equidistant(double Latitude, double Longitude, double *Easting, double *Northing) const
#define AZEQ_NO_ERROR
#define M_PI
#define PI_OVER_2

◆ setDefaults()

void ossimAzimEquDistProjection::setDefaults ( )

Will initialize all parameters to a default values and then call update for pre-computations.

Definition at line 123 of file ossimAzimEquDistProjection.cpp.

References Azeq_False_Easting, Azeq_False_Northing, and update().

Referenced by loadState().

◆ setFalseEasting()

void ossimAzimEquDistProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 100 of file ossimAzimEquDistProjection.cpp.

References Azeq_False_Easting, and update().

101 {
102  Azeq_False_Easting = falseEasting;
103 
104  update();
105 }

◆ setFalseEastingNorthing()

void ossimAzimEquDistProjection::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 114 of file ossimAzimEquDistProjection.cpp.

References Azeq_False_Easting, Azeq_False_Northing, and update().

Referenced by ossimAzimEquDistProjection().

116 {
117  Azeq_False_Easting = falseEasting;
118  Azeq_False_Northing = falseNorthing;
119 
120  update();
121 }

◆ setFalseNorthing()

void ossimAzimEquDistProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 107 of file ossimAzimEquDistProjection.cpp.

References Azeq_False_Northing, and update().

108 {
109  Azeq_False_Northing = falseNorthing;
110 
111  update();
112 }

◆ update()

void ossimAzimEquDistProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 52 of file ossimAzimEquDistProjection.cpp.

References Azeq_False_Easting, Azeq_False_Northing, ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::latr(), ossimGpt::lonr(), Set_Azimuthal_Equidistant_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

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

53 {
56  theOrigin.latr(),
57  theOrigin.lonr(),
60 
63 
65 }
double y
Definition: ossimDpt.h:165
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.
long Set_Azimuthal_Equidistant_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)

Member Data Documentation

◆ abs_Azeq_Origin_Lat

double ossimAzimEquDistProjection::abs_Azeq_Origin_Lat
mutableprotected

◆ Azeq_a

double ossimAzimEquDistProjection::Azeq_a
mutableprotected

◆ Azeq_Delta_Easting

double ossimAzimEquDistProjection::Azeq_Delta_Easting
mutableprotected

Definition at line 99 of file ossimAzimEquDistProjection.h.

Referenced by Set_Azimuthal_Equidistant_Parameters().

◆ Azeq_Delta_Northing

double ossimAzimEquDistProjection::Azeq_Delta_Northing
mutableprotected

Definition at line 98 of file ossimAzimEquDistProjection.h.

Referenced by Set_Azimuthal_Equidistant_Parameters().

◆ Azeq_f

double ossimAzimEquDistProjection::Azeq_f
mutableprotected

◆ Azeq_False_Easting

double ossimAzimEquDistProjection::Azeq_False_Easting
mutableprotected

◆ Azeq_False_Northing

double ossimAzimEquDistProjection::Azeq_False_Northing
mutableprotected

◆ Azeq_Origin_Lat

double ossimAzimEquDistProjection::Azeq_Origin_Lat
mutableprotected

◆ Azeq_Origin_Long

double ossimAzimEquDistProjection::Azeq_Origin_Long
mutableprotected

◆ Cos_Azeq_Origin_Lat

double ossimAzimEquDistProjection::Cos_Azeq_Origin_Lat
mutableprotected

◆ Ra

double ossimAzimEquDistProjection::Ra
mutableprotected

◆ Sin_Azeq_Origin_Lat

double ossimAzimEquDistProjection::Sin_Azeq_Origin_Lat
mutableprotected

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