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

#include <ossimOrthoGraphicProjection.h>

Inheritance diagram for ossimOrthoGraphicProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimOrthoGraphicProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimOrthoGraphicProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, const double falseEasting, const double falseNorthing)
 
 ~ossimOrthoGraphicProjection ()
 
virtual ossimObjectdup () const
 
virtual void getGroundClipPoints (ossimGeoPolygon &gpts) 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 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_Orthographic_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Orthographic_Parameters (double *a, double *f, double *Origin_Latitude, double *Origin_Longitude, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Orthographic (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Orthographic_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Orth_a
 
double Orth_f
 
double es2
 
double es4
 
double es6
 
double Ra
 
double Orth_Origin_Lat
 
double Orth_Origin_Long
 
double Orth_False_Easting
 
double Orth_False_Northing
 
double Sin_Orth_Origin_Lat
 
double Cos_Orth_Origin_Lat
 

Additional Inherited Members

- Protected Member Functions inherited from ossimMapProjection
virtual ~ossimMapProjection ()
 
void updateFromTransform ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimMapProjection
ossimEllipsoid theEllipsoid
 This method verifies that the projection parameters match the current pcs code. More...
 
ossimGpt theOrigin
 
const ossimDatumtheDatum
 This is only set if we want to have built in datum shifting. More...
 
ossimDpt theMetersPerPixel
 Holds the number of meters per pixel. More...
 
ossimDpt theDegreesPerPixel
 Hold the decimal degrees per pixel. More...
 
ossimGpt theUlGpt
 Hold tie point in decimal degrees. More...
 
ossimDpt theUlEastingNorthing
 Hold tie point as easting northing. More...
 
ossimDpt theFalseEastingNorthing
 Hold the false easting northing. More...
 
ossim_uint32 thePcsCode
 Projection Coordinate System(PCS) code. More...
 
bool theElevationLookupFlag
 
ossimMatrix4x4 theModelTransform
 
ossimMatrix4x4 theInverseModelTransform
 
ossimUnitType theModelTransformUnitType
 
ossimUnitType theProjectionUnits
 Linear units of the projection as indicated in the projection's specification: More...
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 18 of file ossimOrthoGraphicProjection.h.

Constructor & Destructor Documentation

◆ ossimOrthoGraphicProjection() [1/2]

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

Definition at line 45 of file ossimOrthoGraphicProjection.cpp.

References setDefaults(), and update().

Referenced by dup().

47  :ossimMapProjection(ellipsoid, origin)
48 {
49  setDefaults();
50  update();
51 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimOrthoGraphicProjection() [2/2]

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

Definition at line 53 of file ossimOrthoGraphicProjection.cpp.

References Orth_False_Easting, Orth_False_Northing, and update().

57  :ossimMapProjection(ellipsoid, origin)
58 {
59  Orth_False_Easting = falseEasting;
60  Orth_False_Northing = falseNorthing;
61 
62  update();
63 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimOrthoGraphicProjection()

ossimOrthoGraphicProjection::~ossimOrthoGraphicProjection ( )
inline

Definition at line 28 of file ossimOrthoGraphicProjection.h.

28 {}

Member Function Documentation

◆ Convert_Geodetic_To_Orthographic()

long ossimOrthoGraphicProjection::Convert_Geodetic_To_Orthographic ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

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

References Cos_Orth_Origin_Lat, M_PI, Orth_False_Easting, Orth_False_Northing, ORTH_LAT_ERROR, ORTH_LON_ERROR, ORTH_NO_ERROR, Orth_Origin_Long, PI_OVER_2, Ra, Sin_Orth_Origin_Lat, and TWO_PI.

Referenced by forward().

319 { /* BEGIN Convert_Geodetic_To_Orthographic */
320 /*
321  * The function Convert_Geodetic_To_Orthographic converts geodetic (latitude and
322  * longitude) coordinates to Orthographic projection (easting and northing)
323  * coordinates, according to the current ellipsoid and Orthographic projection
324  * parameters. If any errors occur, the error code(s) are returned by the
325  * function, otherwise ORTH_NO_ERROR is returned.
326  *
327  * Latitude : Latitude (phi) in radians (input)
328  * Longitude : Longitude (lambda) in radians (input)
329  * Easting : Easting (X) in meters (output)
330  * Northing : Northing (Y) in meters (output)
331  */
332 
333  double slat = sin(Latitude);
334  double clat = cos(Latitude);
335  double dlam; /* Longitude - Central Meridan */
336  double clat_cdlam;
337  double cos_c; /* Value used to determine whether the point is beyond
338  viewing. If zero or positive, the point is within view. */
339  long Error_Code = ORTH_NO_ERROR;
340 
341  if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
342  { /* Latitude out of range */
343  Error_Code |= ORTH_LAT_ERROR;
344  }
345  if ((Longitude < -M_PI) || (Longitude > TWO_PI))
346  { /* Longitude out of range */
347  Error_Code|= ORTH_LON_ERROR;
348  }
349  dlam = Longitude - Orth_Origin_Long;
350  clat_cdlam = clat * cos(dlam);
351  cos_c = Sin_Orth_Origin_Lat * slat + Cos_Orth_Origin_Lat * clat_cdlam;
352  if (cos_c < 0.0)
353  { /* Point is out of view. Will return longitude out of range message
354  since no point out of view is implemented. */
355  Error_Code |= ORTH_LON_ERROR;
356  }
357 
358  if (!Error_Code)
359  { /* no errors */
360  if (dlam > M_PI)
361  {
362  dlam -= TWO_PI;
363  }
364  if (dlam < -M_PI)
365  {
366  dlam += TWO_PI;
367  }
368  *Easting = Ra * clat * sin(dlam) + Orth_False_Easting;
369  *Northing = Ra * (Cos_Orth_Origin_Lat * slat - Sin_Orth_Origin_Lat * clat_cdlam) +
371  }
372  return (Error_Code);
373 
374 } /* END OF Convert_Geodetic_To_Orthographic */
#define ORTH_NO_ERROR
#define ORTH_LON_ERROR
#define M_PI
#define ORTH_LAT_ERROR
#define PI_OVER_2

◆ Convert_Orthographic_To_Geodetic()

long ossimOrthoGraphicProjection::Convert_Orthographic_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

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

References Cos_Orth_Origin_Lat, MAX_LAT, ORTH_EASTING_ERROR, Orth_False_Easting, Orth_False_Northing, ORTH_NO_ERROR, ORTH_NORTHING_ERROR, Orth_Origin_Lat, Orth_Origin_Long, ORTH_RADIUS_ERROR, Ra, and Sin_Orth_Origin_Lat.

Referenced by inverse().

381 { /* BEGIN Convert_Orthographic_To_Geodetic */
382 /*
383  * The function Convert_Orthographic_To_Geodetic converts Orthographic projection
384  * (easting and northing) coordinates to geodetic (latitude and longitude)
385  * coordinates, according to the current ellipsoid and Orthographic projection
386  * coordinates. If any errors occur, the error code(s) are returned by the
387  * function, otherwise ORTH_NO_ERROR is returned.
388  *
389  * Easting : Easting (X) in meters (input)
390  * Northing : Northing (Y) in meters (input)
391  * Latitude : Latitude (phi) in radians (output)
392  * Longitude : Longitude (lambda) in radians (output)
393  */
394 
395  double cc;
396  double cos_cc, sin_cc;
397  double rho;
398  double dx, dy;
399  double atan_dx_over_dy;
400 // double temp;
401  double rho_OVER_Ra;
402  long Error_Code = ORTH_NO_ERROR;
403 
404  if ((Easting > (Orth_False_Easting + Ra)) ||
405  (Easting < (Orth_False_Easting - Ra)))
406  { /* Easting out of range */
407  Error_Code |= ORTH_EASTING_ERROR;
408  }
409  if ((Northing > (Orth_False_Northing + Ra)) ||
410  (Northing < (Orth_False_Northing - Ra)))
411  { /* Northing out of range */
412  Error_Code |= ORTH_NORTHING_ERROR;
413  }
414  if (!Error_Code)
415  {
416  double temp = sqrt(Easting * Easting + Northing * Northing);
417 
418  if ((temp > (Orth_False_Easting + Ra)) || (temp > (Orth_False_Northing + Ra)) ||
419  (temp < (Orth_False_Easting - Ra)) || (temp < (Orth_False_Northing - Ra)))
420  { /* Point is outside of projection area */
421  Error_Code |= ORTH_RADIUS_ERROR;
422  }
423  }
424 
425  if (!Error_Code)
426  {
427  dx = Easting - Orth_False_Easting;
428  dy = Northing - Orth_False_Northing;
429  atan_dx_over_dy = atan(dx / dy);
430  rho = sqrt(dx * dx + dy * dy);
431  if (rho == 0.0)
432  {
433  *Latitude = Orth_Origin_Lat;
434  *Longitude = Orth_Origin_Long;
435  }
436  else
437  {
438  rho_OVER_Ra = rho / Ra;
439 
440  if (rho_OVER_Ra > 1.0)
441  rho_OVER_Ra = 1.0;
442  else if (rho_OVER_Ra < -1.0)
443  rho_OVER_Ra = -1.0;
444 
445  cc = asin(rho_OVER_Ra);
446  cos_cc = cos(cc);
447  sin_cc = sin(cc);
448  *Latitude = asin(cos_cc * Sin_Orth_Origin_Lat + (dy * sin_cc * Cos_Orth_Origin_Lat / rho));
449 
450  if (Orth_Origin_Lat == MAX_LAT)
451  *Longitude = Orth_Origin_Long - atan_dx_over_dy;
452  else if (Orth_Origin_Lat == -MAX_LAT)
453  *Longitude = Orth_Origin_Long + atan_dx_over_dy;
454  else
455  *Longitude = Orth_Origin_Long + atan(dx * sin_cc / (rho *
456  Cos_Orth_Origin_Lat * cos_cc - dy * Sin_Orth_Origin_Lat * sin_cc));
457 
458 // if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
459 // *Latitude = PI_OVER_2;
460 // else if (*Latitude < -PI_OVER_2)
461 // *Latitude = -PI_OVER_2;
462 
463 // if (*Longitude > M_PI)
464 // *Longitude -= TWO_PI;
465 // if (*Longitude < -M_PI)
466 // *Longitude += TWO_PI;
467 
468 // if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
469 // *Longitude = M_PI;
470 // else if (*Longitude < -M_PI)
471 // *Longitude = -M_PI;
472  }
473  }
474  return (Error_Code);
475 } /* END OF Convert_Orthographic_To_Geodetic */
#define ORTH_NO_ERROR
#define ORTH_NORTHING_ERROR
#define ORTH_RADIUS_ERROR
#define ORTH_EASTING_ERROR

◆ dup()

virtual ossimObject* ossimOrthoGraphicProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 30 of file ossimOrthoGraphicProjection.h.

References ossimOrthoGraphicProjection().

31  {
32  return new ossimOrthoGraphicProjection(*this);
33  }
ossimOrthoGraphicProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 152 of file ossimOrthoGraphicProjection.cpp.

References ossimGpt::changeDatum(), ossimDatum::code(), Convert_Geodetic_To_Orthographic(), ossimGpt::datum(), ossimGpt::latr(), ossimGpt::lonr(), ossimDpt::makeNan(), ORTH_NO_ERROR, and ossimMapProjection::theDatum.

153 {
154 
155  double easting = 0.0;
156  double northing = 0.0;
157  ossimGpt gpt = latLon;
158  ossimDpt result;
159 
160  if (theDatum)
161  {
162  if (theDatum->code() != latLon.datum()->code())
163  {
164  gpt.changeDatum(theDatum); // Shift to our datum.
165  }
166  }
167 
169  gpt.lonr(),
170  &easting,
171  &northing) == ORTH_NO_ERROR)
172  {
173  result = ossimDpt(easting, northing);
174  }
175  else
176  {
177  result.makeNan();
178  }
179 
180  return result;
181 }
#define ORTH_NO_ERROR
virtual const ossimString & code() const
Definition: ossimDatum.h:57
long Convert_Geodetic_To_Orthographic(double Latitude, double Longitude, double *Easting, double *Northing) const
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
void makeNan()
Definition: ossimDpt.h:65
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ Get_Orthographic_Parameters()

void ossimOrthoGraphicProjection::Get_Orthographic_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Origin_Longitude,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Orthographic_Parameters returns the current ellipsoid parameters and Orthographic 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 Origin_Longitude : Longitude in radians at the center of (output) the projection (central meridian) 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 280 of file ossimOrthoGraphicProjection.cpp.

References Orth_a, Orth_f, Orth_False_Easting, Orth_False_Northing, Orth_Origin_Lat, and Orth_Origin_Long.

286 { /* BEGIN Get_Orthographic_Parameters */
287 /*
288  * The function Get_Orthographic_Parameters returns the current ellipsoid
289  * parameters and Orthographic projection parameters.
290  *
291  * a : Semi-major axis of ellipsoid, in meters (output)
292  * f : Flattening of ellipsoid (output)
293  * Origin_Latitude : Latitude in radians at which the (output)
294  * point scale factor is 1.0
295  * Central_Meridian : Longitude in radians at the center of (output)
296  * the projection
297  * False_Easting : A coordinate value in meters assigned to the
298  * central meridian of the projection. (output)
299  * False_Northing : A coordinate value in meters assigned to the
300  * origin latitude of the projection (output)
301  */
302 
303  *a = Orth_a;
304  *f = Orth_f;
305  *Origin_Latitude = Orth_Origin_Lat;
306  *Central_Meridian = Orth_Origin_Long;
307  *False_Easting = Orth_False_Easting;
308  *False_Northing = Orth_False_Northing;
309 
310  return;
311 } /* END OF Get_Orthographic_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 59 of file ossimOrthoGraphicProjection.h.

References Orth_False_Easting.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 60 of file ossimOrthoGraphicProjection.h.

References Orth_False_Northing.

◆ getGroundClipPoints()

void ossimOrthoGraphicProjection::getGroundClipPoints ( ossimGeoPolygon gpts) const
virtual

Reimplemented from ossimProjection.

Definition at line 107 of file ossimOrthoGraphicProjection.cpp.

References ossimGeoPolygon::addPoint(), ossimGpt::latd(), ossimGpt::lond(), ossimMapProjection::theDatum, and ossimMapProjection::theOrigin.

108 {
109 
111  theOrigin.lond()-90.0,
112  0.0,
113  theDatum));
114  gpts.addPoint(ossimGpt(theOrigin.latd()+90.0,
115  theOrigin.lond(),
116  0.0,
117  theDatum));
119  theOrigin.lond()+90.0,
120  0.0,
121  theDatum));
122  gpts.addPoint(ossimGpt(theOrigin.latd()-90.0,
123  theOrigin.lond(),
124  0.0,
125  theDatum));
126 
127 
128 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
void addPoint(const ossimGpt &pt)
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 130 of file ossimOrthoGraphicProjection.cpp.

References Convert_Orthographic_To_Geodetic(), ossimGpt::datum(), ossimGpt::latr(), ossimGpt::lonr(), ossimGpt::makeNan(), ORTH_NO_ERROR, ossimMapProjection::theDatum, ossimDpt::x, and ossimDpt::y.

131 {
132  double lat = 0.0;
133  double lon = 0.0;
134  ossimGpt result;
135  if(Convert_Orthographic_To_Geodetic(eastingNorthing.x,
136  eastingNorthing.y,
137  &lat,
138  &lon)==ORTH_NO_ERROR)
139  {
140  result.datum(theDatum);
141  result.latr(lat);
142  result.lonr(lon);
143  }
144  else
145  {
146  result.makeNan();
147  }
148 
149  return result;
150 }
#define ORTH_NO_ERROR
void makeNan()
Definition: ossimGpt.h:130
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
long Convert_Orthographic_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) 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.

◆ loadState()

bool ossimOrthoGraphicProjection::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 188 of file ossimOrthoGraphicProjection.cpp.

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

190 {
191  bool flag = ossimMapProjection::loadState(kwl, prefix);
192  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
193 
194  setDefaults();
195 
197  {
200  }
201 
202  update();
203 
204  return flag;
205 }
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 ossimOrthoGraphicProjection::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 183 of file ossimOrthoGraphicProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Orthographic_Parameters()

long ossimOrthoGraphicProjection::Set_Orthographic_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
private

The function Set_Orthographic_Parameters receives the ellipsoid parameters and Orthographic projcetion parameters as inputs, and sets the corresponding state variables. If any errors occur, the error code(s) are returned by the function, otherwise ORTH_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 213 of file ossimOrthoGraphicProjection.cpp.

References Cos_Orth_Origin_Lat, es2, es4, es6, M_PI, Orth_a, ORTH_A_ERROR, ORTH_CENT_MER_ERROR, Orth_f, Orth_False_Easting, Orth_False_Northing, ORTH_NO_ERROR, Orth_Origin_Lat, ORTH_ORIGIN_LAT_ERROR, Orth_Origin_Long, PI_OVER_2, Ra, Sin_Orth_Origin_Lat, and TWO_PI.

Referenced by update().

219 { /* BEGIN Set_Orthographic_Parameters */
220 /*
221  * The function Set_Orthographic_Parameters receives the ellipsoid parameters and
222  * projection parameters as inputs, and sets the corresponding state
223  * variables. If any errors occur, the error code(s) are returned by the function,
224  * otherwise ORTH_NO_ERROR is returned.
225  *
226  * a : Semi-major axis of ellipsoid, in meters (input)
227  * f : Flattening of ellipsoid (input)
228  * Origin_Latitude : Latitude in radians at which the (input)
229  * point scale factor is 1.0
230  * Central_Meridian : Longitude in radians at the center of (input)
231  * the projection
232  * False_Easting : A coordinate value in meters assigned to the
233  * central meridian of the projection. (input)
234  * False_Northing : A coordinate value in meters assigned to the
235  * origin latitude of the projection (input)
236  */
237 
238 // double inv_f = 1 / f;
239  long Error_Code = ORTH_NO_ERROR;
240 
241  if (a <= 0.0)
242  { /* Semi-major axis must be greater than zero */
243  Error_Code |= ORTH_A_ERROR;
244  }
245 // if ((inv_f < 250) || (inv_f > 350))
246 // { /* Inverse flattening must be between 250 and 350 */
247 // Error_Code |= ORTH_INV_F_ERROR;
248 // }
249  if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
250  { /* origin latitude out of range */
251  Error_Code |= ORTH_ORIGIN_LAT_ERROR;
252  }
253  if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
254  { /* origin longitude out of range */
255  Error_Code |= ORTH_CENT_MER_ERROR;
256  }
257  if (!Error_Code)
258  { /* no errors */
259  Orth_a = a;
260  Orth_f = f;
261  es2 = 2 * Orth_f - Orth_f * Orth_f;
262  es4 = es2 * es2;
263  es6 = es4 * es2;
264  Ra = Orth_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 /3024.0);
265  Orth_Origin_Lat = Origin_Latitude;
268 // if (Central_Meridian > M_PI)
269 // Central_Meridian -= TWO_PI;
270  Orth_Origin_Long = Central_Meridian;
271  Orth_False_Easting = False_Easting;
272  Orth_False_Northing = False_Northing;
273 
274  } /* END OF if(!Error_Code) */
275 
276  return (Error_Code);
277 } /* END OF Set_Orthographic_Parameters */
#define ORTH_NO_ERROR
#define M_PI
#define ORTH_ORIGIN_LAT_ERROR
#define ORTH_A_ERROR
#define ORTH_CENT_MER_ERROR
#define PI_OVER_2

◆ setDefaults()

void ossimOrthoGraphicProjection::setDefaults ( )

◆ setFalseEasting()

void ossimOrthoGraphicProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 80 of file ossimOrthoGraphicProjection.cpp.

References Orth_False_Easting, and update().

81 {
82  Orth_False_Easting = falseEasting;
83  update();
84 }

◆ setFalseEastingNorthing()

void ossimOrthoGraphicProjection::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 98 of file ossimOrthoGraphicProjection.cpp.

References Orth_False_Easting, Orth_False_Northing, and update().

100 {
101  Orth_False_Easting = falseEasting;
102  Orth_False_Northing = falseNorthing;
103 
104  update();
105 }

◆ setFalseNorthing()

void ossimOrthoGraphicProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 86 of file ossimOrthoGraphicProjection.cpp.

References Orth_False_Northing, and update().

87 {
88  Orth_False_Northing = falseNorthing;
89  update();
90 }

◆ update()

void ossimOrthoGraphicProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 65 of file ossimOrthoGraphicProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::latr(), ossimGpt::lonr(), Orth_False_Easting, Orth_False_Northing, Set_Orthographic_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

Referenced by ossimEpsgProjectionFactory::createProjFromAutoCode(), loadState(), ossimOrthoGraphicProjection(), setFalseEasting(), setFalseEastingNorthing(), and setFalseNorthing().

66 {
69  theOrigin.latr(),
70  theOrigin.lonr(),
73 
76 
78 }
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_Orthographic_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)

Member Data Documentation

◆ Cos_Orth_Origin_Lat

double ossimOrthoGraphicProjection::Cos_Orth_Origin_Lat
mutableprivate

◆ es2

double ossimOrthoGraphicProjection::es2
mutableprivate

Definition at line 81 of file ossimOrthoGraphicProjection.h.

Referenced by Set_Orthographic_Parameters().

◆ es4

double ossimOrthoGraphicProjection::es4
mutableprivate

Definition at line 82 of file ossimOrthoGraphicProjection.h.

Referenced by Set_Orthographic_Parameters().

◆ es6

double ossimOrthoGraphicProjection::es6
mutableprivate

Definition at line 83 of file ossimOrthoGraphicProjection.h.

Referenced by Set_Orthographic_Parameters().

◆ Orth_a

double ossimOrthoGraphicProjection::Orth_a
mutableprivate

◆ Orth_f

double ossimOrthoGraphicProjection::Orth_f
mutableprivate

◆ Orth_False_Easting

double ossimOrthoGraphicProjection::Orth_False_Easting
mutableprivate

◆ Orth_False_Northing

double ossimOrthoGraphicProjection::Orth_False_Northing
mutableprivate

◆ Orth_Origin_Lat

double ossimOrthoGraphicProjection::Orth_Origin_Lat
mutableprivate

◆ Orth_Origin_Long

double ossimOrthoGraphicProjection::Orth_Origin_Long
mutableprivate

◆ Ra

double ossimOrthoGraphicProjection::Ra
mutableprivate

◆ Sin_Orth_Origin_Lat

double ossimOrthoGraphicProjection::Sin_Orth_Origin_Lat
mutableprivate

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