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

#include <ossimCassiniProjection.h>

Inheritance diagram for ossimCassiniProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimCassiniProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimCassiniProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, const double falseEasting, const double falseNorthing)
 
 ~ossimCassiniProjection ()
 
virtual ossimObjectdup () const
 
virtual ossimDpt forward (const ossimGpt &worldPoint) const
 All map projections will convert the world coordinate to an easting northing (Meters). More...
 
virtual ossimGpt inverse (const ossimDpt &projectedPoint) const
 Will take a point in meters and convert it to ground. More...
 
virtual void update ()
 
void setFalseEasting (double falseEasting)
 
void setFalseNorthing (double falseNorthing)
 
void setFalseEastingNorthing (double falseEasting, double falseNorthing)
 
double getFalseEasting () const
 
double getFalseNorthing () const
 
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
 

Private Member Functions

long Set_Cassini_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Cassini_Parameters (double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Cassini (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Cassini_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Cass_a
 
double Cass_f
 
double es2
 
double es4
 
double es6
 
double M0
 
double c0
 
double c1
 
double c2
 
double c3
 
double One_Minus_es2
 
double a0
 
double a1
 
double a2
 
double a3
 
double Cass_Origin_Lat
 
double Cass_Origin_Long
 
double Cass_False_Northing
 
double Cass_False_Easting
 
double Cass_Min_Easting
 
double Cass_Max_Easting
 
double Cass_Min_Northing
 
double Cass_Max_Northing
 

Additional Inherited Members

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

Detailed Description

Definition at line 18 of file ossimCassiniProjection.h.

Constructor & Destructor Documentation

◆ ossimCassiniProjection() [1/2]

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

Definition at line 52 of file ossimCassiniProjection.cpp.

References setDefaults(), and update().

54  :ossimMapProjection(ellipsoid, origin)
55 {
56  setDefaults();
57  update();
58 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimCassiniProjection() [2/2]

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

Definition at line 60 of file ossimCassiniProjection.cpp.

References Cass_False_Easting, Cass_False_Northing, Cass_Max_Easting, Cass_Max_Northing, Cass_Min_Easting, Cass_Min_Northing, and update().

64  :ossimMapProjection(ellipsoid, origin)
65 {
66  Cass_False_Easting = falseEasting;
67  Cass_False_Northing = falseNorthing;
68  Cass_Min_Easting = -20037508.4;
69  Cass_Max_Easting = 20037508.4;
70  Cass_Min_Northing = -56575846.0;
71  Cass_Max_Northing = 56575846.0;
72 
73  update();
74 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimCassiniProjection()

ossimCassiniProjection::~ossimCassiniProjection ( )
inline

Definition at line 27 of file ossimCassiniProjection.h.

27 {}

Member Function Documentation

◆ Convert_Cassini_To_Geodetic()

long ossimCassiniProjection::Convert_Cassini_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

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

References a0, a1, a2, a3, c0, Cass_a, CASS_COEFF_TIMES_SIN, Cass_False_Easting, Cass_False_Northing, CASS_LON_WARNING, CASS_NO_ERROR, Cass_Origin_Long, CASS_RD, FLOAT_EQ, M0, M_PI, One_Minus_es2, and PI_OVER_2.

Referenced by inverse().

419 { /* Begin Convert_Cassini_To_Geodetic */
420 /*
421  * The function Convert_Cassini_To_Geodetic converts Cassini projection
422  * (easting and northing) coordinates to geodetic (latitude and longitude)
423  * coordinates, according to the current ellipsoid and Cassini projection
424  * coordinates. If any errors occur, the error code(s) are returned by the
425  * function, otherwise CASS_NO_ERROR is returned.
426  *
427  * Easting : Easting (X) in meters (input)
428  * Northing : Northing (Y) in meters (input)
429  * Latitude : Latitude (phi) in radians (output)
430  * Longitude : Longitude (lambda) in radians (output)
431  */
432 
433  double dx; /* Delta easting - Difference in easting (easting-FE) */
434  double dy; /* Delta northing - Difference in northing (northing-FN) */
435  double mu1;
436  double sin2mu, sin4mu, sin6mu, sin8mu;
437  double M1;
438  double phi1;
439  double tanphi1, sinphi1, cosphi1;
440  double T1, T;
441  double N1;
442  double RD, R1;
443  double DD, D2, D3, D4, D5;
444 // const double epsilon = 1.0e-1;
445  long Error_Code = CASS_NO_ERROR;
446 
447 // if ((Easting < (Cass_False_Easting + Cass_Min_Easting))
448 // || (Easting > (Cass_False_Easting + Cass_Max_Easting)))
449 // { /* Easting out of range */
450 // Error_Code |= CASS_EASTING_ERROR;
451 // }
452 // if ((Northing < (Cass_False_Northing + Cass_Min_Northing - epsilon))
453 // || (Northing > (Cass_False_Northing + Cass_Max_Northing + epsilon)))
454 // { /* Northing out of range */
455 // Error_Code |= CASS_NORTHING_ERROR;
456 // }
457  if (!Error_Code)
458  { /* no errors */
459  dy = Northing - Cass_False_Northing;
460  dx = Easting - Cass_False_Easting;
461  M1 = M0 + dy;
462  mu1 = M1 / (Cass_a * c0);
463 
464  sin2mu = CASS_COEFF_TIMES_SIN(a0, 2.0, mu1);
465  sin4mu = CASS_COEFF_TIMES_SIN(a1, 4.0, mu1);
466  sin6mu = CASS_COEFF_TIMES_SIN(a2, 6.0, mu1);
467  sin8mu = CASS_COEFF_TIMES_SIN(a3, 8.0, mu1);
468  phi1 = mu1 + sin2mu + sin4mu + sin6mu + sin8mu;
469 
470  if (FLOAT_EQ(phi1,PI_OVER_2,.00001))
471  {
472  *Latitude = PI_OVER_2;
473  *Longitude = Cass_Origin_Long;
474  }
475  else if (FLOAT_EQ(phi1,-PI_OVER_2,.00001))
476  {
477  *Latitude = -PI_OVER_2;
478  *Longitude = Cass_Origin_Long;
479  }
480  else
481  {
482  tanphi1 = tan(phi1);
483  sinphi1 = sin(phi1);
484  cosphi1 = cos(phi1);
485  T1 = tanphi1 * tanphi1;
486  RD = CASS_RD(sinphi1);
487  N1 = Cass_a / RD;
488  R1 = N1 * One_Minus_es2 / (RD * RD);
489  DD = dx / N1;
490  D2 = DD * DD;
491  D3 = D2 * DD;
492  D4 = D3 * DD;
493  D5 = D4 * DD;
494  T = (1.0 + 3.0 * T1);
495  *Latitude = phi1 - (N1 * tanphi1 / R1) * (D2 / 2.0 - T * D4 / 24.0);
496 
497  *Longitude = Cass_Origin_Long + (DD - T1 * D3 / 3.0 + T * T1 * D5 / 15.0) / cosphi1;
498 
499  if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
500  *Latitude = PI_OVER_2;
501  else if (*Latitude < -PI_OVER_2)
502  *Latitude = -PI_OVER_2;
503 
504 // if (*Longitude > PI)
505 // *Longitude -= TWO_PI;
506 // if (*Longitude < -PI)
507 // *Longitude += TWO_PI;
508 
509  if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
510  *Longitude = M_PI;
511  else if (*Longitude < -M_PI)
512  *Longitude = -M_PI;
513  }
514  if (fabs(*Longitude - Cass_Origin_Long) > (4.0 * M_PI / 180.0))
515  { /* Distortion will result if Longitude is more than 4 degrees from the Central Meridian */
516  Error_Code |= CASS_LON_WARNING;
517  }
518  }
519  return (Error_Code);
520 } /* End Convert_Cassini_To_Geodetic */
#define CASS_LON_WARNING
#define CASS_RD(sinlat)
#define CASS_COEFF_TIMES_SIN(coeff, x, latit)
#define PI_OVER_2
#define M_PI
#define CASS_NO_ERROR
#define FLOAT_EQ(x, v, epsilon)

◆ Convert_Geodetic_To_Cassini()

long ossimCassiniProjection::Convert_Geodetic_To_Cassini ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

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

References c0, c1, c2, c3, Cass_a, CASS_COEFF_TIMES_SIN, Cass_False_Easting, Cass_False_Northing, CASS_LON_WARNING, CASS_M, CASS_NO_ERROR, Cass_Origin_Long, CASS_RD, es2, M0, M_PI, One_Minus_es2, and TWO_PI.

Referenced by forward(), and Set_Cassini_Parameters().

339 { /* Begin Convert_Geodetic_To_Cassini */
340 /*
341  * The function Convert_Geodetic_To_Cassini converts geodetic (latitude and
342  * longitude) coordinates to Cassini projection (easting and northing)
343  * coordinates, according to the current ellipsoid and Cassini projection
344  * parameters. If any errors occur, the error code(s) are returned by the
345  * function, otherwise CASS_NO_ERROR is returned.
346  *
347  * Latitude : Latitude (phi) in radians (input)
348  * Longitude : Longitude (lambda) in radians (input)
349  * Easting : Easting (X) in meters (output)
350  * Northing : Northing (Y) in meters (output)
351  */
352 
353  double lat, sin2lat, sin4lat, sin6lat;
354  double RD;
355  double tlat = tan(Latitude);
356  double clat = cos(Latitude);
357  double slat = sin(Latitude);
358  double dlam; /* Longitude - Central Meridan */
359  double NN;
360  double TT;
361  double AA, A2, A3, A4, A5;
362  double CC;
363  double MM;
364  long Error_Code = CASS_NO_ERROR;
365 
366 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
367 // { /* Latitude out of range */
368 // Error_Code |= CASS_LAT_ERROR;
369 // }
370 // if ((Longitude < -PI) || (Longitude > TWO_PI))
371 // { /* Longitude out of range */
372 // Error_Code |= CASS_LON_ERROR;
373 // }
374  if (!Error_Code)
375  { /* no errors */
376  dlam = Longitude - Cass_Origin_Long;
377 
378  if (fabs(dlam) > (4.0 * M_PI / 180.0))
379  { /* Distortion will result if Longitude is more than 4 degrees from the Central Meridian */
380  Error_Code |= CASS_LON_WARNING;
381  }
382 
383  if (dlam > M_PI)
384  {
385  dlam -= TWO_PI;
386  }
387  if (dlam < -M_PI)
388  {
389  dlam += TWO_PI;
390  }
391  RD = CASS_RD(slat);
392  NN = Cass_a / RD;
393  TT = tlat * tlat;
394  AA = dlam * clat;
395  A2 = AA * AA;
396  A3 = AA * A2;
397  A4 = AA * A3;
398  A5 = AA * A4;
399  CC = es2 * clat * clat / One_Minus_es2;
400  lat = c0 * Latitude;
401  sin2lat = CASS_COEFF_TIMES_SIN(c1, 2.0, Latitude);
402  sin4lat = CASS_COEFF_TIMES_SIN(c2, 4.0, Latitude);
403  sin6lat = CASS_COEFF_TIMES_SIN(c3, 6.0, Latitude);
404  MM = CASS_M(lat, sin2lat, sin4lat, sin6lat);
405 
406  *Easting = NN * (AA - (TT * A3 / 6.0) - (8.0 - TT + 8.0 * CC) *
407  (TT * A5 / 120.0)) + Cass_False_Easting;
408  *Northing = MM - M0 + NN * tlat * ((A2 / 2.0) + (5.0 - TT +
409  6.0 * CC) * A4 / 24.0) + Cass_False_Northing;
410  }
411  return (Error_Code);
412 } /* End Convert_Geodetic_To_Cassini */
#define CASS_LON_WARNING
#define CASS_RD(sinlat)
#define CASS_COEFF_TIMES_SIN(coeff, x, latit)
#define M_PI
#define CASS_M(c0lat, c1s2lat, c2s4lat, c3s6lat)
#define TWO_PI
#define CASS_NO_ERROR

◆ dup()

virtual ossimObject* ossimCassiniProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 28 of file ossimCassiniProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 136 of file ossimCassiniProjection.cpp.

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

137 {
138  double easting = 0.0;
139  double northing = 0.0;
140  ossimGpt gpt = latLon;
141 
142  if (theDatum)
143  {
144  if (theDatum->code() != latLon.datum()->code())
145  {
146  gpt.changeDatum(theDatum); // Shift to our datum.
147  }
148  }
149 
151  gpt.lonr(),
152  &easting,
153  &northing);
154  return ossimDpt(easting, northing);
155 
156 }
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
long Convert_Geodetic_To_Cassini(double Latitude, double Longitude, double *Easting, double *Northing) const
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ Get_Cassini_Parameters()

void ossimCassiniProjection::Get_Cassini_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Cassini_Parameters returns the current ellipsoid parameters, and Cassini 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 301 of file ossimCassiniProjection.cpp.

References Cass_a, Cass_f, Cass_False_Easting, Cass_False_Northing, Cass_Origin_Lat, and Cass_Origin_Long.

307 { /* Begin Get_Cassini_Parameters */
308 /*
309  * The function Get_Cassini_Parameters returns the current ellipsoid
310  * parameters, Cassini projection parameters.
311  *
312  * a : Semi-major axis of ellipsoid, in meters (output)
313  * f : Flattening of ellipsoid (output)
314  * Origin_Latitude : Latitude in radians at which the (output)
315  * point scale factor is 1.0
316  * Central_Meridian : Longitude in radians at the center of (output)
317  * the projection
318  * False_Easting : A coordinate value in meters assigned to the
319  * central meridian of the projection. (output)
320  * False_Northing : A coordinate value in meters assigned to the
321  * origin latitude of the projection (output)
322  */
323 
324  *a = Cass_a;
325  *f = Cass_f;
326  *Origin_Latitude = Cass_Origin_Lat;
327  *Central_Meridian = Cass_Origin_Long;
328  *False_Easting = Cass_False_Easting;
329  *False_Northing = Cass_False_Northing;
330 
331  return;
332 } /* End Get_Cassini_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 52 of file ossimCassiniProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 53 of file ossimCassiniProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 123 of file ossimCassiniProjection.cpp.

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

124 {
125  double lat = 0.0;
126  double lon = 0.0;
127 
128  Convert_Cassini_To_Geodetic(eastingNorthing.x,
129  eastingNorthing.y,
130  &lat,
131  &lon);
132 
133  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0, theDatum);
134 }
#define DEG_PER_RAD
long Convert_Cassini_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 ossimCassiniProjection::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 163 of file ossimCassiniProjection.cpp.

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

165 {
166  // Must do this first.
167  bool flag = ossimMapProjection::loadState(kwl, prefix);
168 
169  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
170 
171  setDefaults();
172 
174  {
177  }
178 
179  update();
180 
181  return flag;
182 }
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 ossimCassiniProjection::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 158 of file ossimCassiniProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Cassini_Parameters()

long ossimCassiniProjection::Set_Cassini_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
private

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

References a0, a1, a2, a3, c0, c1, c2, c3, Cass_a, CASS_COEFF_TIMES_SIN, Cass_f, Cass_False_Easting, Cass_False_Northing, CASS_M, Cass_Max_Easting, Cass_Max_Northing, Cass_Min_Easting, Cass_Min_Northing, CASS_NO_ERROR, Cass_Origin_Lat, Cass_Origin_Long, Convert_Geodetic_To_Cassini(), es2, es4, es6, M0, M_PI, One_Minus_es2, THIRTY_ONE, and x.

Referenced by update().

196 { /* Begin Set_Cassini_Parameters */
197 /*
198  * The function Set_Cassini_Parameters receives the ellipsoid parameters and
199  * Cassini projection parameters as inputs, and sets the corresponding state
200  * variables. If any errors occur, the error code(s) are returned by the
201  * function, otherwise CASS_NO_ERROR is returned.
202  *
203  * a : Semi-major axis of ellipsoid, in meters (input)
204  * f : Flattening of ellipsoid (input)
205  * Origin_Latitude : Latitude in radians at which the (input)
206  * point scale factor is 1.0
207  * Central_Meridian : Longitude in radians at the center of (input)
208  * the projection
209  * False_Easting : A coordinate value in meters assigned to the
210  * central meridian of the projection. (input)
211  * False_Northing : A coordinate value in meters assigned to the
212  * origin latitude of the projection (input)
213  */
214 
215  double j,three_es4;
216  double x, e1, e2, e3, e4;
217  double lat, sin2lat, sin4lat, sin6lat;
218  double temp;
219 // double inv_f = 1 / f;
220  long Error_Code = CASS_NO_ERROR;
221 
222 // if (a <= 0.0)
223 // { /* Semi-major axis must be greater than zero */
224 // Error_Code |= CASS_A_ERROR;
225 // }
226 // if ((inv_f < 250) || (inv_f > 350))
227 // { /* Inverse flattening must be between 250 and 350 */
228 // Error_Code |= CASS_INV_F_ERROR;
229 // }
230 // if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
231 // { /* origin latitude out of range */
232 // Error_Code |= CASS_ORIGIN_LAT_ERROR;
233 // }
234 // if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
235 // { /* origin longitude out of range */
236 // Error_Code |= CASS_CENT_MER_ERROR;
237 // }
238  if (!Error_Code)
239  { /* no errors */
240  Cass_a = a;
241  Cass_f = f;
242  Cass_Origin_Lat = Origin_Latitude;
243 // if (Central_Meridian > PI)
244 // Central_Meridian -= TWO_PI;
245  Cass_Origin_Long = Central_Meridian;
246  Cass_False_Northing = False_Northing;
247  Cass_False_Easting = False_Easting;
248  es2 = 2 * Cass_f - Cass_f * Cass_f;
249  es4 = es2 * es2;
250  es6 = es4 * es2;
251  j = 45.0 * es6 / 1024.0;
252  three_es4 = 3.0 * es4;
253  c0 = 1 - es2 / 4.0 - three_es4 / 64.0 - 5.0 * es6 / 256.0;
254  c1 = 3.0 * es2 /8.0 + three_es4 / 32.0 + j;
255  c2 = 15.0 * es4 / 256.0 + j;
256  c3 = 35.0 * es6 / 3072.0;
257  lat = c0 * Cass_Origin_Lat;
258  sin2lat = CASS_COEFF_TIMES_SIN(c1, 2.0, Cass_Origin_Lat);
259  sin4lat = CASS_COEFF_TIMES_SIN(c2, 4.0, Cass_Origin_Lat);
260  sin6lat = CASS_COEFF_TIMES_SIN(c3, 6.0, Cass_Origin_Lat);
261  M0 = CASS_M(lat, sin2lat, sin4lat, sin6lat);
262 
263  One_Minus_es2 = 1.0 - es2;
264  x = sqrt (One_Minus_es2);
265  e1 = (1 - x) / (1 + x);
266  e2 = e1 * e1;
267  e3 = e2 * e1;
268  e4 = e3 * e1;
269  a0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0;
270  a1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
271  a2 = 151.0 * e3 / 96.0;
272  a3 = 1097.0 * e4 /512.0;
273 
274  if (Cass_Origin_Long > 0)
275  {
278  Cass_Max_Easting = 19926188.9;
279  Cass_Min_Easting = -20037508.4;
280  }
281  else if (Cass_Origin_Long < 0)
282  {
285  Cass_Max_Easting = 20037508.4;
286  Cass_Min_Easting = -19926188.9;
287  }
288  else
289  {
292  Cass_Max_Easting = 20037508.4;
293  Cass_Min_Easting = -20037508.4;
294  }
295 
296  } /* End if(!Error_Code) */
297  return (Error_Code);
298 } /* End Set_Cassini_Parameters */
ossim_uint32 x
#define CASS_COEFF_TIMES_SIN(coeff, x, latit)
#define M_PI
#define CASS_M(c0lat, c1s2lat, c2s4lat, c3s6lat)
#define CASS_NO_ERROR
#define THIRTY_ONE
long Convert_Geodetic_To_Cassini(double Latitude, double Longitude, double *Easting, double *Northing) const

◆ setDefaults()

void ossimCassiniProjection::setDefaults ( )

Initialize all pramters to default and calls update for pre-computations.

Definition at line 112 of file ossimCassiniProjection.cpp.

References Cass_False_Easting, Cass_False_Northing, Cass_Max_Easting, Cass_Max_Northing, Cass_Min_Easting, and Cass_Min_Northing.

Referenced by loadState(), and ossimCassiniProjection().

113 {
114 
115  Cass_Min_Easting = -20037508.4;
116  Cass_Max_Easting = 20037508.4;
117  Cass_Min_Northing = -56575846.0;
118  Cass_Max_Northing = 56575846.0;
119  Cass_False_Easting = 0.0;
120  Cass_False_Northing = 0.0;
121 }

◆ setFalseEasting()

void ossimCassiniProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 92 of file ossimCassiniProjection.cpp.

References Cass_False_Easting, and update().

93 {
94  Cass_False_Easting = falseEasting;
95  update();
96 }

◆ setFalseEastingNorthing()

void ossimCassiniProjection::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 104 of file ossimCassiniProjection.cpp.

References Cass_False_Easting, Cass_False_Northing, and update().

106 {
107  Cass_False_Easting = falseEasting;
108  Cass_False_Northing = falseNorthing;
109  update();
110 }

◆ setFalseNorthing()

void ossimCassiniProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 98 of file ossimCassiniProjection.cpp.

References Cass_False_Northing, and update().

99 {
100  Cass_False_Northing = falseNorthing;
101  update();
102 }

◆ update()

void ossimCassiniProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 76 of file ossimCassiniProjection.cpp.

References Cass_False_Easting, Cass_False_Northing, ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::latr(), ossimGpt::lonr(), Set_Cassini_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

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

77 {
80  theOrigin.latr(),
81  theOrigin.lonr(),
84 
87 
88 
90 }
double y
Definition: ossimDpt.h:165
long Set_Cassini_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

◆ a0

double ossimCassiniProjection::a0
mutableprivate

Definition at line 90 of file ossimCassiniProjection.h.

Referenced by Convert_Cassini_To_Geodetic(), and Set_Cassini_Parameters().

◆ a1

double ossimCassiniProjection::a1
mutableprivate

Definition at line 91 of file ossimCassiniProjection.h.

Referenced by Convert_Cassini_To_Geodetic(), and Set_Cassini_Parameters().

◆ a2

double ossimCassiniProjection::a2
mutableprivate

Definition at line 92 of file ossimCassiniProjection.h.

Referenced by Convert_Cassini_To_Geodetic(), and Set_Cassini_Parameters().

◆ a3

double ossimCassiniProjection::a3
mutableprivate

Definition at line 93 of file ossimCassiniProjection.h.

Referenced by Convert_Cassini_To_Geodetic(), and Set_Cassini_Parameters().

◆ c0

double ossimCassiniProjection::c0
mutableprivate

◆ c1

double ossimCassiniProjection::c1
mutableprivate

Definition at line 86 of file ossimCassiniProjection.h.

Referenced by Convert_Geodetic_To_Cassini(), and Set_Cassini_Parameters().

◆ c2

double ossimCassiniProjection::c2
mutableprivate

Definition at line 87 of file ossimCassiniProjection.h.

Referenced by Convert_Geodetic_To_Cassini(), and Set_Cassini_Parameters().

◆ c3

double ossimCassiniProjection::c3
mutableprivate

Definition at line 88 of file ossimCassiniProjection.h.

Referenced by Convert_Geodetic_To_Cassini(), and Set_Cassini_Parameters().

◆ Cass_a

double ossimCassiniProjection::Cass_a
mutableprivate

◆ Cass_f

double ossimCassiniProjection::Cass_f
mutableprivate

Definition at line 80 of file ossimCassiniProjection.h.

Referenced by Get_Cassini_Parameters(), and Set_Cassini_Parameters().

◆ Cass_False_Easting

double ossimCassiniProjection::Cass_False_Easting
mutableprivate

◆ Cass_False_Northing

double ossimCassiniProjection::Cass_False_Northing
mutableprivate

◆ Cass_Max_Easting

double ossimCassiniProjection::Cass_Max_Easting
mutableprivate

◆ Cass_Max_Northing

double ossimCassiniProjection::Cass_Max_Northing
mutableprivate

◆ Cass_Min_Easting

double ossimCassiniProjection::Cass_Min_Easting
mutableprivate

◆ Cass_Min_Northing

double ossimCassiniProjection::Cass_Min_Northing
mutableprivate

◆ Cass_Origin_Lat

double ossimCassiniProjection::Cass_Origin_Lat
mutableprivate

Definition at line 96 of file ossimCassiniProjection.h.

Referenced by Get_Cassini_Parameters(), and Set_Cassini_Parameters().

◆ Cass_Origin_Long

double ossimCassiniProjection::Cass_Origin_Long
mutableprivate

◆ es2

double ossimCassiniProjection::es2
mutableprivate

Definition at line 81 of file ossimCassiniProjection.h.

Referenced by Convert_Geodetic_To_Cassini(), and Set_Cassini_Parameters().

◆ es4

double ossimCassiniProjection::es4
mutableprivate

Definition at line 82 of file ossimCassiniProjection.h.

Referenced by Set_Cassini_Parameters().

◆ es6

double ossimCassiniProjection::es6
mutableprivate

Definition at line 83 of file ossimCassiniProjection.h.

Referenced by Set_Cassini_Parameters().

◆ M0

double ossimCassiniProjection::M0
mutableprivate

◆ One_Minus_es2

double ossimCassiniProjection::One_Minus_es2
mutableprivate

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