26 # define PI_OVER_2 ( M_PI / 2.0) 29 # define TWO_PI (2.0 * M_PI) 32 #define TCEA_Q(sinlat,x) (One_MINUS_es2*(sinlat/(1.0-es2*sinlat*sinlat)-One_OVER_2es*log((1-x)/(1+x)))) 33 #define TCEA_COEFF_TIMES_SIN(coeff,x,latit) (coeff * sin(x*latit)) 34 #define TCEA_M(c0lat,c1lat,c2lat,c3lat) (Tcea_a * (c0lat - c1lat + c2lat - c3lat)) 35 #define TCEA_L(Beta,c0lat,c1lat,c2lat) (Beta + c0lat + c1lat + c2lat) 36 #define MIN_SCALE_FACTOR 0.3 37 #define MAX_SCALE_FACTOR 3.0 39 #define TCEA_NO_ERROR 0x0000 40 #define TCEA_LAT_ERROR 0x0001 41 #define TCEA_LON_ERROR 0x0002 42 #define TCEA_EASTING_ERROR 0x0004 43 #define TCEA_NORTHING_ERROR 0x0008 44 #define TCEA_ORIGIN_LAT_ERROR 0x0010 45 #define TCEA_CENT_MER_ERROR 0x0020 46 #define TCEA_A_ERROR 0x0040 47 #define TCEA_INV_F_ERROR 0x0080 48 #define TCEA_SCALE_FACTOR_ERROR 0x0100 49 #define TCEA_LON_WARNING 0x0200 109 double falseNorthing,
162 double easting = 0.0;
163 double northing = 0.0;
219 double Origin_Latitude,
220 double Central_Meridian,
221 double False_Easting,
222 double False_Northing,
247 double x, j, three_es4;
248 double Sqrt_One_MINUS_es2;
249 double e1, e2, e3, e4;
250 double lat, sin2lat, sin4lat, sin6lat;
251 double temp, temp_northing;
281 if (Central_Meridian >
M_PI)
282 Central_Meridian -=
TWO_PI;
298 a0 =
es2 / 3.0 + 31.0 *
es4 / 180.0 + 517.0 *
es6 / 5040.0;
299 a1 = 23.0 *
es4 / 360.0 + 251.0 *
es6 / 3780.0;
300 a2 = 761.0 *
es6 / 45360.0;
302 e1 = (1.0 - Sqrt_One_MINUS_es2) / (1.0 + Sqrt_One_MINUS_es2);
306 b0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0;
307 b1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
308 b2 = 151.0 * e3 / 96.0;
309 b3 = 1097.0 * e4 / 512.0;
311 j = 45.0 *
es6 / 1024.0;
312 three_es4 = 3.0 *
es4;
313 c0 = 1.0 -
es2 / 4.0 - three_es4 / 64.0 - 5.0 *
es6 / 256.0;
314 c1 = 3.0 *
es2 / 8.0 + three_es4 / 32.0 + j;
315 c2 = 15.0 *
es4 / 256.0 + j;
316 c3 = 35.0 *
es6 / 3072.0;
321 M0 =
TCEA_M(lat, sin2lat, sin4lat, sin6lat);
323 if (temp_northing > 0)
328 else if (temp_northing < 0)
339 double *Origin_Latitude,
340 double *Central_Meridian,
341 double *False_Easting,
342 double *False_Northing,
343 double *Scale_Factor)
const 379 double *Northing)
const 396 double sin_lat = sin(Latitude);
397 double qq, qq_OVER_qp;
399 double sin2betac, sin4betac, sin6betac;
401 double phi, sin2phi, sin4phi, sin6phi;
417 if (fabs(dlam) >= (
M_PI / 2.0))
439 qq_OVER_qp = qq /
qp;
443 if (qq_OVER_qp > 1.0)
445 else if (qq_OVER_qp < -1.0)
448 beta = asin(qq_OVER_qp);
449 betac = atan(tan(beta) / cos(dlam));
458 PHIc =
TCEA_L(betac, sin2betac, sin4betac, sin6betac);
462 *Easting =
Tcea_a * cos(beta) * cos(PHIc) * sin(dlam) /
470 Mc =
TCEA_M(phi, sin2phi, sin4phi, sin6phi);
481 double *Longitude)
const 502 double sin2mu, sin4mu, sin6mu, sin8mu;
506 double beta, betac, beta_prime;
507 double sin2beta, sin4beta, sin6beta;
535 PHIc = MUc + sin2mu + sin4mu + sin6mu + sin8mu;
540 Qc_OVER_qp = Qc /
qp;
542 if (Qc_OVER_qp < -1.0)
544 else if (Qc_OVER_qp > 1.0)
547 betac = asin(Qc_OVER_qp);
548 cosbetac = cos(betac);
550 es2 * sin_lat * sin_lat) / (
Tcea_a * cos(PHIc));
553 else if (temp < -1.0)
555 beta_prime = -asin(temp);
556 beta = asin(cos(beta_prime) * sin(betac));
561 *Latitude =
TCEA_L(beta, sin2beta, sin4beta, sin6beta);
588 if (!ossimMapProjection::operator==(proj))
593 if (!p)
return false;
void setFalseEastingNorthing(double falseEasting, double falseNorthing)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossimTransCylEquAreaProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(6378137, 6356752.3142), const ossimGpt &origin=ossimGpt())
void Get_Trans_Cyl_Eq_Area_Parameters(double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing, double *Scale_Factor) const
Represents serializable keyword/value map.
const char * find(const char *key) const
void setParameters(double falseEasting, double falseNorthing, double scaleFactor)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual ossimDpt forward(const ossimGpt &latLon) const
All map projections will convert the world coordinate to an easting northing (Meters).
virtual const ossimString & code() const
void setFalseNorthing(double falseNorthing)
static const char * TYPE_KW
virtual ossimGpt inverse(const ossimDpt &eastingNorthing) const
Will take a point in meters and convert it to ground.
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
#define STATIC_TYPE_NAME(T)
const ossimDatum * datum() const
datum().
double Tcea_False_Easting
#define TCEA_COEFF_TIMES_SIN(coeff, x, latit)
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
const double & getA() const
double lonr() const
Returns the longitude in radian measure.
long Convert_Geodetic_To_Trans_Cyl_Eq_Area(double Latitude, double Longitude, double *Easting, double *Northing) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
#define TCEA_M(c0lat, c1lat, c2lat, c3lat)
double Tcea_False_Northing
long Set_Trans_Cyl_Eq_Area_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing, double Scale_Factor)
#define TCEA_Q(sinlat, x)
virtual bool operator==(const ossimProjection &projection) const
Returns TRUE if principal parameters are within epsilon tolerance.
double latr() const
latr().
const double & getFlattening() const
ossimEllipsoid theEllipsoid
This method verifies that the projection parameters match the current pcs code.
static const char * SCALE_FACTOR_KW
#define RTTI_DEF1(cls, name, b1)
ossimDpt theFalseEastingNorthing
Hold the false easting northing.
long Convert_Trans_Cyl_Eq_Area_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
void setFalseEasting(double falseEasting)
#define TCEA_L(Beta, c0lat, c1lat, c2lat)
void setScaleFactor(double scaleFactor)
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.