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

#include <ossimBonneProjection.h>

Inheritance diagram for ossimBonneProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimBonneProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimBonneProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, const double falseEasting, const double falseNorthing)
 
 ~ossimBonneProjection ()
 
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)
 
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 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 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_Bonne_Parameters (double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Bonne_Parameters (double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Bonne (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Bonne_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Bonn_a
 
double Bonn_f
 
double es2
 
double es4
 
double es6
 
double M1
 
double m1
 
double c0
 
double c1
 
double c2
 
double c3
 
double a0
 
double a1
 
double a2
 
double a3
 
double Bonn_Origin_Lat
 
double Bonn_Origin_Long
 
double Bonn_False_Northing
 
double Bonn_False_Easting
 
double Sin_Bonn_Origin_Lat
 
double Bonn_am1sin
 
double Bonn_Max_Easting
 
double Bonn_Min_Easting
 
double Bonn_Delta_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 17 of file ossimBonneProjection.h.

Constructor & Destructor Documentation

◆ ossimBonneProjection() [1/2]

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

Definition at line 41 of file ossimBonneProjection.cpp.

References setDefaults(), and update().

43  :ossimMapProjection(ellipsoid, origin)
44 {
45  setDefaults();
46  update();
47 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimBonneProjection() [2/2]

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

Definition at line 49 of file ossimBonneProjection.cpp.

References Bonn_Delta_Northing, Bonn_False_Easting, Bonn_False_Northing, and update().

53  :ossimMapProjection(ellipsoid, origin)
54 {
55  Bonn_False_Easting = falseEasting;
56  Bonn_False_Northing = falseNorthing;
57  Bonn_Delta_Northing = 25000000.0;
58 
59  update();
60 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimBonneProjection()

ossimBonneProjection::~ossimBonneProjection ( )
inline

Definition at line 27 of file ossimBonneProjection.h.

27 {}

Member Function Documentation

◆ Convert_Bonne_To_Geodetic()

long ossimBonneProjection::Convert_Bonne_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

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

References a0, a1, a2, a3, Bonn_a, Bonn_am1sin, Bonn_False_Easting, Bonn_False_Northing, BONN_m, BONN_NO_ERROR, Bonn_Origin_Lat, Bonn_Origin_Long, c0, COEFF_TIMES_BONN_SIN, Convert_Sinusoidal_To_Geodetic(), FLOAT_EQ, M1, M_PI, and PI_OVER_2.

Referenced by inverse().

424 { /* Begin Convert_Bonne_To_Geodetic */
425 /*
426  * The function Convert_Bonne_To_Geodetic converts Bonne projection
427  * (easting and northing) coordinates to geodetic (latitude and longitude)
428  * coordinates, according to the current ellipsoid and Bonne projection
429  * coordinates. If any errors occur, the error code(s) are returned by the
430  * function, otherwise BONN_NO_ERROR is returned.
431  *
432  * Easting : Easting (X) in meters (input)
433  * Northing : Northing (Y) in meters (input)
434  * Latitude : Latitude (phi) in radians (output)
435  * Longitude : Longitude (lambda) in radians (output)
436  */
437 
438  double dx; /* Delta easting - Difference in easting (easting-FE) */
439  double dy; /* Delta northing - Difference in northing (northing-FN) */
440  double mu;
441  double MM;
442  double mm;
443  double am1sin_dy;
444  double rho;
445  double sin2mu, sin4mu, sin6mu, sin8mu;
446  double clat, slat;
447  long Error_Code = BONN_NO_ERROR;
448 
449 // if ((Easting < (Bonn_False_Easting + Bonn_Min_Easting))
450 // || (Easting > (Bonn_False_Easting + Bonn_Max_Easting)))
451 // { /* Easting out of range */
452 // Error_Code |= BONN_EASTING_ERROR;
453 // }
454 // if ((Northing < (Bonn_False_Northing - Bonn_Delta_Northing))
455 // || (Northing > (Bonn_False_Northing + Bonn_Delta_Northing)))
456 // { /* Northing out of range */
457 // Error_Code |= BONN_NORTHING_ERROR;
458 // }
459  if (!Error_Code)
460  { /* no errors */
461  if (Bonn_Origin_Lat == 0.0)
462  Convert_Sinusoidal_To_Geodetic(Easting, Northing, Latitude, Longitude);
463  else
464  {
465  dy = Northing - Bonn_False_Northing;
466  dx = Easting - Bonn_False_Easting;
467  am1sin_dy = Bonn_am1sin - dy;
468  rho = sqrt(dx * dx + am1sin_dy * am1sin_dy);
469  if (Bonn_Origin_Lat < 0.0)
470  rho = -rho;
471  MM = Bonn_am1sin + M1 - rho;
472 
473  mu = MM / (Bonn_a * c0);
474  sin2mu = COEFF_TIMES_BONN_SIN(a0, 2.0, mu);
475  sin4mu = COEFF_TIMES_BONN_SIN(a1, 4.0, mu);
476  sin6mu = COEFF_TIMES_BONN_SIN(a2, 6.0, mu);
477  sin8mu = COEFF_TIMES_BONN_SIN(a3, 8.0, mu);
478  *Latitude = mu + sin2mu + sin4mu + sin6mu + sin8mu;
479 
480  if (FLOAT_EQ(fabs(*Latitude),PI_OVER_2,.00001))
481  {
482  *Longitude = Bonn_Origin_Long;
483  }
484  else
485  {
486  clat = cos(*Latitude);
487  slat = sin(*Latitude);
488  mm = BONN_m(clat, slat);
489 
490  if (Bonn_Origin_Lat < 0.0)
491  {
492  dx = -dx;
493  am1sin_dy = -am1sin_dy;
494  }
495  *Longitude = Bonn_Origin_Long + rho * (atan2(dx, am1sin_dy)) /
496  (Bonn_a * mm);
497  }
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  }
515  return (Error_Code);
516 } /* End Convert_Bonne_To_Geodetic */
#define COEFF_TIMES_BONN_SIN(coeff, x, latit)
#define M_PI
long Convert_Sinusoidal_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude)
#define PI_OVER_2
#define BONN_m(coslat, sinlat)
#define FLOAT_EQ(x, v, epsilon)
#define BONN_NO_ERROR

◆ Convert_Geodetic_To_Bonne()

long ossimBonneProjection::Convert_Geodetic_To_Bonne ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

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

References Bonn_a, Bonn_am1sin, Bonn_False_Easting, Bonn_False_Northing, BONN_m, BONN_M, BONN_NO_ERROR, Bonn_Origin_Lat, Bonn_Origin_Long, c0, c1, c2, c3, COEFF_TIMES_BONN_SIN, Convert_Geodetic_To_Sinusoidal(), FLOAT_EQ, M1, M_PI, PI_OVER_2, and TWO_PI.

Referenced by forward().

344 { /* Begin Convert_Geodetic_To_Bonne */
345 /*
346  * The function Convert_Geodetic_To_Bonne converts geodetic (latitude and
347  * longitude) coordinates to Bonne projection (easting and northing)
348  * coordinates, according to the current ellipsoid and Bonne projection
349  * parameters. If any errors occur, the error code(s) are returned by the
350  * function, otherwise BONN_NO_ERROR is returned.
351  *
352  * Latitude : Latitude (phi) in radians (input)
353  * Longitude : Longitude (lambda) in radians (input)
354  * Easting : Easting (X) in meters (output)
355  * Northing : Northing (Y) in meters (output)
356  */
357 
358  double dlam; /* Longitude - Central Meridan */
359  double mm;
360  double MM;
361  double rho;
362  double EE;
363  double clat = cos(Latitude);
364  double slat = sin(Latitude);
365  double lat, sin2lat, sin4lat, sin6lat;
366  long Error_Code = BONN_NO_ERROR;
367 
368 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
369 // { /* Latitude out of range */
370 // Error_Code |= BONN_LAT_ERROR;
371 // }
372 // if ((Longitude < -PI) || (Longitude > TWO_PI))
373 // { /* Longitude out of range */
374 // Error_Code |= BONN_LON_ERROR;
375 // }
376  if (!Error_Code)
377  { /* no errors */
378  if (Bonn_Origin_Lat == 0.0)
379  Convert_Geodetic_To_Sinusoidal(Latitude, Longitude, Easting, Northing);
380  else
381  {
382  dlam = Longitude - Bonn_Origin_Long;
383  if (dlam > M_PI)
384  {
385  dlam -= TWO_PI;
386  }
387  if (dlam < -M_PI)
388  {
389  dlam += TWO_PI;
390  }
391  if ((Latitude - Bonn_Origin_Lat) == 0.0 && FLOAT_EQ(fabs(Latitude),PI_OVER_2,.00001))
392  {
393  *Easting = 0.0;
394  *Northing = 0.0;
395  }
396  else
397  {
398  mm = BONN_m(clat, slat);
399 
400  lat = c0 * Latitude;
401  sin2lat = COEFF_TIMES_BONN_SIN(c1, 2.0, Latitude);
402  sin4lat = COEFF_TIMES_BONN_SIN(c2, 4.0, Latitude);
403  sin6lat = COEFF_TIMES_BONN_SIN(c3, 6.0, Latitude);
404  MM = BONN_M(lat, sin2lat, sin4lat, sin6lat);
405 
406  rho = Bonn_am1sin + M1 - MM;
407  if (rho == 0)
408  EE = 0;
409  else
410  EE = Bonn_a * mm * dlam / rho;
411  *Easting = rho * sin(EE) + Bonn_False_Easting;
412  *Northing = Bonn_am1sin - rho * cos(EE) + Bonn_False_Northing;
413  }
414  }
415  }
416  return (Error_Code);
417 } /* End Convert_Geodetic_To_Bonne */
#define BONN_M(c0lat, c1s2lat, c2s4lat, c3s6lat)
#define COEFF_TIMES_BONN_SIN(coeff, x, latit)
#define M_PI
#define PI_OVER_2
#define BONN_m(coslat, sinlat)
long Convert_Geodetic_To_Sinusoidal(double Latitude, double Longitude, double *Easting, double *Northing)
#define TWO_PI
#define FLOAT_EQ(x, v, epsilon)
#define BONN_NO_ERROR

◆ dup()

virtual ossimObject* ossimBonneProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 28 of file ossimBonneProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 123 of file ossimBonneProjection.cpp.

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

124 {
125  double easting = 0.0;
126  double northing = 0.0;
127  ossimGpt gpt = latLon;
128 
129  if (theDatum)
130  {
131  if (theDatum->code() != latLon.datum()->code())
132  {
133  gpt.changeDatum(theDatum); // Shift to our datum.
134  }
135  }
136 
138  gpt.lonr(),
139  &easting,
140  &northing);
141  return ossimDpt(easting, northing);
142 }
virtual const ossimString & code() const
Definition: ossimDatum.h:57
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
Definition: ossimGpt.cpp:316
long Convert_Geodetic_To_Bonne(double Latitude, double Longitude, double *Easting, double *Northing) const
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
double latr() const
latr().
Definition: ossimGpt.h:66
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ Get_Bonne_Parameters()

void ossimBonneProjection::Get_Bonne_Parameters ( double *  a,
double *  f,
double *  Origin_Latitude,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Bonne_Parameters returns the current ellipsoid parameters and Bonne 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 307 of file ossimBonneProjection.cpp.

References Bonn_a, Bonn_f, Bonn_False_Easting, Bonn_False_Northing, Bonn_Origin_Lat, and Bonn_Origin_Long.

313 { /* Begin Get_Bonne_Parameters */
314 /*
315  * The function Get_Bonne_Parameters returns the current ellipsoid
316  * parameters and Bonne projection parameters.
317  *
318  * a : Semi-major axis of ellipsoid, in meters (output)
319  * f : Flattening of ellipsoid (output)
320  * Origin_Latitude : Latitude in radians at which the (output)
321  * point scale factor is 1.0
322  * Central_Meridian : Longitude in radians at the center of (output)
323  * the projection
324  * False_Easting : A coordinate value in meters assigned to the
325  * central meridian of the projection. (output)
326  * False_Northing : A coordinate value in meters assigned to the
327  * origin latitude of the projection (output)
328  */
329 
330  *a = Bonn_a;
331  *f = Bonn_f;
332  *Origin_Latitude = Bonn_Origin_Lat;
333  *Central_Meridian = Bonn_Origin_Long;
334  *False_Easting = Bonn_False_Easting;
335  *False_Northing = Bonn_False_Northing;
336  return;
337 } /* End Get_Bonne_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 53 of file ossimBonneProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 54 of file ossimBonneProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 112 of file ossimBonneProjection.cpp.

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

113 {
114  double lat, lon;
115 
116  Convert_Bonne_To_Geodetic(eastingNorthing.x,
117  eastingNorthing.y,
118  &lat,
119  &lon);
120  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0, theDatum);
121 }
#define DEG_PER_RAD
long Convert_Bonne_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 ossimBonneProjection::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 149 of file ossimBonneProjection.cpp.

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

150 {
151  // Must do this first.
152  bool flag = ossimMapProjection::loadState(kwl, prefix);
153 
154  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
155 
156  setDefaults();
157 
159  {
162  }
163 
164  update();
165  return flag;
166 }
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.

◆ operator==()

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

Returns TRUE if principal parameters are within epsilon tolerance.

Reimplemented from ossimMapProjection.

Definition at line 521 of file ossimBonneProjection.cpp.

References ossim::almostEqual(), Bonn_Delta_Northing, Bonn_False_Easting, and Bonn_False_Northing.

522 {
523  if (!ossimMapProjection::operator==(proj))
524  return false;
525 
526  const ossimBonneProjection* p = dynamic_cast<const ossimBonneProjection*>(&proj);
527  if (!p)
528  return false;
529 
533 
534  return true;
535 }
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53

◆ saveState()

bool ossimBonneProjection::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 144 of file ossimBonneProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Bonne_Parameters()

long ossimBonneProjection::Set_Bonne_Parameters ( double  a,
double  f,
double  Origin_Latitude,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
private

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

References a0, a1, a2, a3, Bonn_a, Bonn_am1sin, Bonn_Delta_Northing, Bonn_f, Bonn_False_Easting, Bonn_False_Northing, BONN_m, BONN_M, Bonn_Max_Easting, Bonn_Min_Easting, BONN_NO_ERROR, Bonn_Origin_Lat, Bonn_Origin_Long, c0, c1, c2, c3, COEFF_TIMES_BONN_SIN, es2, es4, es6, M1, m1, Set_Sinusoidal_Parameters(), Sin_Bonn_Origin_Lat, and x.

Referenced by update().

187 { /* Begin Set_Bonne_Parameters */
188 /*
189  * The function Set_Bonne_Parameters receives the ellipsoid parameters and
190  * Bonne projection parameters as inputs, and sets the corresponding state
191  * variables. If any errors occur, the error code(s) are returned by the
192  * function, otherwise BONN_NO_ERROR is returned.
193  *
194  * a : Semi-major axis of ellipsoid, in meters (input)
195  * f : Flattening of ellipsoid (input)
196  * Origin_Latitude : Latitude in radians at which the (input)
197  * point scale factor is 1.0
198  * Central_Meridian : Longitude in radians at the center of (input)
199  * the projection
200  * False_Easting : A coordinate value in meters assigned to the
201  * central meridian of the projection. (input)
202  * False_Northing : A coordinate value in meters assigned to the
203  * origin latitude of the projection (input)
204  */
205 
206  double j, three_es4;
207  double x,e1,e2,e3,e4;
208  double clat;
209  double sin2lat, sin4lat, sin6lat, lat;
210 // double inv_f = 1 / f;
211  long Error_Code = BONN_NO_ERROR;
212 
213 // if (a <= 0.0)
214 // { /* Semi-major axis must be greater than zero */
215 // Error_Code |= BONN_A_ERROR;
216 // }
217 // if ((inv_f < 250) || (inv_f > 350))
218 // { /* Inverse flattening must be between 250 and 350 */
219 // Error_Code |= BONN_INV_F_ERROR;
220 // }
221 // if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
222 // { /* origin latitude out of range */
223 // Error_Code |= BONN_ORIGIN_LAT_ERROR;
224 // }
225 // if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
226 // { /* origin longitude out of range */
227 // Error_Code |= BONN_CENT_MER_ERROR;
228 // }
229  if (!Error_Code)
230  { /* no errors */
231  Bonn_a = a;
232  Bonn_f = f;
233  Bonn_Origin_Lat = Origin_Latitude;
234 // if (Central_Meridian > PI)
235 // Central_Meridian -= TWO_PI;
236  Bonn_Origin_Long = Central_Meridian;
237  Bonn_False_Northing = False_Northing;
238  Bonn_False_Easting = False_Easting;
239  if (Bonn_Origin_Lat == 0.0)
240  {
241  if (Bonn_Origin_Long > 0)
242  {
243  Bonn_Max_Easting = 19926189.0;
244  Bonn_Min_Easting = -20037509.0;
245  }
246  else if (Bonn_Origin_Long < 0)
247  {
248  Bonn_Max_Easting = 20037509.0;
249  Bonn_Min_Easting = -19926189.0;
250  }
251  else
252  {
253  Bonn_Max_Easting = 20037509.0;
254  Bonn_Min_Easting = -20037509.0;
255  }
256  Bonn_Delta_Northing = 10001966.0;
258  }
259  else
260  {
262 
263  es2 = 2 * Bonn_f - Bonn_f * Bonn_f;
264  es4 = es2 * es2;
265  es6 = es4 * es2;
266  j = 45.0 * es6 / 1024.0;
267  three_es4 = 3.0 * es4;
268  c0 = 1 - es2 / 4.0 - three_es4 / 64.0 - 5.0 * es6 / 256.0;
269  c1 = 3.0 * es2 / 8.0 + three_es4 / 32.0 + j;
270  c2 = 15.0 * es4 / 256.0 + j;
271  c3 = 35.0 * es6 / 3072.0;
272 
273  clat = cos(Bonn_Origin_Lat);
274  m1 = BONN_m(clat, Sin_Bonn_Origin_Lat);
275 
276  lat = c0 * Bonn_Origin_Lat;
277  sin2lat = COEFF_TIMES_BONN_SIN(c1, 2.0, Bonn_Origin_Lat);
278  sin4lat = COEFF_TIMES_BONN_SIN(c2, 4.0, Bonn_Origin_Lat);
279  sin6lat = COEFF_TIMES_BONN_SIN(c3, 6.0, Bonn_Origin_Lat);
280  M1 = BONN_M(lat, sin2lat, sin4lat, sin6lat);
281 
282  x = sqrt (1.0 - es2);
283  e1 = (1.0 - x) / (1.0 + x);
284  e2 = e1 * e1;
285  e3 = e2 * e1;
286  e4 = e3 * e1;
287  a0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0;
288  a1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
289  a2 = 151.0 * e3 / 96.0;
290  a3 = 1097.0 * e4 / 512.0;
291  if (Sin_Bonn_Origin_Lat == 0.0)
292  Bonn_am1sin = 0.0;
293  else
295 
296  Bonn_Max_Easting = 20027474.0;
297  Bonn_Min_Easting = -20027474.0;
298  Bonn_Delta_Northing = 20003932.0;
299 
300  }
301 
302  } /* End if(!Error_Code) */
303  return (Error_Code);
304 } /* End Set_Bonne_Parameters */
ossim_uint32 x
long Set_Sinusoidal_Parameters(double a, double f, double Central_Meridian, double False_Easting, double False_Northing)
#define BONN_M(c0lat, c1s2lat, c2s4lat, c3s6lat)
#define COEFF_TIMES_BONN_SIN(coeff, x, latit)
#define BONN_m(coslat, sinlat)
#define BONN_NO_ERROR

◆ setDefaults()

void ossimBonneProjection::setDefaults ( )

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

Definition at line 97 of file ossimBonneProjection.cpp.

References Bonn_Delta_Northing, Bonn_False_Easting, Bonn_False_Northing, ossimGpt::latd(), and ossimMapProjection::theOrigin.

Referenced by loadState(), and ossimBonneProjection().

98 {
99 
100  Bonn_False_Easting = 0.0;
101  Bonn_False_Northing = 0.0;
102  Bonn_Delta_Northing = 25000000.0;
103  if(theOrigin.latd() == 0.0)
104  {
105  // we can't have the origin of lat 0 for Bonne
106  // so bump it up an arc second.
107  //
108  theOrigin.latd(1.0/3600.0);
109  }
110 }
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87

◆ setFalseEasting()

void ossimBonneProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 77 of file ossimBonneProjection.cpp.

References Bonn_False_Easting, and update().

78 {
79  Bonn_False_Easting = falseEasting;
80  update();
81 }

◆ setFalseEastingNorthing()

void ossimBonneProjection::setFalseEastingNorthing ( double  falseEasting,
double  falseNorthing 
)

Sets both false easting and northing values. The values are expected to be in meters. Update is then called so we can pre-compute paramters

Definition at line 89 of file ossimBonneProjection.cpp.

References Bonn_False_Easting, Bonn_False_Northing, and update().

91 {
92  Bonn_False_Easting = falseEasting;
93  Bonn_False_Northing = falseNorthing;
94  update();
95 }

◆ setFalseNorthing()

void ossimBonneProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 83 of file ossimBonneProjection.cpp.

References Bonn_False_Northing, and update().

84 {
85  Bonn_False_Northing = falseNorthing;
86  update();
87 }

◆ update()

void ossimBonneProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 62 of file ossimBonneProjection.cpp.

References Bonn_False_Easting, Bonn_False_Northing, ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::latr(), ossimGpt::lonr(), Set_Bonne_Parameters(), ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

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

63 {
66  theOrigin.latr(),
67  theOrigin.lonr(),
70 
73 
75 }
long Set_Bonne_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

◆ a0

double ossimBonneProjection::a0
mutableprivate

Definition at line 93 of file ossimBonneProjection.h.

Referenced by Convert_Bonne_To_Geodetic(), and Set_Bonne_Parameters().

◆ a1

double ossimBonneProjection::a1
mutableprivate

Definition at line 94 of file ossimBonneProjection.h.

Referenced by Convert_Bonne_To_Geodetic(), and Set_Bonne_Parameters().

◆ a2

double ossimBonneProjection::a2
mutableprivate

Definition at line 95 of file ossimBonneProjection.h.

Referenced by Convert_Bonne_To_Geodetic(), and Set_Bonne_Parameters().

◆ a3

double ossimBonneProjection::a3
mutableprivate

Definition at line 96 of file ossimBonneProjection.h.

Referenced by Convert_Bonne_To_Geodetic(), and Set_Bonne_Parameters().

◆ Bonn_a

double ossimBonneProjection::Bonn_a
mutableprivate

◆ Bonn_am1sin

double ossimBonneProjection::Bonn_am1sin
mutableprivate

◆ Bonn_Delta_Northing

double ossimBonneProjection::Bonn_Delta_Northing
mutableprivate

◆ Bonn_f

double ossimBonneProjection::Bonn_f
mutableprivate

Definition at line 83 of file ossimBonneProjection.h.

Referenced by Get_Bonne_Parameters(), and Set_Bonne_Parameters().

◆ Bonn_False_Easting

double ossimBonneProjection::Bonn_False_Easting
mutableprivate

◆ Bonn_False_Northing

double ossimBonneProjection::Bonn_False_Northing
mutableprivate

◆ Bonn_Max_Easting

double ossimBonneProjection::Bonn_Max_Easting
mutableprivate

Definition at line 109 of file ossimBonneProjection.h.

Referenced by Set_Bonne_Parameters().

◆ Bonn_Min_Easting

double ossimBonneProjection::Bonn_Min_Easting
mutableprivate

Definition at line 110 of file ossimBonneProjection.h.

Referenced by Set_Bonne_Parameters().

◆ Bonn_Origin_Lat

double ossimBonneProjection::Bonn_Origin_Lat
mutableprivate

◆ Bonn_Origin_Long

double ossimBonneProjection::Bonn_Origin_Long
mutableprivate

◆ c0

double ossimBonneProjection::c0
mutableprivate

◆ c1

double ossimBonneProjection::c1
mutableprivate

Definition at line 90 of file ossimBonneProjection.h.

Referenced by Convert_Geodetic_To_Bonne(), and Set_Bonne_Parameters().

◆ c2

double ossimBonneProjection::c2
mutableprivate

Definition at line 91 of file ossimBonneProjection.h.

Referenced by Convert_Geodetic_To_Bonne(), and Set_Bonne_Parameters().

◆ c3

double ossimBonneProjection::c3
mutableprivate

Definition at line 92 of file ossimBonneProjection.h.

Referenced by Convert_Geodetic_To_Bonne(), and Set_Bonne_Parameters().

◆ es2

double ossimBonneProjection::es2
mutableprivate

Definition at line 84 of file ossimBonneProjection.h.

Referenced by Set_Bonne_Parameters().

◆ es4

double ossimBonneProjection::es4
mutableprivate

Definition at line 85 of file ossimBonneProjection.h.

Referenced by Set_Bonne_Parameters().

◆ es6

double ossimBonneProjection::es6
mutableprivate

Definition at line 86 of file ossimBonneProjection.h.

Referenced by Set_Bonne_Parameters().

◆ M1

double ossimBonneProjection::M1
mutableprivate

◆ m1

double ossimBonneProjection::m1
mutableprivate

Definition at line 88 of file ossimBonneProjection.h.

Referenced by Set_Bonne_Parameters().

◆ Sin_Bonn_Origin_Lat

double ossimBonneProjection::Sin_Bonn_Origin_Lat
mutableprivate

Definition at line 104 of file ossimBonneProjection.h.

Referenced by Set_Bonne_Parameters().


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