24 # define PI_OVER_2 ( M_PI / 2.0) 27 # define TWO_PI (2.0 * M_PI) 30 #define MAX_LAT ( 90.0 * (M_PI / 180.0) ) 31 #define FLOAT_EQ(x,v,epsilon) (((v - epsilon) < x) && (x < (v + epsilon))) 33 #define GRIN_NO_ERROR 0x0000 34 #define GRIN_LAT_ERROR 0x0001 35 #define GRIN_LON_ERROR 0x0002 36 #define GRIN_EASTING_ERROR 0x0004 37 #define GRIN_NORTHING_ERROR 0x0008 38 #define GRIN_CENT_MER_ERROR 0x0020 39 #define GRIN_A_ERROR 0x0040 40 #define GRIN_B_ERROR 0x0080 41 #define GRIN_A_LESS_B_ERROR 0x0100 42 #define GRIN_RADIUS_ERROR 0x0200 115 double falseNorthing)
138 double easting = 0.0;
139 double northing = 0.0;
190 double Central_Meridian,
191 double False_Easting,
192 double False_Northing)
249 double *Central_Meridian,
250 double *False_Easting,
251 double *False_Northing)
const 281 double *Northing)
const 301 double gg_MINUS_ppsqr, ppsqr_PLUS_aasqr;
304 double sin_theta, cos_theta;
341 else if (in_theta < -1.0)
344 theta = asin(in_theta);
352 aa = 0.5 * fabs(
M_PI / dlam - dlam /
M_PI);
357 else if (in_theta < -1.0)
360 theta = asin(in_theta);
361 sin_theta = sin(theta);
362 cos_theta = cos(theta);
363 gg = cos_theta / (sin_theta + cos_theta - 1);
364 pp = gg * (2 / sin_theta - 1);
367 gg_MINUS_ppsqr = gg - ppsqr;
368 ppsqr_PLUS_aasqr = ppsqr + aasqr;
370 *Easting =
PI_Ra * (aa * (gg_MINUS_ppsqr) +
371 sqrt(aasqr * (gg_MINUS_ppsqr) * (gg_MINUS_ppsqr) -
372 (ppsqr_PLUS_aasqr) * (gg * gg - ppsqr))) /
376 *Northing =
PI_Ra * (pp * qq - aa * sqrt ((aasqr + 1) * (ppsqr_PLUS_aasqr) - qq * qq)) /
390 double *Longitude)
const 407 double yy, yysqr, two_yysqr;
408 double xxsqr_PLUS_yysqr;
454 xxsqr_PLUS_yysqr = xxsqr + yysqr;
455 two_yysqr = 2 * yysqr;
462 c1 = - fabs(yy) * (1 + xxsqr_PLUS_yysqr);
463 c2 = c1 - two_yysqr + xxsqr;
464 c3 = - 2 * c1 + 1 + two_yysqr + (xxsqr_PLUS_yysqr) * (xxsqr_PLUS_yysqr);
465 c2_OVER_3c3 = c2 / (3.0 * c3);
467 dd = yysqr / c3 + ((2 * c2 * c2 * c2) / (c3sqr * c3) - (9 * c1 * c2) / (c3sqr)) / 27;
468 a1 = (c1 - c2 * c2_OVER_3c3) /c3;
470 i = 3 * dd/ (a1 * m1);
471 if ((i > 1.0)||(i < -1.0))
475 theta1 =
ONE_THIRD * acos(3 * dd / (a1 * m1));
476 *Latitude =
M_PI * (-m1 * cos(theta1 +
PI_OVER_3) - c2_OVER_3c3);
486 *Longitude =
M_PI * (xxsqr_PLUS_yysqr - 1 +
487 sqrt(1 + (2 * xxsqr - two_yysqr) + (xxsqr_PLUS_yysqr) * (xxsqr_PLUS_yysqr))) /
515 if (!ossimMapProjection::operator==(proj))
520 if (!p)
return false;
virtual ossimDpt forward(const ossimGpt &latLon) const
All map projections will convert the world coordinate to an easting northing (Meters).
double Grin_False_Northing
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
Represents serializable keyword/value map.
void Get_Van_der_Grinten_Parameters(double *a, double *f, double *Central_Meridian, double *False_Easting, double *False_Northing) const
const char * find(const char *key) const
virtual ossimGpt inverse(const ossimDpt &eastingNorthing) const
Will take a point in meters and convert it to ground.
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
virtual const ossimString & code() const
double Grin_False_Easting
static const char * TYPE_KW
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
#define STATIC_TYPE_NAME(T)
const ossimDatum * datum() const
datum().
void setFalseNorthing(double falseNorthing)
void setCentralMeridian(double centralMeridian)
const double & getA() const
void setFalseEastingNorthing(double falseEasting, double falseNorthing)
double lonr() const
Returns the longitude in radian measure.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
long Convert_Geodetic_To_Van_der_Grinten(double Latitude, double Longitude, double *Easting, double *Northing) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
double latr() const
latr().
ossimVanDerGrintenProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
const double & getFlattening() const
long Convert_Van_der_Grinten_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
ossimEllipsoid theEllipsoid
This method verifies that the projection parameters match the current pcs code.
void setFalseEasting(double falseEasting)
#define RTTI_DEF1(cls, name, b1)
ossimDpt theFalseEastingNorthing
Hold the false easting northing.
#define FLOAT_EQ(x, v, epsilon)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
long Set_Van_der_Grinten_Parameters(double a, double f, double Central_Meridian, double False_Easting, double False_Northing)
virtual bool operator==(const ossimProjection &projection) const
Returns TRUE if principal parameters are within epsilon tolerance.
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.