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

#include <ossimSinusoidalProjection.h>

Inheritance diagram for ossimSinusoidalProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimSinusoidalProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimSinusoidalProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin, const double falseEasting, const double falseNorthing)
 
 ~ossimSinusoidalProjection ()
 
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 ()
 
void setCentralMeridian (double centralMeridian)
 
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)
 
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_Sinusoidal_Parameters (double a, double f, double Central_Meridian, double False_Easting, double False_Northing)
 
void Get_Sinusoidal_Parameters (double *a, double *f, double *Central_Meridian, double *False_Easting, double *False_Northing) const
 
long Convert_Geodetic_To_Sinusoidal (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_Sinusoidal_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 

Private Attributes

double Sinu_a
 
double Sinu_f
 
double es2
 
double es4
 
double es6
 
double c0
 
double c1
 
double c2
 
double c3
 
double a0
 
double a1
 
double a2
 
double a3
 
double Sinu_Origin_Long
 
double Sinu_False_Northing
 
double Sinu_False_Easting
 
double Sinu_Max_Easting
 
double Sinu_Min_Easting
 
double Sinu_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 18 of file ossimSinusoidalProjection.h.

Constructor & Destructor Documentation

◆ ossimSinusoidalProjection() [1/2]

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

Definition at line 49 of file ossimSinusoidalProjection.cpp.

References setDefaults(), and update().

51  :ossimMapProjection(ellipsoid, origin)
52 {
53  setDefaults();
54  update();
55 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ossimSinusoidalProjection() [2/2]

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

Definition at line 57 of file ossimSinusoidalProjection.cpp.

References Sinu_Delta_Northing, Sinu_False_Easting, Sinu_False_Northing, Sinu_Max_Easting, Sinu_Min_Easting, and update().

61  :ossimMapProjection(ellipsoid, origin)
62 {
63  Sinu_False_Easting = falseEasting;
64  Sinu_False_Northing = falseNorthing;
65  Sinu_Max_Easting = 20037509.0;
66  Sinu_Min_Easting = -20037509.0;
67  Sinu_Delta_Northing = 10001966.0;
68 
69  update();
70 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimSinusoidalProjection()

ossimSinusoidalProjection::~ossimSinusoidalProjection ( )
inline

Definition at line 29 of file ossimSinusoidalProjection.h.

29 {}

Member Function Documentation

◆ Convert_Geodetic_To_Sinusoidal()

long ossimSinusoidalProjection::Convert_Geodetic_To_Sinusoidal ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
private

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

References c0, c1, c2, c3, es2, Sinu_a, SINU_COEFF_TIMES_SIN, Sinu_False_Easting, Sinu_False_Northing, SINU_NO_ERROR, and Sinu_Origin_Long.

Referenced by forward().

307 { /* BEGIN Convert_Geodetic_To_Sinusoidal */
308 /*
309  * The function Convert_Geodetic_To_Sinusoidal converts geodetic (latitude and
310  * longitude) coordinates to Sinusoidal projection (easting and northing)
311  * coordinates, according to the current ellipsoid and Sinusoidal projection
312  * parameters. If any errors occur, the error code(s) are returned by the
313  * function, otherwise SINU_NO_ERROR is returned.
314  *
315  * Latitude : Latitude (phi) in radians (input)
316  * Longitude : Longitude (lambda) in radians (input)
317  * Easting : Easting (X) in meters (output)
318  * Northing : Northing (Y) in meters (output)
319  */
320 
321  double slat = sin(Latitude);
322  double sin2lat, sin4lat, sin6lat;
323  double dlam; /* Longitude - Central Meridan */
324  double mm;
325  double MM;
326  long Error_Code = SINU_NO_ERROR;
327 
328 // if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
329 // { /* Latitude out of range */
330 // Error_Code |= SINU_LAT_ERROR;
331 // }
332 // if ((Longitude < -M_PI) || (Longitude > TWO_PI))
333 // { /* Longitude out of range */
334 // Error_Code |= SINU_LON_ERROR;
335 // }
336  if (!Error_Code)
337  { /* no errors */
338  dlam = Longitude - Sinu_Origin_Long;
339 // if (dlam > M_PI)
340 // {
341 // dlam -= TWO_PI;
342 // }
343 // if (dlam < -M_PI)
344 // {
345 // dlam += TWO_PI;
346 // }
347  mm = sqrt(1.0 - es2 * slat * slat);
348 
349  sin2lat = SINU_COEFF_TIMES_SIN(c1, 2.0, Latitude);
350  sin4lat = SINU_COEFF_TIMES_SIN(c2, 4.0, Latitude);
351  sin6lat = SINU_COEFF_TIMES_SIN(c3, 6.0, Latitude);
352  MM = Sinu_a * (c0 * Latitude - sin2lat + sin4lat - sin6lat);
353 
354  *Easting = Sinu_a * dlam * cos(Latitude) / mm + Sinu_False_Easting;
355  *Northing = MM + Sinu_False_Northing;
356  }
357  return (Error_Code);
358 } /* END OF Convert_Geodetic_To_Sinusoidal */
#define SINU_NO_ERROR
#define SINU_COEFF_TIMES_SIN(coeff, x, latit)

◆ Convert_Sinusoidal_To_Geodetic()

long ossimSinusoidalProjection::Convert_Sinusoidal_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
private

The function Convert_Sinusoidal_To_Geodetic converts Sinusoidal projection easting and northing coordinates to geodetic (latitude and longitude) coordinates, according to the current ellipsoid and Sinusoida projection coordinates. If any errors occur, the error code(s) are returned by the function, otherwise SINU_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 361 of file ossimSinusoidalProjection.cpp.

References a0, a1, a2, a3, c0, es2, FLOAT_EQ, PI_OVER_2, Sinu_a, SINU_COEFF_TIMES_SIN, Sinu_False_Easting, Sinu_False_Northing, SINU_NO_ERROR, and Sinu_Origin_Long.

Referenced by inverse().

365 { /* BEGIN Convert_Sinusoidal_To_Geodetic */
366 /*
367  * The function Convert_Sinusoidal_To_Geodetic converts Sinusoidal projection
368  * (easting and northing) coordinates to geodetic (latitude and longitude)
369  * coordinates, according to the current ellipsoid and Sinusoidal projection
370  * coordinates. If any errors occur, the error code(s) are returned by the
371  * function, otherwise SINU_NO_ERROR is returned.
372  *
373  * Easting : Easting (X) in meters (input)
374  * Northing : Northing (Y) in meters (input)
375  * Latitude : Latitude (phi) in radians (output)
376  * Longitude : Longitude (lambda) in radians (output)
377  */
378 
379  double dx; /* Delta easting - Difference in easting (easting-FE) */
380  double dy; /* Delta northing - Difference in northing (northing-FN) */
381  double mu;
382  double sin2mu, sin4mu, sin6mu, sin8mu;
383  double sin_lat;
384  long Error_Code = SINU_NO_ERROR;
385 
386 // if ((Easting < (Sinu_False_Easting + Sinu_Min_Easting))
387 // || (Easting > (Sinu_False_Easting + Sinu_Max_Easting)))
388 // { /* Easting out of range */
389 // Error_Code |= SINU_EASTING_ERROR;
390 // }
391 // if ((Northing < (Sinu_False_Northing - Sinu_Delta_Northing))
392 // || (Northing > (Sinu_False_Northing + Sinu_Delta_Northing)))
393 // { /* Northing out of range */
394 // Error_Code |= SINU_NORTHING_ERROR;
395 // }
396  if (!Error_Code)
397  { /* no errors */
398  dy = Northing - Sinu_False_Northing;
399  dx = Easting - Sinu_False_Easting;
400 
401  mu = dy / (Sinu_a * c0);
402  sin2mu = SINU_COEFF_TIMES_SIN(a0, 2.0, mu);
403  sin4mu = SINU_COEFF_TIMES_SIN(a1, 4.0, mu);
404  sin6mu = SINU_COEFF_TIMES_SIN(a2, 6.0, mu);
405  sin8mu = SINU_COEFF_TIMES_SIN(a3, 8.0, mu);
406  *Latitude = mu + sin2mu + sin4mu + sin6mu + sin8mu;
407 
408  if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
409  *Latitude = PI_OVER_2;
410  else if (*Latitude < -PI_OVER_2)
411  *Latitude = -PI_OVER_2;
412 
413  if (FLOAT_EQ(fabs(*Latitude),PI_OVER_2,1.0e-8))
414  *Longitude = Sinu_Origin_Long;
415  else
416  {
417  sin_lat = sin(*Latitude);
418  *Longitude = Sinu_Origin_Long + dx * sqrt(1.0 - es2 *
419  sin_lat * sin_lat) / (Sinu_a * cos(*Latitude));
420 
421 
422 // if (*Longitude > M_PI)
423 // *Longitude -= TWO_PI;
424 // if (*Longitude < -M_PI)
425 // *Longitude += TWO_PI;
426 
427 // if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
428 // *Longitude = M_PI;
429 // else if (*Longitude < -M_PI)
430 // *Longitude = -M_PI;
431  }
432  }
433  return (Error_Code);
434 } /* END OF Convert_Sinusoidal_To_Geodetic */
#define FLOAT_EQ(x, v, epsilon)
#define SINU_NO_ERROR
#define PI_OVER_2
#define SINU_COEFF_TIMES_SIN(coeff, x, latit)

◆ dup()

virtual ossimObject* ossimSinusoidalProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 31 of file ossimSinusoidalProjection.h.

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

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 136 of file ossimSinusoidalProjection.cpp.

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

137 {
138  double easting = 0.0;
139  double northing = 0.0;
140  ossimGpt gpt = latLon;
141 
142  if (theDatum)
143  {
144  if (theDatum->code() != latLon.datum()->code())
145  {
146  gpt.changeDatum(theDatum); // Shift to our datum.
147  }
148  }
149 
151  gpt.lonr(),
152  &easting,
153  &northing);
154  return ossimDpt(easting, northing);
155 }
long Convert_Geodetic_To_Sinusoidal(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_Sinusoidal_Parameters()

void ossimSinusoidalProjection::Get_Sinusoidal_Parameters ( double *  a,
double *  f,
double *  Central_Meridian,
double *  False_Easting,
double *  False_Northing 
) const
private

The function Get_Sinusoidal_Parameters returns the current ellipsoid parameters and Sinusoidal projection parameters.

a : Semi-major axis of ellipsoid, in meters (output) f : Flattening of ellipsoid (output) 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 273 of file ossimSinusoidalProjection.cpp.

References Sinu_a, Sinu_f, Sinu_False_Easting, Sinu_False_Northing, and Sinu_Origin_Long.

278 { /* BEGIN Get_Sinusoidal_Parameters */
279 /*
280  * The function Get_Sinusoidal_Parameters returns the current ellipsoid
281  * parameters, and Sinusoidal projection parameters.
282  *
283  * a : Semi-major axis of ellipsoid, in meters (output)
284  * f : Flattening of ellipsoid (output)
285  * Central_Meridian : Longitude in radians at the center of (output)
286  * the projection
287  * False_Easting : A coordinate value in meters assigned to the
288  * central meridian of the projection. (output)
289  * False_Northing : A coordinate value in meters assigned to the
290  * origin latitude of the projection (output)
291  */
292 
293  *a = Sinu_a;
294  *f = Sinu_f;
295  *Central_Meridian = Sinu_Origin_Long;
296  *False_Easting = Sinu_False_Easting;
297  *False_Northing = Sinu_False_Northing;
298 
299  return;
300 } /* END OF Get_Sinusoidal_Parameters */

◆ getFalseEasting()

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

Reimplemented from ossimMapProjection.

Definition at line 61 of file ossimSinusoidalProjection.h.

◆ getFalseNorthing()

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

Reimplemented from ossimMapProjection.

Definition at line 62 of file ossimSinusoidalProjection.h.

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 124 of file ossimSinusoidalProjection.cpp.

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

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

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

164 {
165  bool flag = ossimMapProjection::loadState(kwl, prefix);
166  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
167 
168  setDefaults();
169 
171  {
174  }
175 
176  update();
177 
178  return flag;
179 }
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 ossimSinusoidalProjection::operator== ( const ossimProjection projection) const
virtual

Returns TRUE if principal parameters are within epsilon tolerance.

Reimplemented from ossimMapProjection.

Definition at line 439 of file ossimSinusoidalProjection.cpp.

References ossim::almostEqual(), and Sinu_Origin_Long.

440 {
441  if (!ossimMapProjection::operator==(proj))
442  return false;
443 
444  const ossimSinusoidalProjection* p = dynamic_cast<const ossimSinusoidalProjection*>(&proj);
445  if (!p) return false;
446 
448 
449  return true;
450 }
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53

◆ saveState()

bool ossimSinusoidalProjection::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 157 of file ossimSinusoidalProjection.cpp.

References ossimMapProjection::saveState().

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

◆ Set_Sinusoidal_Parameters()

long ossimSinusoidalProjection::Set_Sinusoidal_Parameters ( double  a,
double  f,
double  Central_Meridian,
double  False_Easting,
double  False_Northing 
)
private

The function Set_Sinusoidal_Parameters receives the ellipsoid parameters and Sinusoidal projcetion parameters as inputs, and sets the corresponding state variables. If any errors occur, the error code(s) are returned by the function, otherwise SINU_NO_ERROR is returned.

a : Semi-major axis of ellipsoid, in meters (input) f : Flattening of ellipsoid (input) 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 187 of file ossimSinusoidalProjection.cpp.

References a0, a1, a2, a3, c0, c1, c2, c3, es2, es4, es6, Sinu_a, Sinu_f, Sinu_False_Easting, Sinu_False_Northing, Sinu_Max_Easting, Sinu_Min_Easting, SINU_NO_ERROR, and Sinu_Origin_Long.

Referenced by update().

192 { /* BEGIN Set_Sinusoidal_Parameters */
193 /*
194  * The function Set_Sinusoidal_Parameters receives the ellipsoid parameters and
195  * Sinusoidal projection parameters as inputs, and sets the corresponding state
196  * variables. If any errors occur, the error code(s) are returned by the function,
197  * otherwise SINU_NO_ERROR is returned.
198  *
199  * a : Semi-major axis of ellipsoid, in meters (input)
200  * f : Flattening of ellipsoid (input)
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;
210  double One_MINUS_es2, Sqrt_One_MINUS_es2, e1, e2, e3, e4;
211 // double inv_f = 1 / f;
212  long Error_Code = SINU_NO_ERROR;
213 
214 // if (a <= 0.0)
215 // { /* Semi-major axis must be greater than zero */
216 // Error_Code |= SINU_A_ERROR;
217 // }
218 // if ((inv_f < 250) || (inv_f > 350))
219 // { /* Inverse flattening must be between 250 and 350 */
220 // Error_Code |= SINU_INV_F_ERROR;
221 // }
222 // if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
223 // { /* origin longitude out of range */
224 // Error_Code |= SINU_CENT_MER_ERROR;
225 // }
226  if (!Error_Code)
227  { /* no errors */
228  Sinu_a = a;
229  Sinu_f = f;
230  es2 = 2 * Sinu_f - Sinu_f * Sinu_f;
231  es4 = es2 * es2;
232  es6 = es4 * es2;
233  j = 45.0 * es6 / 1024.0;
234  c0 = 1.0 - es2 / 4.0 - 3.0 * es4 / 64.0 - 5.0 * es6 / 256.0;
235  c1 = 3.0 * es2 / 8.0 + 3.0 * es4 / 32.0 + j;
236  c2 = 15.0 * es4 / 256.0 + j;
237  c3 = 35.0 * es6 / 3072.0;
238  One_MINUS_es2 = 1.0 - es2;
239  Sqrt_One_MINUS_es2 = sqrt(One_MINUS_es2);
240  e1 = (1.0 - Sqrt_One_MINUS_es2) / (1.0 + Sqrt_One_MINUS_es2);
241  e2 = e1 * e1;
242  e3 = e2 * e1;
243  e4 = e3 * e1;
244  a0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0 ;
245  a1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
246  a2 = 151.0 * e3 / 96.0;
247  a3 = 1097.0 * e4 / 512.0;
248 // if (Central_Meridian > M_PI)
249 // Central_Meridian -= TWO_PI;
250  Sinu_Origin_Long = Central_Meridian;
251  Sinu_False_Northing = False_Northing;
252  Sinu_False_Easting = False_Easting;
253 
254  if (Sinu_Origin_Long > 0)
255  {
256  Sinu_Max_Easting = 19926189.0;
257  Sinu_Min_Easting = -20037509.0;
258  }
259  else if (Sinu_Origin_Long < 0)
260  {
261  Sinu_Max_Easting = 20037509.0;
262  Sinu_Min_Easting = -19926189.0;
263  }
264  else
265  {
266  Sinu_Max_Easting = 20037509.0;
267  Sinu_Min_Easting = -20037509.0;
268  }
269  } /* END OF if(!Error_Code) */
270  return (Error_Code);
271 } /* END OF Set_Sinusoidal_Parameters */
#define SINU_NO_ERROR

◆ setCentralMeridian()

void ossimSinusoidalProjection::setCentralMeridian ( double  centralMeridian)

Definition at line 109 of file ossimSinusoidalProjection.cpp.

References Sinu_Origin_Long, and update().

110 {
111  Sinu_Origin_Long = centralMeridian;
112  update();
113 }

◆ setDefaults()

void ossimSinusoidalProjection::setDefaults ( )

◆ setFalseEasting()

void ossimSinusoidalProjection::setFalseEasting ( double  falseEasting)

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

Definition at line 86 of file ossimSinusoidalProjection.cpp.

References Sinu_False_Easting, and update().

87 {
88  Sinu_False_Easting = falseEasting;
89 
90  update();
91 }

◆ setFalseEastingNorthing()

void ossimSinusoidalProjection::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 115 of file ossimSinusoidalProjection.cpp.

References Sinu_False_Easting, Sinu_False_Northing, and update().

117 {
118  Sinu_False_Easting = falseEasting;
119  Sinu_False_Northing = falseNorthing;
120 
121  update();
122 }

◆ setFalseNorthing()

void ossimSinusoidalProjection::setFalseNorthing ( double  falseNorthing)

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

Definition at line 93 of file ossimSinusoidalProjection.cpp.

References Sinu_False_Northing, and update().

94 {
95  Sinu_False_Northing = falseNorthing;
96 
97  update();
98 }

◆ update()

void ossimSinusoidalProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 72 of file ossimSinusoidalProjection.cpp.

References ossimEllipsoid::getA(), ossimEllipsoid::getFlattening(), ossimGpt::lonr(), Set_Sinusoidal_Parameters(), Sinu_False_Easting, Sinu_False_Northing, ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

Referenced by loadState(), ossimSinusoidalProjection(), setCentralMeridian(), setFalseEasting(), setFalseEastingNorthing(), and setFalseNorthing().

73 {
76  theOrigin.lonr(),
79 
82 
84 }
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
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_Sinusoidal_Parameters(double a, double f, double Central_Meridian, double False_Easting, double False_Northing)

Member Data Documentation

◆ a0

double ossimSinusoidalProjection::a0
mutableprivate

◆ a1

double ossimSinusoidalProjection::a1
mutableprivate

◆ a2

double ossimSinusoidalProjection::a2
mutableprivate

◆ a3

double ossimSinusoidalProjection::a3
mutableprivate

◆ c0

double ossimSinusoidalProjection::c0
mutableprivate

◆ c1

double ossimSinusoidalProjection::c1
mutableprivate

◆ c2

double ossimSinusoidalProjection::c2
mutableprivate

◆ c3

double ossimSinusoidalProjection::c3
mutableprivate

◆ es2

double ossimSinusoidalProjection::es2
mutableprivate

◆ es4

double ossimSinusoidalProjection::es4
mutableprivate

Definition at line 87 of file ossimSinusoidalProjection.h.

Referenced by Set_Sinusoidal_Parameters().

◆ es6

double ossimSinusoidalProjection::es6
mutableprivate

Definition at line 88 of file ossimSinusoidalProjection.h.

Referenced by Set_Sinusoidal_Parameters().

◆ Sinu_a

double ossimSinusoidalProjection::Sinu_a
mutableprivate

◆ Sinu_Delta_Northing

double ossimSinusoidalProjection::Sinu_Delta_Northing
mutableprivate

Definition at line 107 of file ossimSinusoidalProjection.h.

Referenced by ossimSinusoidalProjection(), and setDefaults().

◆ Sinu_f

double ossimSinusoidalProjection::Sinu_f
mutableprivate

◆ Sinu_False_Easting

double ossimSinusoidalProjection::Sinu_False_Easting
mutableprivate

◆ Sinu_False_Northing

double ossimSinusoidalProjection::Sinu_False_Northing
mutableprivate

◆ Sinu_Max_Easting

double ossimSinusoidalProjection::Sinu_Max_Easting
mutableprivate

◆ Sinu_Min_Easting

double ossimSinusoidalProjection::Sinu_Min_Easting
mutableprivate

◆ Sinu_Origin_Long

double ossimSinusoidalProjection::Sinu_Origin_Long
mutableprivate

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