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

#include <ossimPolyconicProjection.h>

Inheritance diagram for ossimPolyconicProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

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

Private Member Functions

long Set_Polyconic_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Polyconic_Parameters (double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Polyconic (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Polyconic_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Poly_a
 
double Poly_f
 
double es2
 
double es4
 
double es6
 
double M0
 
double c0
 
double c1
 
double c2
 
double c3
 
double Poly_Origin_Lat
 
double Poly_Origin_Long
 
double Poly_False_Northing
 
double Poly_False_Easting
 
double Poly_Max_Easting
 
double Poly_Max_Northing
 
double Poly_Min_Easting
 
double Poly_Min_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 ossimPolyconicProjection.h.

Constructor & Destructor Documentation

◆ ossimPolyconicProjection() [1/2]

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

Definition at line 46 of file ossimPolyconicProjection.cpp.

References setDefaults(), and update().

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

◆ ossimPolyconicProjection() [2/2]

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

Definition at line 54 of file ossimPolyconicProjection.cpp.

References Poly_False_Easting, Poly_False_Northing, Poly_Max_Easting, Poly_Max_Northing, Poly_Min_Easting, Poly_Min_Northing, and update().

58  :ossimMapProjection(ellipsoid, origin)
59 {
60  Poly_False_Easting = falseEasting;
61  Poly_False_Northing = falseNorthing;
62  Poly_Max_Easting = 20037509.0;
63  Poly_Max_Northing = 15348215.0;
64  Poly_Min_Easting = -20037509.0;
65  Poly_Min_Northing = -15348215.0;
66 
67  update();
68 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimPolyconicProjection()

ossimPolyconicProjection::~ossimPolyconicProjection ( )
inline

Definition at line 27 of file ossimPolyconicProjection.h.

27 {}

Member Function Documentation

◆ Convert_Geodetic_To_Polyconic()

long ossimPolyconicProjection::Convert_Geodetic_To_Polyconic ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

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

References c0, c1, c2, c3, es2, M0, M_PI, Poly_a, POLY_COEFF_TIMES_SIN, Poly_False_Easting, Poly_False_Northing, POLY_LON_WARNING, POLY_M, POLY_NO_ERROR, and Poly_Origin_Long.

Referenced by forward(), and Set_Polyconic_Parameters().

323 { /* BEGIN Convert_Geodetic_To_Polyconic */
324 /*
325  * The function Convert_Geodetic_To_Polyconic converts geodetic (latitude and
326  * longitude) coordinates to Polyconic projection (easting and northing)
327  * coordinates, according to the current ellipsoid and Polyconic projection
328  * parameters. If any errors occur, the error code(s) are returned by the
329  * function, otherwise POLY_NO_ERROR is returned.
330  *
331  * Latitude : Latitude (phi) in radians (input)
332  * Longitude : Longitude (lambda) in radians (input)
333  * Easting : Easting (X) in meters (output)
334  * Northing : Northing (Y) in meters (output)
335  */
336 
337  double slat = sin(Latitude);
338  double lat, sin2lat, sin4lat, sin6lat;
339  double dlam; /* Longitude - Central Meridan */
340  double NN;
341  double NN_OVER_tlat;
342  double MM;
343  double EE;
344  long Error_Code = POLY_NO_ERROR;
345 
346 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
347 // { /* Latitude out of range */
348 // Error_Code |= POLY_LAT_ERROR;
349 // }
350 // if ((Longitude < -M_PI) || (Longitude > TWO_PI))
351 // { /* Longitude out of range */
352 // Error_Code |= POLY_LON_ERROR;
353 // }
354  if (!Error_Code)
355  { /* no errors */
356  dlam = Longitude - Poly_Origin_Long;
357  if (fabs(dlam) > (M_PI / 2.0))
358  { /* Distortion will result if Longitude is more than 90 degrees from the Central Meridian */
359  Error_Code |= POLY_LON_WARNING;
360  }
361 // if (dlam > M_PI)
362 // {
363 // dlam -= TWO_PI;
364 // }
365 // if (dlam < -M_PI)
366 // {
367 // dlam += TWO_PI;
368 // }
369  if (Latitude == 0.0)
370  {
371  *Easting = Poly_a * dlam + Poly_False_Easting;
372  *Northing = -M0 + Poly_False_Northing;
373  }
374  else
375  {
376  NN = Poly_a / sqrt(1.0 - es2 * (slat * slat));
377  NN_OVER_tlat = NN / tan(Latitude);
378  lat = c0 * Latitude;
379  sin2lat = POLY_COEFF_TIMES_SIN(c1, 2.0, Latitude);
380  sin4lat = POLY_COEFF_TIMES_SIN(c2, 4.0, Latitude);
381  sin6lat = POLY_COEFF_TIMES_SIN(c3, 6.0, Latitude);
382  MM = POLY_M(lat, sin2lat, sin4lat, sin6lat);
383  EE = dlam * slat;
384  *Easting = NN_OVER_tlat * sin(EE) + Poly_False_Easting;
385  *Northing = MM - M0 + NN_OVER_tlat * (1.0 - cos(EE)) +
387  }
388  }
389  return (Error_Code);
390 } /* END OF Convert_Geodetic_To_Polyconic */
#define POLY_NO_ERROR
#define M_PI
#define POLY_LON_WARNING
#define POLY_COEFF_TIMES_SIN(coeff, x, latit)
#define POLY_M(c0lat, c1s2lat, c2s4lat, c3s6lat)

◆ Convert_Polyconic_To_Geodetic()

long ossimPolyconicProjection::Convert_Polyconic_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

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

References c0, c1, c2, c3, es2, FLOAT_EQ, M0, PI_OVER_2, Poly_a, POLY_COEFF_TIMES_SIN, Poly_False_Easting, Poly_False_Northing, POLY_M, POLY_NO_ERROR, and Poly_Origin_Long.

Referenced by inverse().

397 { /* BEGIN Convert_Polyconic_To_Geodetic */
398 /*
399  * The function Convert_Polyconic_To_Geodetic converts Polyconic projection
400  * (easting and northing) coordinates to geodetic (latitude and longitude)
401  * coordinates, according to the current ellipsoid and Polyconic projection
402  * coordinates. If any errors occur, the error code(s) are returned by the
403  * function, otherwise POLY_NO_ERROR is returned.
404  *
405  * Easting : Easting (X) in meters (input)
406  * Northing : Northing (Y) in meters (input)
407  * Latitude : Latitude (phi) in radians (output)
408  * Longitude : Longitude (lambda) in radians (output)
409  */
410 
411  double dx; /* Delta easting - Difference in easting (easting-FE) */
412  double dy; /* Delta northing - Difference in northing (northing-FN) */
413  double dx_OVER_Poly_a;
414  double AA;
415  double BB;
416  double CC = 0.0;
417  double PHIn, Delta_PHI = 1.0;
418  double sin_PHIn;
419  double PHI, sin2PHI,sin4PHI, sin6PHI;
420  double Mn, Mn_prime, Ma;
421  double AA_Ma;
422  double Ma2_PLUS_BB;
423  double AA_MINUS_Ma;
424  double tolerance = 1.0e-12; /* approximately 1/1000th of
425  an arc second or 1/10th meter */
426  long Error_Code = POLY_NO_ERROR;
427 
428 // if ((Easting < (Poly_False_Easting + Poly_Min_Easting))
429 // || (Easting > (Poly_False_Easting + Poly_Max_Easting)))
430 // { /* Easting out of range */
431 // Error_Code |= POLY_EASTING_ERROR;
432 // }
433 // if ((Northing < (Poly_False_Northing + Poly_Min_Northing))
434 // || (Northing > (Poly_False_Northing + Poly_Max_Northing)))
435 // { /* Northing out of range */
436 // Error_Code |= POLY_NORTHING_ERROR;
437 // }
438  if (!Error_Code)
439  { /* no errors */
440  dy = Northing - Poly_False_Northing;
441  dx = Easting - Poly_False_Easting;
442  dx_OVER_Poly_a = dx / Poly_a;
443  if (FLOAT_EQ(dy,-M0,1))
444  {
445  *Latitude = 0.0;
446  *Longitude = dx_OVER_Poly_a + Poly_Origin_Long;
447  }
448  else
449  {
450  AA = (M0 + dy) / Poly_a;
451  BB = dx_OVER_Poly_a * dx_OVER_Poly_a + (AA * AA);
452  PHIn = AA;
453 
454  while (fabs(Delta_PHI) > tolerance)
455  {
456  sin_PHIn = sin(PHIn);
457  CC = sqrt(1.0 - es2 * sin_PHIn * sin_PHIn) * tan(PHIn);
458  PHI = c0 * PHIn;
459  sin2PHI = POLY_COEFF_TIMES_SIN(c1, 2.0, PHIn);
460  sin4PHI = POLY_COEFF_TIMES_SIN(c2, 4.0, PHIn);
461  sin6PHI = POLY_COEFF_TIMES_SIN(c3, 6.0, PHIn);
462  Mn = POLY_M(PHI, sin2PHI, sin4PHI, sin6PHI);
463  Mn_prime = c0 - 2.0 * c1 * cos(2.0 * PHIn) + 4.0 * c2 * cos(4.0 * PHIn) -
464  6.0 * c3 * cos(6.0 * PHIn);
465  Ma = Mn / Poly_a;
466  AA_Ma = AA * Ma;
467  Ma2_PLUS_BB = Ma * Ma + BB;
468  AA_MINUS_Ma = AA - Ma;
469  Delta_PHI = (AA_Ma * CC + AA_MINUS_Ma - 0.5 * (Ma2_PLUS_BB) * CC) /
470  (es2 * sin2PHI * (Ma2_PLUS_BB - 2.0 * AA_Ma) /
471  4.0 * CC + (AA_MINUS_Ma) * (CC * Mn_prime - 2.0 / sin2PHI) - Mn_prime);
472  PHIn -= Delta_PHI;
473  }
474  *Latitude = PHIn;
475 
476 // if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
477 // *Latitude = PI_OVER_2;
478 // else if (*Latitude < -PI_OVER_2)
479 // *Latitude = -PI_OVER_2;
480 
481  if (FLOAT_EQ(fabs(*Latitude),PI_OVER_2,.00001) || (*Latitude == 0))
482  *Longitude = Poly_Origin_Long;
483 
484  else
485  {
486  *Longitude = (asin(dx_OVER_Poly_a * CC)) / sin(*Latitude) +
488  }
489  }
490 // if (*Longitude > M_PI)
491 // *Longitude -= TWO_PI;
492 // if (*Longitude < -M_PI)
493 // *Longitude += TWO_PI;
494 
495 // if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
496 // *Longitude = M_PI;
497 // else if (*Longitude < -M_PI)
498 // *Longitude = -M_PI;
499 
500  }
501  return (Error_Code);
502 } /* END OF Convert_Polyconic_To_Geodetic */
#define POLY_NO_ERROR
#define PI_OVER_2
#define POLY_COEFF_TIMES_SIN(coeff, x, latit)
#define FLOAT_EQ(x, v, epsilon)
#define POLY_M(c0lat, c1s2lat, c2s4lat, c3s6lat)

◆ dup()

virtual ossimObject* ossimPolyconicProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 28 of file ossimPolyconicProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 131 of file ossimPolyconicProjection.cpp.

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

132 {
133  double easting = 0.0;
134  double northing = 0.0;
135  ossimGpt gpt = latLon;
136 
137  if (theDatum)
138  {
139  if (theDatum->code() != latLon.datum()->code())
140  {
141  gpt.changeDatum(theDatum); // Shift to our datum.
142  }
143  }
144 
146  gpt.lonr(),
147  &easting,
148  &northing);
149 
150  return ossimDpt(easting, northing);
151 }
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_Polyconic(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_Polyconic_Parameters()

void ossimPolyconicProjection::Get_Polyconic_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Polyconic_Parameters returns the current ellipsoid parameters, and Polyconic 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 284 of file ossimPolyconicProjection.cpp.

References Poly_a, Poly_f, Poly_False_Easting, Poly_False_Northing, Poly_Origin_Lat, and Poly_Origin_Long.

291 { /* BEGIN Get_Polyconic_Parameters */
292 /*
293  * The function Get_Polyconic_Parameters returns the current ellipsoid
294  * parameters, and Polyconic projection parameters.
295  *
296  * a : Semi-major axis of ellipsoid, in meters (output)
297  * f : Flattening of ellipsoid (output)
298  * Origin_Latitude : Latitude in radians at which the (output)
299  * point scale factor is 1.0
300  * Central_Meridian : Longitude in radians at the center of (output)
301  * the projection
302  * False_Easting : A coordinate value in meters assigned to the
303  * central meridian of the projection. (output)
304  * False_Northing : A coordinate value in meters assigned to the
305  * origin latitude of the projection (output)
306  */
307 
308  *a = Poly_a;
309  *f = Poly_f;
310  *Origin_Latitude = Poly_Origin_Lat;
311  *Central_Meridian = Poly_Origin_Long;
312  *False_Easting = Poly_False_Easting;
313  *False_Northing = Poly_False_Northing;
314 
315  return;
316 } /* END OF Get_Polyconic_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 58 of file ossimPolyconicProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 59 of file ossimPolyconicProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 118 of file ossimPolyconicProjection.cpp.

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

119 {
120  double lat = 0.0;
121  double lon = 0.0;
122 
123  Convert_Polyconic_To_Geodetic(eastingNorthing.x,
124  eastingNorthing.y,
125  &lat,
126  &lon);
127 
128  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
129 }
#define DEG_PER_RAD
long Convert_Polyconic_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 ossimPolyconicProjection::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 158 of file ossimPolyconicProjection.cpp.

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

160 {
161  bool flag = ossimMapProjection::loadState(kwl, prefix);
162  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
163 
164  setDefaults();
165 
167  {
170  }
171 
172  update();
173 
174  return flag;
175 }
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 ossimPolyconicProjection::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 153 of file ossimPolyconicProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Polyconic_Parameters()

long ossimPolyconicProjection::Set_Polyconic_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
private

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

References c0, c1, c2, c3, Convert_Geodetic_To_Polyconic(), es2, es4, es6, FOURTY_ONE, M0, M_PI, Poly_a, POLY_COEFF_TIMES_SIN, Poly_f, Poly_False_Easting, Poly_False_Northing, POLY_M, Poly_Max_Easting, Poly_Max_Northing, Poly_Min_Easting, Poly_Min_Northing, POLY_NO_ERROR, Poly_Origin_Lat, and Poly_Origin_Long.

Referenced by update().

190 { /* BEGIN Set_Polyconic_Parameters */
191 /*
192  * The function Set_Polyconic_Parameters receives the ellipsoid parameters and
193  * Polyconic projection parameters as inputs, and sets the corresponding state
194  * variables. If any errors occur, the error code(s) are returned by the function,
195  * otherwise POLY_NO_ERROR is returned.
196  *
197  * a : Semi-major axis of ellipsoid, in meters (input)
198  * f : Flattening of ellipsoid (input)
199  * Origin_Latitude : Latitude in radians at which the (input)
200  * point scale factor is 1.0
201  * Central_Meridian : Longitude in radians at the center of (input)
202  * the projection
203  * False_Easting : A coordinate value in meters assigned to the
204  * central meridian of the projection. (input)
205  * False_Northing : A coordinate value in meters assigned to the
206  * origin latitude of the projection (input)
207  */
208 
209  double j, three_es4;
210  double lat, sin2lat, sin4lat, sin6lat;
211  double temp;
212 // double inv_f = 1 / f;
213  long Error_Code = POLY_NO_ERROR;
214 
215 // if (a <= 0.0)
216 // { /* Semi-major axis must be greater than zero */
217 // Error_Code |= POLY_A_ERROR;
218 // }
219 // if ((inv_f < 250) || (inv_f > 350))
220 // { /* Inverse flattening must be between 250 and 350 */
221 // Error_Code |= POLY_INV_F_ERROR;
222 // }
223 // if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
224 // { /* origin latitude out of range */
225 // Error_Code |= POLY_ORIGIN_LAT_ERROR;
226 // }
227 // if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
228 // { /* origin longitude out of range */
229 // Error_Code |= POLY_CENT_MER_ERROR;
230 // }
231  if (!Error_Code)
232  { /* no errors */
233  Poly_a = a;
234  Poly_f = f;
235  Poly_Origin_Lat = Origin_Latitude;
236 // if (Central_Meridian > M_PI)
237 // Central_Meridian -= TWO_PI;
238  Poly_Origin_Long = Central_Meridian;
239  Poly_False_Northing = False_Northing;
240  Poly_False_Easting = False_Easting;
241  es2 = 2 * Poly_f - Poly_f * Poly_f;
242  es4 = es2 * es2;
243  es6 = es4 * es2;
244 
245  j = 45.0 * es6 / 1024.0;
246  three_es4 = 3.0 * es4;
247  c0 = 1.0 - es2 / 4.0 - three_es4 / 64.0 - 5.0 * es6 / 256.0;
248  c1 = 3.0 * es2 / 8.0 + three_es4 / 32.0 + j;
249  c2 = 15.0 * es4 / 256.0 + j;
250  c3 = 35.0 * es6 / 3072.0;
251 
252  lat = c0 * Poly_Origin_Lat;
253  sin2lat = POLY_COEFF_TIMES_SIN(c1, 2.0, Poly_Origin_Lat);
254  sin4lat = POLY_COEFF_TIMES_SIN(c2, 4.0, Poly_Origin_Lat);
255  sin6lat = POLY_COEFF_TIMES_SIN(c3, 6.0, Poly_Origin_Lat);
256  M0 = POLY_M(lat, sin2lat, sin4lat, sin6lat);
257 
258  if (Poly_Origin_Long > 0)
259  {
262  Poly_Max_Easting = 19926189.0;
263  Poly_Min_Easting = -20037509.0;
264  }
265  else if (Poly_Origin_Long < 0)
266  {
269  Poly_Max_Easting = 20037509.0;
270  Poly_Min_Easting = -19926189.0;
271  }
272  else
273  {
276  Poly_Max_Easting = 20037509.0;
277  Poly_Min_Easting = -20037509.0;
278  }
279 
280  } /* END OF if(!Error_Code) */
281  return (Error_Code);
282 } /* END OF Set_Polyconic_Parameters */
#define POLY_NO_ERROR
#define M_PI
#define FOURTY_ONE
#define POLY_COEFF_TIMES_SIN(coeff, x, latit)
long Convert_Geodetic_To_Polyconic(double Latitude, double Longitude, double *Easting, double *Northing) const
#define POLY_M(c0lat, c1s2lat, c2s4lat, c3s6lat)

◆ setDefaults()

void ossimPolyconicProjection::setDefaults ( )

◆ setFalseEasting()

void ossimPolyconicProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 85 of file ossimPolyconicProjection.cpp.

References Poly_False_Easting, and update().

86 {
87  Poly_False_Easting = falseEasting;
88 
89  update();
90 }

◆ setFalseEastingNorthing()

void ossimPolyconicProjection::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 109 of file ossimPolyconicProjection.cpp.

References Poly_False_Easting, Poly_False_Northing, and update().

111 {
112  Poly_False_Easting = falseEasting;
113  Poly_False_Northing = falseNorthing;
114 
115  update();
116 }

◆ setFalseNorthing()

void ossimPolyconicProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 92 of file ossimPolyconicProjection.cpp.

References Poly_False_Northing, and update().

93 {
94  Poly_False_Northing = falseNorthing;
95 
96  update();
97 }

◆ update()

void ossimPolyconicProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 70 of file ossimPolyconicProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::latr(), ossimGpt::lonr(), Poly_False_Easting, Poly_False_Northing, Set_Polyconic_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

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

71 {
74  theOrigin.latr(),
75  theOrigin.lonr(),
78 
81 
83 }
long Set_Polyconic_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
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.

Member Data Documentation

◆ c0

double ossimPolyconicProjection::c0
mutableprivate

◆ c1

double ossimPolyconicProjection::c1
mutableprivate

◆ c2

double ossimPolyconicProjection::c2
mutableprivate

◆ c3

double ossimPolyconicProjection::c3
mutableprivate

◆ es2

double ossimPolyconicProjection::es2
mutableprivate

◆ es4

double ossimPolyconicProjection::es4
mutableprivate

Definition at line 79 of file ossimPolyconicProjection.h.

Referenced by Set_Polyconic_Parameters().

◆ es6

double ossimPolyconicProjection::es6
mutableprivate

Definition at line 80 of file ossimPolyconicProjection.h.

Referenced by Set_Polyconic_Parameters().

◆ M0

double ossimPolyconicProjection::M0
mutableprivate

◆ Poly_a

double ossimPolyconicProjection::Poly_a
mutableprivate

◆ Poly_f

double ossimPolyconicProjection::Poly_f
mutableprivate

◆ Poly_False_Easting

double ossimPolyconicProjection::Poly_False_Easting
mutableprivate

◆ Poly_False_Northing

double ossimPolyconicProjection::Poly_False_Northing
mutableprivate

◆ Poly_Max_Easting

double ossimPolyconicProjection::Poly_Max_Easting
mutableprivate

◆ Poly_Max_Northing

double ossimPolyconicProjection::Poly_Max_Northing
mutableprivate

◆ Poly_Min_Easting

double ossimPolyconicProjection::Poly_Min_Easting
mutableprivate

◆ Poly_Min_Northing

double ossimPolyconicProjection::Poly_Min_Northing
mutableprivate

◆ Poly_Origin_Lat

double ossimPolyconicProjection::Poly_Origin_Lat
mutableprivate

◆ Poly_Origin_Long

double ossimPolyconicProjection::Poly_Origin_Long
mutableprivate

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