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

#include <ossimLambertConformalConicProjection.h>

Inheritance diagram for ossimLambertConformalConicProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimLambertConformalConicProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimLambertConformalConicProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, double stdParallel1, double stdParallel2, double falseEasting, double falseNorthing)
 
virtual ~ossimLambertConformalConicProjection ()
 
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 setStandardParallel1 (double degree)
 
void setStandardParallel2 (double degree)
 
void setStandardParallels (double parallel1Degree, double prallel2Degree)
 
void setFalseEasting (double falseEasting)
 
void setFalseNorthing (double falseNorthing)
 
void setFalseEastingNorthing (double falseEasting, double falseNorthing)
 
void setParameters (double parallel1, double parallel2, double falseEasting, double falseNorthing)
 Allows one to set all parameters for this projections. More...
 
virtual double getStandardParallel1 () const
 
virtual double getStandardParallel2 () const
 
void setDefaults ()
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Prints data members to stream. More...
 
virtual bool operator== (const ossimProjection &projection) const
 Returns TRUE if principal parameters are within epsilon tolerance. More...
 
- 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 getFalseEasting () const
 
virtual double getFalseNorthing () const
 
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 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_Lambert_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double Std_Parallel_1, double Std_Parallel_2, double False_Easting, double False_Northing)
 
void Get_Lambert_Parameters (double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *Std_Parallel_1, double *Std_Parallel_2, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Lambert (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Lambert_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Lambert_a
 
double Lambert_f
 
double es
 
double es2
 
double es_OVER_2
 
double n
 
double F
 
double rho0
 
double Lambert_aF
 
double Lambert_Std_Parallel_1
 
double Lambert_Std_Parallel_2
 
double Lambert_Origin_Lat
 
double Lambert_Origin_Long
 
double Lambert_False_Northing
 
double Lambert_False_Easting
 

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 19 of file ossimLambertConformalConicProjection.h.

Constructor & Destructor Documentation

◆ ossimLambertConformalConicProjection() [1/2]

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

Definition at line 57 of file ossimLambertConformalConicProjection.cpp.

References setDefaults(), and update().

Referenced by dup().

59  :ossimMapProjection(ellipsoid, origin)
60 {
61  setDefaults();
62  update();
63 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimLambertConformalConicProjection() [2/2]

ossimLambertConformalConicProjection::ossimLambertConformalConicProjection ( const ossimEllipsoid ellipsoid,
const ossimGpt origin,
double  stdParallel1,
double  stdParallel2,
double  falseEasting,
double  falseNorthing 
)
Parameters
ellipsoid
originlatitude longitude in decimal degrees.
stdParallel1First parallel in DEGREES.
stdParallel2Second parallel in DEGREES.
falseEastingFalse easting in meters.
falseNorthingFalse northing in meters.

Definition at line 65 of file ossimLambertConformalConicProjection.cpp.

References Lambert_False_Easting, Lambert_False_Northing, Lambert_Std_Parallel_1, Lambert_Std_Parallel_2, RAD_PER_DEG, and update().

71  :ossimMapProjection(ellipsoid, origin)
72 {
73  Lambert_Std_Parallel_1 = stdParallel1*RAD_PER_DEG;
74  Lambert_Std_Parallel_2 = stdParallel2*RAD_PER_DEG;
75  Lambert_False_Easting = falseEasting;
76  Lambert_False_Northing = falseNorthing;
77 
78  update();
79 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
#define RAD_PER_DEG

◆ ~ossimLambertConformalConicProjection()

ossimLambertConformalConicProjection::~ossimLambertConformalConicProjection ( )
virtual

Definition at line 81 of file ossimLambertConformalConicProjection.cpp.

82 {
83 }

Member Function Documentation

◆ Convert_Geodetic_To_Lambert()

long ossimLambertConformalConicProjection::Convert_Geodetic_To_Lambert ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

The function Convert_Geodetic_To_Lambert converts Geodetic (latitude and longitude) coordinates to Lambert Conformal Conic projection (easting and northing) coordinates, according to the current ellipsoid and Lambert Conformal Conic projection parameters. If any errors occur, the error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR is returned.

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

Definition at line 428 of file ossimLambertConformalConicProjection.cpp.

References ES_SIN, Lambert_aF, Lambert_False_Easting, Lambert_False_Northing, LAMBERT_LAT_ERROR, LAMBERT_NO_ERROR, Lambert_Origin_Long, LAMBERT_t, n, PI_OVER_2, and rho0.

Referenced by forward().

433 { /* BEGIN Convert_Geodetic_To_Lambert */
434 /*
435  * The function Convert_Geodetic_To_Lambert converts Geodetic (latitude and
436  * longitude) coordinates to Lambert Conformal Conic projection (easting
437  * and northing) coordinates, according to the current ellipsoid and
438  * Lambert Conformal Conic projection parameters. If any errors occur, the
439  * error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR is
440  * returned.
441  *
442  * Latitude : Latitude, in radians (input)
443  * Longitude : Longitude, in radians (input)
444  * Easting : Easting (X), in meters (output)
445  * Northing : Northing (Y), in meters (output)
446  */
447 
448  double slat;
449  double es_sin;
450  double t;
451  double rho;
452  double dlam;
453  double theta;
454  long Error_Code = LAMBERT_NO_ERROR;
455 
456 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
457 // { /* Latitude out of range */
458 // Error_Code|= LAMBERT_LAT_ERROR;
459 // }
460 // if ((Longitude < -PI) || (Longitude > TWO_PI))
461 // { /* Longitude out of range */
462 // Error_Code|= LAMBERT_LON_ERROR;
463 // }
464 
465  if (!Error_Code)
466  { /* no errors */
467 
468  if (fabs(fabs(Latitude) - PI_OVER_2) > 1.0e-10)
469  {
470  slat = sin(Latitude);
471  es_sin = ES_SIN(slat);
472  t = LAMBERT_t(Latitude, es_sin);
473  rho = Lambert_aF * pow(t, n);
474  }
475  else
476  {
477  if ((Latitude * n) <= 0)
478  { /* Point can not be projected */
479  Error_Code |= LAMBERT_LAT_ERROR;
480  return (Error_Code);
481  }
482  rho = 0.0;
483  }
484 
485  dlam = Longitude - Lambert_Origin_Long;
486 
487 // if (dlam > PI)
488 // {
489 // dlam -= TWO_PI;
490 // }
491 // if (dlam < -PI)
492 // {
493 // dlam += TWO_PI;
494 // }
495 
496  theta = n * dlam;
497 
498  *Easting = rho * sin(theta) + Lambert_False_Easting;
499  *Northing = rho0 - rho * cos(theta) + Lambert_False_Northing;
500 
501  }
502  return (Error_Code);
503 } /* END OF Convert_Geodetic_To_Lambert */
#define ES_SIN(sinlat)
#define LAMBERT_t(lat, essin)

◆ Convert_Lambert_To_Geodetic()

long ossimLambertConformalConicProjection::Convert_Lambert_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

The function Convert_Lambert_To_Geodetic converts Lambert Conformal Conic projection (easting and northing) coordinates to Geodetic (latitude and longitude) coordinates, according to the current ellipsoid and Lambert Conformal Conic projection parameters. If any errors occur, the error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR is returned.

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

Definition at line 507 of file ossimLambertConformalConicProjection.cpp.

References es_OVER_2, ES_SIN, Lambert_aF, Lambert_False_Easting, Lambert_False_Northing, LAMBERT_NO_ERROR, Lambert_Origin_Long, M_PI, n, PI_OVER_2, and rho0.

Referenced by inverse().

512 { /* BEGIN Convert_Lambert_To_Geodetic */
513 /*
514  * The function Convert_Lambert_To_Geodetic converts Lambert Conformal
515  * Conic projection (easting and northing) coordinates to Geodetic
516  * (latitude and longitude) coordinates, according to the current ellipsoid
517  * and Lambert Conformal Conic projection parameters. If any errors occur,
518  * the error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR
519  * is returned.
520  *
521  * Easting : Easting (X), in meters (input)
522  * Northing : Northing (Y), in meters (input)
523  * Latitude : Latitude, in radians (output)
524  * Longitude : Longitude, in radians (output)
525  */
526 
527 
528  double dy, dx;
529  double rho, rho0_MINUS_dy;
530  double t;
531  double PHI;
532  double tempPHI = 0.0;
533  double sin_PHI;
534  double es_sin;
535  double theta = 0.0;
536  double tolerance = 4.85e-10;
537  long Error_Code = LAMBERT_NO_ERROR;
538 
539 // if ((Easting < (Lambert_False_Easting - Lambert_Delta_Easting))
540 // ||(Easting > (Lambert_False_Easting + Lambert_Delta_Easting)))
541 // { /* Easting out of range */
542 // Error_Code |= LAMBERT_EASTING_ERROR;
543 // }
544 // if ((Northing < (Lambert_False_Northing - Lambert_Delta_Northing))
545 // || (Northing > (Lambert_False_Northing + Lambert_Delta_Northing)))
546 // { /* Northing out of range */
547 // Error_Code |= LAMBERT_NORTHING_ERROR;
548 // }
549 
550  if (!Error_Code)
551  { /* no errors */
552 
553  dy = Northing - Lambert_False_Northing;
554  dx = Easting - Lambert_False_Easting;
555  rho0_MINUS_dy = rho0 - dy;
556  rho = sqrt(dx * dx + (rho0_MINUS_dy) * (rho0_MINUS_dy));
557 
558  if (n < 0.0)
559  {
560  rho *= -1.0;
561  dy *= -1.0;
562  dx *= -1.0;
563  rho0_MINUS_dy *= -1.0;
564  }
565 
566  if (rho != 0.0)
567  {
568  theta = atan2(dx, rho0_MINUS_dy);
569  t = pow(rho / (Lambert_aF) , 1.0 / n);
570  PHI = PI_OVER_2 - 2.0 * atan(t);
571  while (fabs(PHI - tempPHI) > tolerance)
572  {
573  tempPHI = PHI;
574  sin_PHI = sin(PHI);
575  es_sin = ES_SIN(sin_PHI);
576  PHI = PI_OVER_2 - 2.0 * atan(t * pow((1.0 - es_sin) / (1.0 + es_sin), es_OVER_2));
577  }
578  *Latitude = PHI;
579  *Longitude = theta / n + Lambert_Origin_Long;
580 
581  if (fabs(*Latitude) < 2.0e-7) /* force lat to 0 to avoid -0 degrees */
582  *Latitude = 0.0;
583  if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
584  *Latitude = PI_OVER_2;
585  else if (*Latitude < -PI_OVER_2)
586  *Latitude = -PI_OVER_2;
587 
588  if (*Longitude > M_PI)
589  {
590  if (*Longitude - M_PI < 3.5e-6)
591  *Longitude = M_PI;
592 // else
593 // *Longitude -= TWO_PI;
594  }
595  if (*Longitude < -M_PI)
596  {
597  if (fabs(*Longitude + M_PI) < 3.5e-6)
598  *Longitude = -M_PI;
599 // else
600 // *Longitude += TWO_PI;
601  }
602 
603  if (fabs(*Longitude) < 2.0e-7) /* force lon to 0 to avoid -0 degrees */
604  *Longitude = 0.0;
605  if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
606  *Longitude = M_PI;
607  else if (*Longitude < -M_PI)
608  *Longitude = -M_PI;
609  }
610  else
611  {
612  if (n > 0.0)
613  *Latitude = PI_OVER_2;
614  else
615  *Latitude = -PI_OVER_2;
616  *Longitude = Lambert_Origin_Long;
617  }
618  }
619  return (Error_Code);
620 } /* END OF Convert_Lambert_To_Geodetic */
#define ES_SIN(sinlat)
#define M_PI

◆ dup()

ossimObject * ossimLambertConformalConicProjection::dup ( ) const
virtual

Implements ossimProjection.

Definition at line 85 of file ossimLambertConformalConicProjection.cpp.

References ossimLambertConformalConicProjection().

86 {
87  return new ossimLambertConformalConicProjection(*this);
88 }
ossimLambertConformalConicProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 182 of file ossimLambertConformalConicProjection.cpp.

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

183 {
184  double easting = 0.0;
185  double northing = 0.0;
186  ossimGpt gpt = latLon;
187 
188  if (theDatum)
189  {
190  if (theDatum->code() != latLon.datum()->code())
191  {
192  gpt.changeDatum(theDatum); // Shift to our datum.
193  }
194  }
195 
197  gpt.lonr(),
198  &easting,
199  &northing);
200 
201  return ossimDpt(easting, northing);
202 }
long Convert_Geodetic_To_Lambert(double Latitude, double Longitude, double *Easting, double *Northing) const
virtual const ossimString & code() const
Definition: ossimDatum.h:57
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
Definition: ossimGpt.cpp:316
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
double latr() const
latr().
Definition: ossimGpt.h:66
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ Get_Lambert_Parameters()

void ossimLambertConformalConicProjection::Get_Lambert_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Central_Meridian,
double *  Std_Parallel_1,
double *  Std_Parallel_2,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Lambert_Parameters returns the current ellipsoid parameters and Lambert Conformal Conic projection parameters.

a : Semi-major axis of ellipsoid, in meters (output) f : Flattening of ellipsoid (output) Origin_Latitude : Latitude of origin, in radians (output) Central_Meridian : Longitude of origin, in radians (output) Std_Parallel_1 : First standard parallel (output) Std_Parallel_2 : Second standard parallel (output) False_Easting : False easting, in meters (output) False_Northing : False northing, in meters (output)

Definition at line 390 of file ossimLambertConformalConicProjection.cpp.

References Lambert_a, Lambert_f, Lambert_False_Easting, Lambert_False_Northing, Lambert_Origin_Lat, Lambert_Origin_Long, Lambert_Std_Parallel_1, and Lambert_Std_Parallel_2.

399 { /* BEGIN Get_Lambert_Parameters */
400 /*
401  * The function Get_Lambert_Parameters returns the current ellipsoid
402  * parameters and Lambert Conformal Conic projection parameters.
403  *
404  * a : Semi-major axis of ellipsoid, in meters (output)
405  * f : Flattening of ellipsoid (output)
406  * Origin_Latitude : Latitude of origin, in radians (output)
407  * Central_Meridian : Longitude of origin, in radians (output)
408  * Std_Parallel_1 : First standard parallel, in radians (output)
409  * Std_Parallel_2 : Second standard parallel, in radians (output)
410  * False_Easting : False easting, in meters (output)
411  * False_Northing : False northing, in meters (output)
412  */
413 
414 
415  *a = Lambert_a;
416  *f = Lambert_f;
417  *Std_Parallel_1 = Lambert_Std_Parallel_1;
418  *Std_Parallel_2 = Lambert_Std_Parallel_2;
419  *Origin_Latitude = Lambert_Origin_Lat;
420  *Central_Meridian = Lambert_Origin_Long;
421  *False_Easting = Lambert_False_Easting;
422  *False_Northing = Lambert_False_Northing;
423 
424  return;
425 } /* END OF Get_Lambert_Parameters */

◆ getStandardParallel1()

double ossimLambertConformalConicProjection::getStandardParallel1 ( ) const
virtual
Returns
the first standard parallel in decimal degrees.

Reimplemented from ossimMapProjection.

Definition at line 622 of file ossimLambertConformalConicProjection.cpp.

References Lambert_Std_Parallel_1, and RAD_PER_DEG.

Referenced by ossimStatePlaneProjectionInfo::matchesProjection().

◆ getStandardParallel2()

double ossimLambertConformalConicProjection::getStandardParallel2 ( ) const
virtual
Returns
the second standard parallel in decimal degrees.

Reimplemented from ossimMapProjection.

Definition at line 627 of file ossimLambertConformalConicProjection.cpp.

References Lambert_Std_Parallel_2, and RAD_PER_DEG.

Referenced by ossimStatePlaneProjectionInfo::matchesProjection().

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 169 of file ossimLambertConformalConicProjection.cpp.

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

170 {
171  double lat = 0.0;
172  double lon = 0.0;
173 
174  Convert_Lambert_To_Geodetic(eastingNorthing.x,
175  eastingNorthing.y,
176  &lat,
177  &lon);
178 
179  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
180 }
#define DEG_PER_RAD
long Convert_Lambert_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 ossimLambertConformalConicProjection::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 219 of file ossimLambertConformalConicProjection.cpp.

References ossimKeywordlist::find(), Lambert_False_Easting, Lambert_False_Northing, Lambert_Std_Parallel_1, Lambert_Std_Parallel_2, ossimMapProjection::loadState(), RAD_PER_DEG, setDefaults(), STATIC_TYPE_NAME, ossimKeywordNames::STD_PARALLEL_1_KW, ossimKeywordNames::STD_PARALLEL_2_KW, ossimMapProjection::theFalseEastingNorthing, ossimString::toDouble(), ossimKeywordNames::TYPE_KW, update(), ossimDpt::x, and ossimDpt::y.

220 {
221  bool flag = ossimMapProjection::loadState(kwl, prefix);
222 
223  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
224  const char* stdParallel1 = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_1_KW);
225  const char* stdParallel2 = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_2_KW);
226 
227  setDefaults();
228 
230  {
233 
234  if(stdParallel1)
235  {
237  }
238  if(stdParallel2)
239  {
241  }
242  }
243  update();
244  return flag;
245 }
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 toDouble() const
static const char * STD_PARALLEL_1_KW
double x
Definition: ossimDpt.h:164
ossimDpt theFalseEastingNorthing
Hold the false easting northing.
static const char * STD_PARALLEL_2_KW
#define RAD_PER_DEG

◆ operator==()

bool ossimLambertConformalConicProjection::operator== ( const ossimProjection projection) const
virtual

Returns TRUE if principal parameters are within epsilon tolerance.

Reimplemented from ossimMapProjection.

Definition at line 635 of file ossimLambertConformalConicProjection.cpp.

References ossim::almostEqual(), Lambert_Std_Parallel_1, and Lambert_Std_Parallel_2.

636 {
637  if (!ossimMapProjection::operator==(proj))
638  return false;
639 
640  const ossimLambertConformalConicProjection* p = dynamic_cast<const ossimLambertConformalConicProjection*>(&proj);
641  if (!p) return false;
642 
645 
646  return true;
647 }
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53

◆ print()

std::ostream & ossimLambertConformalConicProjection::print ( std::ostream &  out) const
virtual

Prints data members to stream.

Returns stream&.

Reimplemented from ossimMapProjection.

Definition at line 247 of file ossimLambertConformalConicProjection.cpp.

References DEG_PER_RAD, Lambert_Std_Parallel_1, Lambert_Std_Parallel_2, ossimMapProjection::print(), ossimKeywordNames::STD_PARALLEL_1_KW, and ossimKeywordNames::STD_PARALLEL_2_KW.

249 {
250  // Capture the original flags.
251  std::ios_base::fmtflags f = out.flags();
252 
253  out << setiosflags(ios::fixed) << setprecision(15);
254 
255  out << "// ossimLambertConformalConicProjection::print\n"
259  << Lambert_Std_Parallel_2*DEG_PER_RAD << std::endl;
260 
261  // Reset flags.
262  out.setf(f);
263 
264  return ossimMapProjection::print(out);
265 }
#define DEG_PER_RAD
static const char * STD_PARALLEL_1_KW
static const char * STD_PARALLEL_2_KW
virtual std::ostream & print(std::ostream &out) const
Prints data members to stream.

◆ saveState()

bool ossimLambertConformalConicProjection::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 204 of file ossimLambertConformalConicProjection.cpp.

References ossimKeywordlist::add(), DEG_PER_RAD, Lambert_Std_Parallel_1, Lambert_Std_Parallel_2, ossimMapProjection::saveState(), ossimKeywordNames::STD_PARALLEL_1_KW, and ossimKeywordNames::STD_PARALLEL_2_KW.

205 {
206  kwl.add(prefix,
209  true);
210 
211  kwl.add(prefix,
214  true);
215 
216  return ossimMapProjection::saveState(kwl, prefix);
217 }
#define DEG_PER_RAD
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
static const char * STD_PARALLEL_1_KW
static const char * STD_PARALLEL_2_KW

◆ Set_Lambert_Parameters()

long ossimLambertConformalConicProjection::Set_Lambert_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  Std_Parallel_1,
double  Std_Parallel_2,
double  False_Easting,
double  False_Northing 
)
private

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

a : Semi-major axis of ellipsoid, in meters (input) f : Flattening of ellipsoid (input) Origin_Latitude : Latitude of origin in radians (input) Central_Meridian : Longitude of origin in radians (input) Std_Parallel_1 : First standard parallel (input) Std_Parallel_2 : Second standard parallel (input) False_Easting : False easting in meters (input) False_Northing : False northing in meters (input)

Definition at line 272 of file ossimLambertConformalConicProjection.cpp.

References es, es2, es_OVER_2, ES_SIN, F, Lambert_a, Lambert_aF, Lambert_f, Lambert_False_Easting, Lambert_False_Northing, LAMBERT_m, LAMBERT_NO_ERROR, Lambert_Origin_Lat, Lambert_Origin_Long, Lambert_Std_Parallel_1, Lambert_Std_Parallel_2, LAMBERT_t, n, and rho0.

Referenced by update().

281 { /* BEGIN Set_Lambert_Parameters */
282 /*
283  * The function Set_Lambert_Parameters receives the ellipsoid parameters and
284  * Lambert Conformal Conic projection parameters as inputs, and sets the
285  * corresponding state variables. If any errors occur, the error code(s)
286  * are returned by the function, otherwise LAMBERT_NO_ERROR is returned.
287  *
288  * a : Semi-major axis of ellipsoid, in meters (input)
289  * f : Flattening of ellipsoid (input)
290  * Origin_Latitude : Latitude of origin, in radians (input)
291  * Central_Meridian : Longitude of origin, in radians (input)
292  * Std_Parallel_1 : First standard parallel, in radians (input)
293  * Std_Parallel_2 : Second standard parallel, in radians (input)
294  * False_Easting : False easting, in meters (input)
295  * False_Northing : False northing, in meters (input)
296  */
297 
298  double slat, slat1, clat;
299  double es_sin;
300  double t0, t1, t2;
301  double m1, m2;
302 // double inv_f = 1 / f;
303  long Error_Code = LAMBERT_NO_ERROR;
304 
305 // if (a <= 0.0)
306 // { /* Semi-major axis must be greater than zero */
307 // Error_Code |= LAMBERT_A_ERROR;
308 // }
309 // if ((inv_f < 250) || (inv_f > 350))
310 // { /* Inverse flattening must be between 250 and 350 */
311 // Error_Code |= LAMBERT_INV_F_ERROR;
312 // }
313 // if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
314 // { /* Origin Latitude out of range */
315 // Error_Code |= LAMBERT_ORIGIN_LAT_ERROR;
316 // }
317 // if ((Std_Parallel_1 < -MAX_LAT) || (Std_Parallel_1 > MAX_LAT))
318 // { /* First Standard Parallel out of range */
319 // Error_Code |= LAMBERT_FIRST_STDP_ERROR;
320 // }
321 // if ((Std_Parallel_2 < -MAX_LAT) || (Std_Parallel_2 > MAX_LAT))
322 // { /* Second Standard Parallel out of range */
323 // Error_Code |= LAMBERT_SECOND_STDP_ERROR;
324 // }
325 // if ((Std_Parallel_1 == 0) && (Std_Parallel_2 == 0))
326 // { /* First & Second Standard Parallels are both 0 */
327 // Error_Code |= LAMBERT_FIRST_SECOND_ERROR;
328 // }
329 // if (Std_Parallel_1 == -Std_Parallel_2)
330 // { /* Parallels are the negation of each other */
331 // Error_Code |= LAMBERT_HEMISPHERE_ERROR;
332 // }
333 // if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
334 // { /* Origin Longitude out of range */
335 // Error_Code |= LAMBERT_CENT_MER_ERROR;
336 // }
337 
338  if (!Error_Code)
339  { /* no errors */
340 
341  Lambert_a = a;
342  Lambert_f = f;
343  Lambert_Origin_Lat = Origin_Latitude;
344  Lambert_Std_Parallel_1 = Std_Parallel_1;
345  Lambert_Std_Parallel_2 = Std_Parallel_2;
346 // if (Central_Meridian > PI)
347 // Central_Meridian -= TWO_PI;
348  Lambert_Origin_Long = Central_Meridian;
349  Lambert_False_Easting = False_Easting;
350  Lambert_False_Northing = False_Northing;
351 
352  es2 = 2 * Lambert_f - Lambert_f * Lambert_f;
353  es = sqrt(es2);
354  es_OVER_2 = es / 2.0;
355 
356  slat = sin(Lambert_Origin_Lat);
357  es_sin = ES_SIN(slat);
358  t0 = LAMBERT_t(Lambert_Origin_Lat, es_sin);
359 
360  slat1 = sin(Lambert_Std_Parallel_1);
361  clat = cos(Lambert_Std_Parallel_1);
362  es_sin = ES_SIN(slat1);
363  m1 = LAMBERT_m(clat, es_sin);
364  t1 = LAMBERT_t(Lambert_Std_Parallel_1, es_sin);
365 
366 
367  if (fabs(Lambert_Std_Parallel_1 - Lambert_Std_Parallel_2) > 1.0e-10)
368  {
369  slat = sin(Lambert_Std_Parallel_2);
370  clat = cos(Lambert_Std_Parallel_2);
371  es_sin = ES_SIN(slat);
372  m2 = LAMBERT_m(clat, es_sin);
373  t2 = LAMBERT_t(Lambert_Std_Parallel_2, es_sin);
374  n = log(m1 / m2) / log(t1 / t2);
375  }
376  else
377  n = slat1;
378  F = m1 / (n * pow(t1, n));
379  Lambert_aF = Lambert_a * F;
380  if ((t0 == 0) && (n < 0))
381  rho0 = 0.0;
382  else
383  rho0 = Lambert_aF * pow(t0, n);
384 
385  }
386  return (Error_Code);
387 } /* END OF Set_Lambert_Parameters */
#define LAMBERT_m(clat, essin)
#define ES_SIN(sinlat)
#define LAMBERT_t(lat, essin)

◆ setDefaults()

void ossimLambertConformalConicProjection::setDefaults ( )

◆ setFalseEasting()

void ossimLambertConformalConicProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 128 of file ossimLambertConformalConicProjection.cpp.

References Lambert_False_Easting, and update().

◆ setFalseEastingNorthing()

void ossimLambertConformalConicProjection::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 140 of file ossimLambertConformalConicProjection.cpp.

References Lambert_False_Easting, Lambert_False_Northing, and update().

◆ setFalseNorthing()

void ossimLambertConformalConicProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 134 of file ossimLambertConformalConicProjection.cpp.

References Lambert_False_Northing, and update().

◆ setParameters()

void ossimLambertConformalConicProjection::setParameters ( double  parallel1,
double  parallel2,
double  falseEasting,
double  falseNorthing 
)

Allows one to set all parameters for this projections.

Update is then called so we can pre-compute paramters.

Parameters
stdParallel1First parallel in decimal degrees.
stdParallel2Second parallel in decimal degrees.
falseEastingFalse easting in meters.
falseNorthingFalse northing in meters.

Definition at line 148 of file ossimLambertConformalConicProjection.cpp.

References Lambert_False_Easting, Lambert_False_Northing, Lambert_Std_Parallel_1, Lambert_Std_Parallel_2, RAD_PER_DEG, and update().

◆ setStandardParallel1()

void ossimLambertConformalConicProjection::setStandardParallel1 ( double  degree)

The passed in Argument is in degrees and will convert it to radians for Geotrans. Update is then called so we can pre-compute paramters.

Definition at line 107 of file ossimLambertConformalConicProjection.cpp.

References Lambert_Std_Parallel_1, RAD_PER_DEG, and update().

Referenced by ossimWktProjectionFactory::doLambertConformalConic().

◆ setStandardParallel2()

void ossimLambertConformalConicProjection::setStandardParallel2 ( double  degree)

The passed in Argument is in degrees and will convert it to radians for Geotrans. Update is then called so we can pre-compute paramters

Definition at line 113 of file ossimLambertConformalConicProjection.cpp.

References Lambert_Std_Parallel_2, RAD_PER_DEG, and update().

Referenced by ossimWktProjectionFactory::doLambertConformalConic().

◆ setStandardParallels()

void ossimLambertConformalConicProjection::setStandardParallels ( double  parallel1Degree,
double  prallel2Degree 
)

Will allow you to set both parallels. both are passed in degrees.

Definition at line 119 of file ossimLambertConformalConicProjection.cpp.

References Lambert_Std_Parallel_1, Lambert_Std_Parallel_2, RAD_PER_DEG, and update().

◆ update()

void ossimLambertConformalConicProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 90 of file ossimLambertConformalConicProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), Lambert_False_Easting, Lambert_False_Northing, Lambert_Std_Parallel_1, Lambert_Std_Parallel_2, ossimGpt::latr(), ossimGpt::lonr(), Set_Lambert_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

Referenced by loadState(), ossimLambertConformalConicProjection(), setFalseEasting(), setFalseEastingNorthing(), setFalseNorthing(), setParameters(), setStandardParallel1(), setStandardParallel2(), and setStandardParallels().

91 {
94  theOrigin.latr(),
95  theOrigin.lonr(),
100 
103 
105 }
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_Lambert_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double Std_Parallel_1, double Std_Parallel_2, double False_Easting, double False_Northing)

Member Data Documentation

◆ es

double ossimLambertConformalConicProjection::es
mutableprivate

Definition at line 133 of file ossimLambertConformalConicProjection.h.

Referenced by Set_Lambert_Parameters().

◆ es2

double ossimLambertConformalConicProjection::es2
mutableprivate

Definition at line 134 of file ossimLambertConformalConicProjection.h.

Referenced by Set_Lambert_Parameters().

◆ es_OVER_2

double ossimLambertConformalConicProjection::es_OVER_2
mutableprivate

◆ F

double ossimLambertConformalConicProjection::F
mutableprivate

Definition at line 137 of file ossimLambertConformalConicProjection.h.

Referenced by Set_Lambert_Parameters().

◆ Lambert_a

double ossimLambertConformalConicProjection::Lambert_a
mutableprivate

◆ Lambert_aF

double ossimLambertConformalConicProjection::Lambert_aF
mutableprivate

◆ Lambert_f

double ossimLambertConformalConicProjection::Lambert_f
mutableprivate

◆ Lambert_False_Easting

double ossimLambertConformalConicProjection::Lambert_False_Easting
mutableprivate

◆ Lambert_False_Northing

double ossimLambertConformalConicProjection::Lambert_False_Northing
mutableprivate

◆ Lambert_Origin_Lat

double ossimLambertConformalConicProjection::Lambert_Origin_Lat
mutableprivate

◆ Lambert_Origin_Long

double ossimLambertConformalConicProjection::Lambert_Origin_Long
mutableprivate

◆ Lambert_Std_Parallel_1

double ossimLambertConformalConicProjection::Lambert_Std_Parallel_1
mutableprivate

◆ Lambert_Std_Parallel_2

double ossimLambertConformalConicProjection::Lambert_Std_Parallel_2
mutableprivate

◆ n

double ossimLambertConformalConicProjection::n
mutableprivate

◆ rho0

double ossimLambertConformalConicProjection::rho0
mutableprivate

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