23 #define TRANMERC_NO_ERROR 0x0000 24 #define TRANMERC_LAT_ERROR 0x0001 25 #define TRANMERC_LON_ERROR 0x0002 26 #define TRANMERC_EASTING_ERROR 0x0004 27 #define TRANMERC_NORTHING_ERROR 0x0008 28 #define TRANMERC_ORIGIN_LAT_ERROR 0x0010 29 #define TRANMERC_CENT_MER_ERROR 0x0020 30 #define TRANMERC_A_ERROR 0x0040 31 #define TRANMERC_B_ERROR 0x0080 32 #define TRANMERC_A_LESS_B_ERROR 0x0100 33 #define TRANMERC_SCALE_FACTOR_ERROR 0x0200 34 #define TRANMERC_LON_WARNING 0x0400 36 #define MAX_LAT ((M_PI * 90.0)/180.0) 37 #define MAX_DELTA_LONG ((M_PI * 90.0)/180.0) 38 #define MIN_SCALE_FACTOR 0.3 39 #define MAX_SCALE_FACTOR 3.0 41 #define SPHTMD(Latitude) ((double) (TranMerc_ap * Latitude \ 42 - TranMerc_bp * sin(2.e0 * Latitude) + TranMerc_cp * sin(4.e0 * Latitude) \ 43 - TranMerc_dp * sin(6.e0 * Latitude) + TranMerc_ep * sin(8.e0 * Latitude) ) ) 45 #define SPHSN(Latitude) ((double) (getA() / sqrt( 1.e0 - TranMerc_es * \ 46 pow(sin(Latitude), 2)))) 48 #define SPHSR(Latitude) ((double) (getA() * (1.e0 - TranMerc_es) / \ 49 pow(DENOM(Latitude), 3))) 51 #define DENOM(Latitude) ((double) (sqrt(1.e0 - TranMerc_es * pow(sin(Latitude),2)))) 57 TranMerc_a(6378137.0),
58 TranMerc_f(1.0/298.257223563),
59 TranMerc_es(0.0066943799901413800),
60 TranMerc_ebs(0.0067394967565869),
61 TranMerc_Origin_Lat(origin.latr()),
62 TranMerc_Origin_Long(origin.lonr()),
63 TranMerc_False_Northing(0.0),
64 TranMerc_False_Easting(0.0),
65 TranMerc_Scale_Factor(1.0),
66 TranMerc_ap(6367449.1458008),
67 TranMerc_bp(16038.508696861),
68 TranMerc_cp(16.832613334334),
69 TranMerc_dp(0.021984404273757),
70 TranMerc_Delta_Easting(40000000.0),
71 TranMerc_Delta_Northing(40000000.0)
83 TranMerc_a(6378137.0),
84 TranMerc_f(1.0/298.257223563),
85 TranMerc_es(0.0066943799901413800),
86 TranMerc_ebs(0.0067394967565869),
87 TranMerc_Origin_Lat(origin.latr()),
88 TranMerc_Origin_Long(origin.lonr()),
89 TranMerc_False_Northing(falseNorthing),
90 TranMerc_False_Easting(falseEasting),
91 TranMerc_Scale_Factor(scaleFactor),
92 TranMerc_ap(6367449.1458008),
93 TranMerc_bp(16038.508696861),
94 TranMerc_cp(16.832613334334),
95 TranMerc_dp(0.021984404273757),
96 TranMerc_Delta_Easting(40000000.0),
97 TranMerc_Delta_Northing(40000000.0)
134 double falseNorthing)
150 double falseNorthing,
184 double easting = 0.0;
185 double northing = 0.0;
250 double Origin_Latitude,
251 double Central_Meridian,
252 double False_Easting,
253 double False_Northing,
280 double dummy_northing;
329 + 81.e0 * (tn4 - tn5)/64.e0 );
331 /8.e0 + 55.e0 * tn5/64.e0 )/2.e0;
344 if (Central_Meridian >
M_PI)
345 Central_Meridian -=
TWO_PI;
357 double *Origin_Latitude,
358 double *Central_Meridian,
359 double *False_Easting,
360 double *False_Northing,
361 double *Scale_Factor)
const 395 double *Northing)
const 450 if (Longitude >
M_PI)
484 if (fabs(dlam) < 2.e-10)
505 sn =
SPHSN(Latitude);
517 + 4.e0 * eta2) /24.e0;
520 + tan4 + 270.e0 * eta - 330.e0 * tan2 * eta + 445.e0 * eta2
521 + 324.e0 * eta3 -680.e0 * tan2 * eta2 + 88.e0 * eta4
522 -600.e0 * tan2 * eta3 - 192.e0 * tan2 * eta4) / 720.e0;
525 tan2 + 543.e0 * tan4 - tan6) / 40320.e0;
528 + pow(dlam,4.e0) * t3 + pow(dlam,6.e0) * t4
529 + pow(dlam,8.e0) * t5;
535 + 14.e0 * eta - 58.e0 * tan2 * eta + 13.e0 * eta2 + 4.e0 * eta3
536 - 64.e0 * tan2 * eta2 - 24.e0 * tan2 * eta3 )/ 120.e0;
538 + 179.e0 * tan4 - tan6 ) /5040.e0;
541 + pow(dlam,5.e0) * t8 + pow(dlam,7.e0) * t9;
550 double *Longitude)
const 617 for (i = 0; i < 5 ; i++)
621 ftphi = ftphi + (tmd - t10) / sr;
643 if (fabs(de) < 0.0001)
648 t11 = t * (5.e0 + 3.e0 * tan2 + eta - 4.e0 * pow(eta,2)
649 - 9.e0 * tan2 * eta) / (24.e0 * sr * pow(sn,3)
651 t12 = t * (61.e0 + 90.e0 * tan2 + 46.e0 * eta + 45.E0 * tan4
652 - 252.e0 * tan2 * eta - 3.e0 * eta2 + 100.e0
653 * eta3 - 66.e0 * tan2 * eta2 - 90.e0 * tan4
654 * eta + 88.e0 * eta4 + 225.e0 * tan4 * eta2
655 + 84.e0 * tan2* eta3 - 192.e0 * tan2 * eta4)
657 t13 = t * ( 1385.e0 + 3633.e0 * tan2 + 4095.e0 * tan4 + 1575.e0
659 *Latitude = ftphi - pow(de,2) * t10 + pow(de,4) * t11 - pow(de,6) * t12
664 t15 = (1.e0 + 2.e0 * tan2 + eta) / (6.e0 * pow(sn,3) * c *
667 t16 = (5.e0 + 6.e0 * eta + 28.e0 * tan2 - 3.e0 * eta2
668 + 8.e0 * tan2 * eta + 24.e0 * tan4 - 4.e0
669 * eta3 + 4.e0 * tan2 * eta2 + 24.e0
670 * tan2 * eta3) / (120.e0 * pow(sn,5) * c
673 t17 = (61.e0 + 662.e0 * tan2 + 1320.e0 * tan4 + 720.e0
674 * pow(t,6)) / (5040.e0 * pow(sn,7) * c
678 dlam = de * t14 - pow(de,3) * t15 + pow(de,5) * t16 - pow(de,7) * t17;
684 *Latitude =
M_PI - *Latitude;
686 if (*Longitude >
M_PI)
692 *Latitude = - (*Latitude +
M_PI);
694 if (*Longitude >
M_PI)
699 if (*Longitude < -
M_PI)
712 out << setiosflags(ios::fixed) << setprecision(15)
713 <<
"// ossimTransMercatorProjection::print\n" 724 if (!ossimMapProjection::operator==(proj))
729 if (!p)
return false;
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
void Get_Transverse_Mercator_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.
double TranMerc_Delta_Easting
double TranMerc_False_Easting
const char * find(const char *key) const
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
void setScaleFactor(double scaleFactor)
virtual const ossimString & code() const
double TranMerc_Delta_Northing
void setFalseEastingNorthing(double falseEasting, double falseNorthing)
double TranMerc_Origin_Long
ossimTransMercatorProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(6378137, 6356752.3142), const ossimGpt &origin=ossimGpt())
void setFalseEasting(double falseEasting)
static const char * TYPE_KW
double TranMerc_False_Northing
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
#define STATIC_TYPE_NAME(T)
const ossimDatum * datum() const
datum().
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
long Convert_Transverse_Mercator_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
const double & getA() const
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.
void setFalseNorthing(double falseNorthing)
virtual std::ostream & print(std::ostream &out) const
#define TRANMERC_NO_ERROR
virtual bool operator==(const ossimProjection &projection) const
Returns TRUE if principal parameters are within epsilon tolerance.
double TranMerc_Scale_Factor
double latr() const
latr().
long Convert_Geodetic_To_Transverse_Mercator(double Latitude, double Longitude, double *Easting, double *Northing) const
const double & getFlattening() const
void setParameters(double falseEasting, double falseNorthing, double scaleFactor)
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 Set_Transverse_Mercator_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing, double Scale_Factor)
virtual ossimGpt inverse(const ossimDpt &eastingNorthing) const
Will take a point in meters and convert it to ground.
double TranMerc_Origin_Lat
virtual std::ostream & print(std::ostream &out) const
Prints data members to stream.
virtual ossimDpt forward(const ossimGpt &latLon) const
All map projections will convert the world coordinate to an easting northing (Meters).
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
std::basic_ostream< char > ostream
Base class for char output streams.
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.