13 #define OMERC_NO_ERROR 0x0000 14 #define OMERC_LAT_ERROR 0x0001 15 #define OMERC_LON_ERROR 0x0002 16 #define OMERC_ORIGIN_LAT_ERROR 0x0004 17 #define OMERC_LAT1_ERROR 0x0008 18 #define OMERC_LAT2_ERROR 0x0010 19 #define OMERC_LON1_ERROR 0x0020 20 #define OMERC_LON2_ERROR 0x0040 21 #define OMERC_LAT1_LAT2_ERROR 0x0080 22 #define OMERC_DIFF_HEMISPHERE_ERROR 0x0100 23 #define OMERC_EASTING_ERROR 0x0200 24 #define OMERC_NORTHING_ERROR 0x0400 25 #define OMERC_A_ERROR 0x0800 26 #define OMERC_INV_F_ERROR 0x1000 27 #define OMERC_SCALE_FACTOR_ERROR 0x2000 28 #define OMERC_LON_WARNING 0x4000 33 # define PI_OVER_2 ( M_PI / 2.0) 36 # define PI_OVER_4 ( M_PI / 4.0) 39 # define TWO_PI (2.0 * M_PI) 41 #define MIN_SCALE_FACTOR 0.3 42 #define MAX_SCALE_FACTOR 3.0 44 #define OMERC_t(lat, e_sinlat, e_over_2) (tan(PI_OVER_4 - lat / 2.0)) / \ 45 (pow((1 - e_sinlat) / (1 + e_sinlat), e_over_2)) 65 setParameters(point1, point2, falseEasting, falseNorthing, scaleFactor);
129 double falseNorthing,
179 double easting = 0.0;
180 double northing = 0.0;
247 if(point1Lat&&point1Lon&&point2Lat&&point2Lon)
272 double Origin_Latitude,
277 double False_Easting,
278 double False_Northing,
309 double es2, one_MINUS_es2;
310 double cos_olat, cos_olat2;
311 double sin_olat, sin_olat2, es2_sin_olat2;
313 double D, D2, D2_MINUS_1, sqrt_D2_MINUS_1;
381 one_MINUS_es2 = 1 - es2;
385 cos_olat2 = cos_olat * cos_olat;
387 sin_olat2 = sin_olat * sin_olat;
388 es2_sin_olat2 = es2 * sin_olat2;
390 OMerc_B = sqrt(1 + (es2 * cos_olat2 * cos_olat2) / one_MINUS_es2);
399 D = (
OMerc_B * sqrt(one_MINUS_es2)) / (cos_olat * sqrt(1.0 - es2_sin_olat2));
403 D2_MINUS_1 = D2 - 1.0;
404 sqrt_D2_MINUS_1 = sqrt(D2_MINUS_1);
405 if (D2_MINUS_1 > 1.0e-10)
417 G = (F - 1.0 / F) / 2.0;
420 J = (E2 - LH) / (E2 + LH);
421 P = (L - H) / (L + H);
457 double *Origin_Latitude,
462 double *False_Easting,
463 double *False_Northing,
464 double *Scale_Factor)
const 508 double *Northing)
const 523 double dlam, B_dlam, cos_B_dlam;
524 double t, S, T, V, U;
558 if (fabs(fabs(Latitude) -
PI_OVER_2) > 1.0e-10)
563 S = (Q - Q_inv) / 2.0;
564 T = (Q + Q_inv) / 2.0;
568 if (fabs(fabs(U) - 1.0) < 1.0e-10)
574 v =
A_over_B * log((1.0 - U) / (1.0 + U)) / 2.0;
575 cos_B_dlam = cos(B_dlam);
576 if (fabs(cos_B_dlam) < 1.0e-10)
605 double *Longitude)
const 624 double Q_prime, Q_prime_inv;
625 double S_prime, T_prime, V_prime, U_prime;
630 double temp_phi = 0.0;
651 Q_prime = exp(-1.0 * (v *
B_over_A ));
652 Q_prime_inv = 1.0 / Q_prime;
653 S_prime = (Q_prime - Q_prime_inv) / 2.0;
654 T_prime = (Q_prime + Q_prime_inv) / 2.0;
656 V_prime = sin(u_B_over_A);
658 if (fabs(fabs(U_prime) - 1.0) < 1.0e-10)
668 t = pow(
OMerc_E / sqrt((1.0 + U_prime) / (1.0 - U_prime)), 1.0 /
OMerc_B);
670 while (fabs(phi - temp_phi) > 1.0e-10)
673 es_sin =
es * sin(phi);
713 if (!ossimMapProjection::operator==(proj))
718 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.
double lond() const
Will convert the radian measure to degrees.
static const char * CENTRAL_POINT2_LON_KW
double OMerc_Delta_Easting
Represents serializable keyword/value map.
ossimGpt theCentralPoint1
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)
void clampLon(double low, double high)
virtual const ossimString & code() const
void setScaleFactor(double scaleFactor)
ossimGpt theCentralPoint2
void setFalseEasting(double falseEasting)
double latd() const
Will convert the radian measure to degrees.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
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().
ossimObliqueMercatorProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimDpt forward(const ossimGpt &latLon) const
All map projections will convert the world coordinate to an easting northing (Meters).
#define OMERC_t(lat, e_sinlat, e_over_2)
const double & getA() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
double lonr() const
Returns the longitude in radian measure.
double OMerc_Delta_Northing
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
void clampLat(double low, double high)
long Convert_Geodetic_To_Oblique_Mercator(double Latitude, double Longitude, double *Easting, double *Northing) const
virtual bool operator==(const ossimProjection &projection) const
Returns TRUE if principal parameters are within epsilon tolerance.
double OMerc_Scale_Factor
static const char * CENTRAL_POINT2_LAT_KW
void Get_Oblique_Mercator_Parameters(double *a, double *f, double *Origin_Latitude, double *Latitude_1, double *Longitude_1, double *Latitude_2, double *Longitude_2, double *False_Easting, double *False_Northing, double *Scale_Factor) const
long Set_Oblique_Mercator_Parameters(double a, double f, double Origin_Latitude, double Latitude_1, double Longitude_1, double Latitude_2, double Longitude_2, double False_Easting, double False_Northing, double Scale_Factor)
static const char * CENTRAL_POINT1_LON_KW
double latr() const
latr().
double OMerc_False_Northing
void setFalseNorthing(double falseNorthing)
const double & getFlattening() const
void setFalseEastingNorthing(double falseEasting, double falseNorthing)
double OMerc_False_Easting
void setCentralPoint2(const ossimGpt &point)
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.
static const char * CENTRAL_POINT1_LAT_KW
void setCentralPoint1(const ossimGpt &point)
long Convert_Oblique_Mercator_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
void setParameters(const ossimGpt &point1, const ossimGpt &point2, double falseEasting, double falseNorthing, double scaleFactor)
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.