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

#include <ossimGnomonicProjection.h>

Inheritance diagram for ossimGnomonicProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimGnomonicProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimGnomonicProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, const double falseEasting, const double falseNorthing)
 
 ~ossimGnomonicProjection ()
 
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
 

Protected Member Functions

long Set_Gnomonic_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Gnomonic_Parameters (double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Gnomonic (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Gnomonic_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 Gnom_a
 
double Gnom_f
 
double Ra
 
double Sin_Gnom_Origin_Lat
 
double Cos_Gnom_Origin_Lat
 
double Gnom_Origin_Lat
 
double Gnom_Origin_Long
 
double Gnom_False_Northing
 
double Gnom_False_Easting
 
double abs_Gnom_Origin_Lat
 
double Gnom_Delta_Northing
 
double Gnom_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 16 of file ossimGnomonicProjection.h.

Constructor & Destructor Documentation

◆ ossimGnomonicProjection() [1/2]

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

Definition at line 32 of file ossimGnomonicProjection.cpp.

References setDefaults(), and update().

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

◆ ossimGnomonicProjection() [2/2]

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

Definition at line 40 of file ossimGnomonicProjection.cpp.

References Gnom_False_Easting, Gnom_False_Northing, and update().

44  :ossimMapProjection(ellipsoid, origin)
45 {
46  Gnom_False_Easting = falseEasting;
47  Gnom_False_Northing = falseNorthing;
48 
49  update();
50 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimGnomonicProjection()

ossimGnomonicProjection::~ossimGnomonicProjection ( )
inline

Definition at line 25 of file ossimGnomonicProjection.h.

25 {}

Member Function Documentation

◆ Convert_Geodetic_To_Gnomonic()

long ossimGnomonicProjection::Convert_Geodetic_To_Gnomonic ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
protected

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

References abs_Gnom_Origin_Lat, Cos_Gnom_Origin_Lat, Gnom_False_Easting, Gnom_False_Northing, GNOM_LON_ERROR, GNOM_NO_ERROR, Gnom_Origin_Lat, Gnom_Origin_Long, PI_OVER_2, Ra, and Sin_Gnom_Origin_Lat.

Referenced by forward().

270 { /* Begin Convert_Geodetic_To_Gnomonic */
271 /*
272  * The function Convert_Geodetic_To_Gnomonic converts geodetic (latitude and
273  * longitude) coordinates to Gnomonic projection (easting and northing)
274  * coordinates, according to the current ellipsoid and Gnomonic projection
275  * parameters. If any errors occur, the error code(s) are returned by the
276  * function, otherwise GNOM_NO_ERROR is returned.
277  *
278  * Latitude : Latitude (phi) in radians (input)
279  * Longitude : Longitude (lambda) in radians (input)
280  * Easting : Easting (X) in meters (output)
281  * Northing : Northing (Y) in meters (output)
282  */
283 
284  double dlam; /* Longitude - Central Meridan */
285  double cos_c;
286  double k_prime; /* scale factor */
287  double Ra_kprime;
288  double slat = sin(Latitude);
289  double clat = cos(Latitude);
290  double Ra_cotlat;
291  double sin_dlam, cos_dlam;
292  double temp_Easting, temp_Northing;
293  long Error_Code = GNOM_NO_ERROR;
294 
295 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
296 // { /* Latitude out of range */
297 // Error_Code |= GNOM_LAT_ERROR;
298 // }
299 // if ((Longitude < -PI) || (Longitude > TWO_PI))
300 // { /* Longitude out of range */
301 // Error_Code |= GNOM_LON_ERROR;
302 // }
303  dlam = Longitude - Gnom_Origin_Long;
304  sin_dlam = sin(dlam);
305  cos_dlam = cos(dlam);
306  cos_c = Sin_Gnom_Origin_Lat * slat + Cos_Gnom_Origin_Lat * clat * cos_dlam;
307  if (cos_c <= 1.0e-10)
308  { /* Point is out of view. Will return longitude out of range message
309  since no point out of view is implemented. */
310  Error_Code |= GNOM_LON_ERROR;
311  }
312  if (!Error_Code)
313  { /* no errors */
314 // if (dlam > PI)
315 // {
316 // dlam -= TWO_PI;
317 // }
318 // if (dlam < -PI)
319 // {
320 // dlam += TWO_PI;
321 // }
322  if (fabs(abs_Gnom_Origin_Lat - PI_OVER_2) < 1.0e-10)
323  {
324  Ra_cotlat = Ra * (clat / slat);
325  temp_Easting = Ra_cotlat * sin_dlam;
326  temp_Northing = Ra_cotlat * cos_dlam;
327  if (Gnom_Origin_Lat >= 0.0)
328  {
329  *Easting = temp_Easting + Gnom_False_Easting;
330  *Northing = -1.0 * temp_Northing + Gnom_False_Northing;
331  }
332  else
333  {
334  *Easting = -1.0 * temp_Easting + Gnom_False_Easting;
335  *Northing = temp_Northing + Gnom_False_Northing;
336  }
337  }
338  else if (abs_Gnom_Origin_Lat <= 1.0e-10)
339  {
340  *Easting = Ra * tan(dlam) + Gnom_False_Easting;
341  *Northing = Ra * tan(Latitude) / cos_dlam + Gnom_False_Northing;
342  }
343  else
344  {
345  k_prime = 1 / cos_c;
346  Ra_kprime = Ra * k_prime;
347  *Easting = Ra_kprime * clat * sin_dlam + Gnom_False_Easting;
348  *Northing = Ra_kprime * (Cos_Gnom_Origin_Lat * slat - Sin_Gnom_Origin_Lat * clat * cos_dlam) + Gnom_False_Northing;
349  }
350  }
351  return (Error_Code);
352 } /* End Convert_Geodetic_To_Gnomonic */
#define PI_OVER_2
#define GNOM_LON_ERROR
#define GNOM_NO_ERROR

◆ Convert_Gnomonic_To_Geodetic()

long ossimGnomonicProjection::Convert_Gnomonic_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
protected

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

References abs_Gnom_Origin_Lat, Cos_Gnom_Origin_Lat, Gnom_False_Easting, Gnom_False_Northing, GNOM_NO_ERROR, Gnom_Origin_Lat, Gnom_Origin_Long, PI_OVER_2, Ra, and Sin_Gnom_Origin_Lat.

Referenced by inverse().

359 { /* Begin Convert_Gnomonic_To_Geodetic */
360 /*
361  * The function Convert_Gnomonic_To_Geodetic converts Gnomonic projection
362  * (easting and northing) coordinates to geodetic (latitude and longitude)
363  * coordinates, according to the current ellipsoid and Gnomonic projection
364  * coordinates. If any errors occur, the error code(s) are returned by the
365  * function, otherwise GNOM_NO_ERROR is returned.
366  *
367  * Easting : Easting (X) in meters (input)
368  * Northing : Northing (Y) in meters (input)
369  * Latitude : Latitude (phi) in radians (output)
370  * Longitude : Longitude (lambda) in radians (output)
371  */
372 
373  double dx, dy;
374  double rho;
375  double c;
376  double sin_c, cos_c;
377  double dy_sinc;
378  long Error_Code = GNOM_NO_ERROR;
379 
380 // if ((Easting < (Gnom_False_Easting - Gnom_Delta_Easting))
381 // || (Easting > (Gnom_False_Easting + Gnom_Delta_Easting)))
382 // { /* Easting out of range */
383 // Error_Code |= GNOM_EASTING_ERROR;
384 // }
385 // if ((Northing < (Gnom_False_Northing - Gnom_Delta_Northing))
386 // || (Northing > (Gnom_False_Northing + Gnom_Delta_Northing)))
387 // { /* Northing out of range */
388 // Error_Code |= GNOM_NORTHING_ERROR;
389 // }
390  if (!Error_Code)
391  {
392  dy = Northing - Gnom_False_Northing;
393  dx = Easting - Gnom_False_Easting;
394  rho = sqrt(dx * dx + dy * dy);
395  if (fabs(rho) <= 1.0e-10)
396  {
397  *Latitude = Gnom_Origin_Lat;
398  *Longitude = Gnom_Origin_Long;
399  }
400  else
401  {
402  c = atan(rho / Ra);
403  sin_c = sin(c);
404  cos_c = cos(c);
405  dy_sinc = dy * sin_c;
406  *Latitude = asin((cos_c * Sin_Gnom_Origin_Lat) + ((dy_sinc * Cos_Gnom_Origin_Lat) / rho));
407  if (fabs(abs_Gnom_Origin_Lat - PI_OVER_2) < 1.0e-10)
408  {
409  if (Gnom_Origin_Lat >= 0.0)
410  *Longitude = Gnom_Origin_Long + atan2(dx, -dy);
411  else
412  *Longitude = Gnom_Origin_Long + atan2(dx, dy);
413  }
414  else
415  *Longitude = Gnom_Origin_Long + atan2((dx * sin_c), (rho * Cos_Gnom_Origin_Lat * cos_c - dy_sinc * Sin_Gnom_Origin_Lat));
416  }
417 // if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
418 // *Latitude = PI_OVER_2;
419 // else if (*Latitude < -PI_OVER_2)
420 // *Latitude = -PI_OVER_2;
421 // if (*Longitude > PI)
422 // *Longitude -= TWO_PI;
423 // if (*Longitude < -PI)
424 // *Longitude += TWO_PI;
425 // if (*Longitude > PI) /* force distorted values to 180, -180 degrees */
426 // *Longitude = PI;
427 // else if (*Longitude < -PI)
428 // *Longitude = -PI;
429  }
430  return (Error_Code);
431 } /* End Convert_Gnomonic_To_Geodetic */
#define PI_OVER_2
#define GNOM_NO_ERROR

◆ dup()

virtual ossimObject* ossimGnomonicProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 26 of file ossimGnomonicProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 111 of file ossimGnomonicProjection.cpp.

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

112 {
113  double easting = 0.0;
114  double northing = 0.0;
115  ossimGpt gpt = latLon;
116 
117  if (theDatum)
118  {
119  if (theDatum->code() != latLon.datum()->code())
120  {
121  gpt.changeDatum(theDatum); // Shift to our datum.
122  }
123  }
124 
126  gpt.lonr(),
127  &easting,
128  &northing);
129 
130  return ossimDpt(easting, northing);
131 }
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_Gnomonic(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_Gnomonic_Parameters()

void ossimGnomonicProjection::Get_Gnomonic_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
protected

The function Get_Gnomonic_Parameters returns the current ellipsoid parameters and Gnomonic 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 232 of file ossimGnomonicProjection.cpp.

References Gnom_a, Gnom_f, Gnom_False_Easting, Gnom_False_Northing, Gnom_Origin_Lat, and Gnom_Origin_Long.

238 { /* Begin Get_Gnomonic_Parameters */
239 /*
240  * The function Get_Gnomonic_Parameters returns the current ellipsoid
241  * parameters and Gnomonic projection parameters.
242  *
243  * a : Semi-major axis of ellipsoid, in meters (output)
244  * f : Flattening of ellipsoid (output)
245  * Origin_Latitude : Latitude in radians at which the (output)
246  * point scale factor is 1.0
247  * Central_Meridian : Longitude in radians at the center of (output)
248  * the projection
249  * False_Easting : A coordinate value in meters assigned to the
250  * central meridian of the projection. (output)
251  * False_Northing : A coordinate value in meters assigned to the
252  * origin latitude of the projection (output)
253  */
254 
255  *a = Gnom_a;
256  *f = Gnom_f;
257  *Origin_Latitude = Gnom_Origin_Lat;
258  *Central_Meridian = Gnom_Origin_Long;
259  *False_Easting = Gnom_False_Easting;
260  *False_Northing = Gnom_False_Northing;
261 
262  return;
263 } /* End Get_Gnomonic_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 57 of file ossimGnomonicProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 58 of file ossimGnomonicProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 98 of file ossimGnomonicProjection.cpp.

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

99 {
100  double lat = 0.0;
101  double lon = 0.0;
102 
103  Convert_Gnomonic_To_Geodetic(eastingNorthing.x,
104  eastingNorthing.y,
105  &lat,
106  &lon);
107 
108  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
109 }
#define DEG_PER_RAD
long Convert_Gnomonic_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 ossimGnomonicProjection::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 138 of file ossimGnomonicProjection.cpp.

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

140 {
141  bool flag = ossimMapProjection::loadState(kwl, prefix);
142 
143  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
144 
145  setDefaults();
146 
148  {
151  }
152 
153  update();
154 
155  return flag;
156 
157 }
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 ossimGnomonicProjection::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 133 of file ossimGnomonicProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Gnomonic_Parameters()

long ossimGnomonicProjection::Set_Gnomonic_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
protected

Definition at line 164 of file ossimGnomonicProjection.cpp.

References abs_Gnom_Origin_Lat, Cos_Gnom_Origin_Lat, Gnom_a, Gnom_f, Gnom_False_Easting, Gnom_False_Northing, GNOM_NO_ERROR, Gnom_Origin_Lat, Gnom_Origin_Long, Ra, and Sin_Gnom_Origin_Lat.

Referenced by update().

170 { /* BEGIN Set_Gnomonic_Parameters */
171 /*
172  * The function Set_Gnomonic_Parameters receives the ellipsoid parameters and
173  * projection parameters as inputs, and sets the corresponding state
174  * variables. If any errors occur, the error code(s) are returned by the function,
175  * otherwise GNOM_NO_ERROR is returned.
176  *
177  * a : Semi-major axis of ellipsoid, in meters (input)
178  * f : Flattening of ellipsoid (input)
179  * Origin_Latitude : Latitude in radians at which the (input)
180  * point scale factor is 1.0
181  * Central_Meridian : Longitude in radians at the center of (input)
182  * the projection
183  * False_Easting : A coordinate value in meters assigned to the
184  * central meridian of the projection. (input)
185  * False_Northing : A coordinate value in meters assigned to the
186  * origin latitude of the projection (input)
187  */
188 
189  double es2, es4, es6;
190 // double inv_f = 1 / f;
191  long Error_Code = GNOM_NO_ERROR;
192 
193 // if (a <= 0.0)
194 // { /* Semi-major axis must be greater than zero */
195 // Error_Code |= GNOM_A_ERROR;
196 // }
197 // if ((inv_f < 250) || (inv_f > 350))
198 // { /* Inverse flattening must be between 250 and 350 */
199 // Error_Code |= GNOM_INV_F_ERROR;
200 // }
201 // if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
202 // { /* origin latitude out of range */
203 // Error_Code |= GNOM_ORIGIN_LAT_ERROR;
204 // }
205 // if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
206 // { /* origin longitude out of range */
207 // Error_Code |= GNOM_CENT_MER_ERROR;
208 // }
209  if (!Error_Code)
210  { /* no errors */
211  Gnom_a = a;
212  Gnom_f = f;
213  es2 = 2 * Gnom_f - Gnom_f * Gnom_f;
214  es4 = es2 * es2;
215  es6 = es4 * es2;
216  /* spherical radius */
217  Ra = Gnom_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 / 3024.0);
218  Gnom_Origin_Lat = Origin_Latitude;
222 // if (Central_Meridian > PI)
223 // Central_Meridian -= TWO_PI;
224  Gnom_Origin_Long = Central_Meridian;
225  Gnom_False_Northing = False_Northing;
226  Gnom_False_Easting = False_Easting;
227  } /* End if(!Error_Code) */
228  return (Error_Code);
229 } /* End Set_Gnomonic_Parameters */
#define GNOM_NO_ERROR

◆ setDefaults()

void ossimGnomonicProjection::setDefaults ( )

◆ setFalseEasting()

void ossimGnomonicProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 67 of file ossimGnomonicProjection.cpp.

References Gnom_False_Easting, and update().

68 {
69  Gnom_False_Easting = falseEasting;
70 
71  update();
72 }

◆ setFalseEastingNorthing()

void ossimGnomonicProjection::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 89 of file ossimGnomonicProjection.cpp.

References Gnom_False_Easting, Gnom_False_Northing, and update().

91 {
92  Gnom_False_Easting = falseEasting;
93  Gnom_False_Northing = falseNorthing;
94 
95  update();
96 }

◆ setFalseNorthing()

void ossimGnomonicProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 74 of file ossimGnomonicProjection.cpp.

References Gnom_False_Northing, and update().

75 {
76  Gnom_False_Northing = falseNorthing;
77 
78  update();
79 }

◆ update()

void ossimGnomonicProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 52 of file ossimGnomonicProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), Gnom_False_Easting, Gnom_False_Northing, ossimGpt::latr(), ossimGpt::lonr(), Set_Gnomonic_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

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

53 {
56  theOrigin.latr(),
57  theOrigin.lonr(),
60 
63 
65 }
double y
Definition: ossimDpt.h:165
long Set_Gnomonic_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

◆ abs_Gnom_Origin_Lat

double ossimGnomonicProjection::abs_Gnom_Origin_Lat
mutableprotected

◆ Cos_Gnom_Origin_Lat

double ossimGnomonicProjection::Cos_Gnom_Origin_Lat
mutableprotected

◆ Gnom_a

double ossimGnomonicProjection::Gnom_a
mutableprotected

Definition at line 77 of file ossimGnomonicProjection.h.

Referenced by Get_Gnomonic_Parameters(), and Set_Gnomonic_Parameters().

◆ Gnom_Delta_Easting

double ossimGnomonicProjection::Gnom_Delta_Easting
mutableprotected

Definition at line 91 of file ossimGnomonicProjection.h.

Referenced by setDefaults().

◆ Gnom_Delta_Northing

double ossimGnomonicProjection::Gnom_Delta_Northing
mutableprotected

Definition at line 90 of file ossimGnomonicProjection.h.

Referenced by setDefaults().

◆ Gnom_f

double ossimGnomonicProjection::Gnom_f
mutableprotected

Definition at line 78 of file ossimGnomonicProjection.h.

Referenced by Get_Gnomonic_Parameters(), and Set_Gnomonic_Parameters().

◆ Gnom_False_Easting

double ossimGnomonicProjection::Gnom_False_Easting
mutableprotected

◆ Gnom_False_Northing

double ossimGnomonicProjection::Gnom_False_Northing
mutableprotected

◆ Gnom_Origin_Lat

double ossimGnomonicProjection::Gnom_Origin_Lat
mutableprotected

◆ Gnom_Origin_Long

double ossimGnomonicProjection::Gnom_Origin_Long
mutableprotected

◆ Ra

double ossimGnomonicProjection::Ra
mutableprotected

◆ Sin_Gnom_Origin_Lat

double ossimGnomonicProjection::Sin_Gnom_Origin_Lat
mutableprotected

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