24 #define PI 3.14159265358979323e0 25 #define PI_OVER_2 ( PI / 2.0e0) 27 #define MAX_LAT ( (PI * 89.99) / 180.0 ) 29 #define MERC_NO_ERROR 0x0000 30 #define MERC_LAT_ERROR 0x0001 31 #define MERC_LON_ERROR 0x0002 32 #define MERC_EASTING_ERROR 0x0004 33 #define MERC_NORTHING_ERROR 0x0008 34 #define MERC_ORIGIN_LAT_ERROR 0x0010 35 #define MERC_CENT_MER_ERROR 0x0020 36 #define MERC_A_ERROR 0x0040 37 #define MERC_B_ERROR 0x0080 38 #define MERC_A_LESS_B_ERROR 0x0100 107 double falseNorthing,
133 double shift =
M_PI * 6378137.0;
134 lon = (eastingNorthing.
x / shift) * 180.0;
135 lat = (eastingNorthing.
y / shift) * 180.0;
137 lat = 180 /
M_PI * (2 * atan( exp( lat *
M_PI / 180.0)) -
M_PI / 2.0);
156 double easting = 0.0;
157 double northing = 0.0;
169 double lat = latLon.
latd();
170 double lon = latLon.
lond();
172 easting = lon * shift / 180.0;
173 northing = log( tan((90 + lat) *
M_PI / 360.0 )) / (
M_PI / 180.0);
175 northing = northing * shift / 180.0;
176 result =
ossimDpt(easting, northing);
190 result =
ossimDpt(easting, northing);
243 double Origin_Latitude,
244 double Central_Meridian,
245 double False_Easting,
246 double False_Northing,
247 double *Scale_Factor)
308 sin_olat = sin(Origin_Latitude);
310 / cos(Origin_Latitude) );
315 + 13.e0 * es4 / 360.e0;
316 Merc_bb = 7.e0 * es2 / 48.e0 + 29.e0 * es3 / 240.e0
317 + 811.e0 * es4 / 11520.e0;
318 Merc_cb = 7.e0 * es3 / 120.e0 + 81.e0 * es4 / 1120.e0;
319 Merc_db = 4279.e0 * es4 / 161280.e0;
336 double *Origin_Latitude,
337 double *Central_Meridian,
338 double *False_Easting,
339 double *False_Northing,
340 double *Scale_Factor)
const 376 double *Northing)
const 411 e_x_sinlat =
Merc_e * sin(Latitude);
412 tan_temp = tan(
PI / 4.e0 + Latitude / 2.e0);
413 pow_temp = pow( ((1.e0 - e_x_sinlat) / (1.e0 + e_x_sinlat)),
415 ctanz2 = tan_temp * pow_temp;
433 double *Longitude)
const 456 *Latitude =
M_PI*.5 - 2.0 * atan(exp(-Easting /
Merc_a));
457 *Longitude = Easting/
Merc_a;
479 *Latitude = xphi +
Merc_ab * sin(2.e0 * xphi) +
Merc_bb * sin(4.e0 * xphi)
494 if (!ossimMapProjection::operator==(proj))
498 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 Merc_False_Northing
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
double lond() const
Will convert the radian measure to degrees.
Represents serializable keyword/value map.
const char * find(const char *key) const
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
virtual const ossimString & code() const
double latd() const
Will convert the radian measure to degrees.
void Get_Mercator_Parameters(double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing, double *Scale_Factor) const
void setParameters(double falseEasting, double falseNorthing, double scaleFactor)
static const char * TYPE_KW
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
virtual bool operator==(const ossimProjection &projection) const
Returns TRUE if principal parameters are within epsilon tolerance.
long Set_Mercator_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing, double *Scale_Factor)
#define STATIC_TYPE_NAME(T)
const ossimDatum * datum() const
datum().
double radiansToDegrees(double x)
virtual ossimDpt forward(const ossimGpt &latLon) const
All map projections will convert the world coordinate to an easting northing (Meters).
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
void setScaleFactor(double scaleFactor)
double Merc_Delta_Northing
long Convert_Geodetic_To_Mercator(double Latitude, double Longitude, double *Easting, double *Northing) 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.
double Merc_Delta_Easting
double Merc_False_Easting
void setFalseEastingNorthing(double falseEasting, double falseNorthing)
double latr() const
latr().
void setFalseNorthing(double falseNorthing)
void setFalseEasting(double falseEasting)
const double & getFlattening() const
ossimEllipsoid theEllipsoid
This method verifies that the projection parameters match the current pcs code.
long Convert_Mercator_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
static const char * SCALE_FACTOR_KW
#define RTTI_DEF1(cls, name, b1)
ossimDpt theFalseEastingNorthing
Hold the false easting northing.
virtual ossimGpt inverse(const ossimDpt &eastingNorthing) const
Will take a point in meters and convert it to ground.
ossimMercatorProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.