24 # define PI_OVER_2 ( M_PI / 2.0) 27 # define TWO_PI (2.0 * M_PI) 29 #define POLY_COEFF_TIMES_SIN(coeff, x, latit) (coeff * (sin (x * latit))) 30 #define POLY_M(c0lat,c1s2lat,c2s4lat,c3s6lat) (Poly_a*(c0lat - c1s2lat + c2s4lat - c3s6lat)) 31 #define FLOAT_EQ(x,v,epsilon) (((v - epsilon) < x) && (x < (v + epsilon))) 32 #define FOURTY_ONE (41.0 * M_PI / 180.0) 34 #define POLY_NO_ERROR 0x0000 35 #define POLY_LAT_ERROR 0x0001 36 #define POLY_LON_ERROR 0x0002 37 #define POLY_EASTING_ERROR 0x0004 38 #define POLY_NORTHING_ERROR 0x0008 39 #define POLY_ORIGIN_LAT_ERROR 0x0010 40 #define POLY_CENT_MER_ERROR 0x0020 41 #define POLY_A_ERROR 0x0040 42 #define POLY_B_ERROR 0x0080 43 #define POLY_A_LESS_B_ERROR 0x0100 44 #define POLY_LON_WARNING 0x0200 110 double falseNorthing)
133 double easting = 0.0;
134 double northing = 0.0;
185 double Origin_Latitude,
186 double Central_Meridian,
187 double False_Easting,
188 double False_Northing)
210 double lat, sin2lat, sin4lat, sin6lat;
245 j = 45.0 *
es6 / 1024.0;
246 three_es4 = 3.0 *
es4;
247 c0 = 1.0 -
es2 / 4.0 - three_es4 / 64.0 - 5.0 *
es6 / 256.0;
248 c1 = 3.0 *
es2 / 8.0 + three_es4 / 32.0 + j;
249 c2 = 15.0 *
es4 / 256.0 + j;
250 c3 = 35.0 *
es6 / 3072.0;
256 M0 =
POLY_M(lat, sin2lat, sin4lat, sin6lat);
286 double *Origin_Latitude,
287 double *Central_Meridian,
288 double *False_Easting,
289 double *False_Northing)
const 322 double *Northing)
const 337 double slat = sin(Latitude);
338 double lat, sin2lat, sin4lat, sin6lat;
357 if (fabs(dlam) > (
M_PI / 2.0))
376 NN =
Poly_a / sqrt(1.0 -
es2 * (slat * slat));
377 NN_OVER_tlat = NN / tan(Latitude);
382 MM =
POLY_M(lat, sin2lat, sin4lat, sin6lat);
385 *Northing = MM -
M0 + NN_OVER_tlat * (1.0 - cos(EE)) +
396 double *Longitude)
const 413 double dx_OVER_Poly_a;
417 double PHIn, Delta_PHI = 1.0;
419 double PHI, sin2PHI,sin4PHI, sin6PHI;
420 double Mn, Mn_prime, Ma;
424 double tolerance = 1.0e-12;
442 dx_OVER_Poly_a = dx /
Poly_a;
451 BB = dx_OVER_Poly_a * dx_OVER_Poly_a + (AA * AA);
454 while (fabs(Delta_PHI) > tolerance)
456 sin_PHIn = sin(PHIn);
457 CC = sqrt(1.0 -
es2 * sin_PHIn * sin_PHIn) * tan(PHIn);
462 Mn =
POLY_M(PHI, sin2PHI, sin4PHI, sin6PHI);
463 Mn_prime =
c0 - 2.0 *
c1 * cos(2.0 * PHIn) + 4.0 *
c2 * cos(4.0 * PHIn) -
464 6.0 *
c3 * cos(6.0 * PHIn);
467 Ma2_PLUS_BB = Ma * Ma + BB;
468 AA_MINUS_Ma = AA - Ma;
469 Delta_PHI = (AA_Ma * CC + AA_MINUS_Ma - 0.5 * (Ma2_PLUS_BB) * CC) /
470 (
es2 * sin2PHI * (Ma2_PLUS_BB - 2.0 * AA_Ma) /
471 4.0 * CC + (AA_MINUS_Ma) * (CC * Mn_prime - 2.0 / sin2PHI) - Mn_prime);
486 *Longitude = (asin(dx_OVER_Poly_a * CC)) / sin(*Latitude) +
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
long Set_Polyconic_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
virtual ossimDpt forward(const ossimGpt &latLon) const
All map projections will convert the world coordinate to an easting northing (Meters).
Represents serializable keyword/value map.
ossimPolyconicProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
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.
virtual const ossimString & code() const
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().
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
void setFalseNorthing(double falseNorthing)
const double & getA() const
double lonr() const
Returns the longitude in radian measure.
double Poly_False_Easting
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
void setFalseEastingNorthing(double falseEasting, double falseNorthing)
void setFalseEasting(double falseEasting)
long Convert_Polyconic_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
double Poly_False_Northing
double latr() const
latr().
const double & getFlattening() const
ossimEllipsoid theEllipsoid
This method verifies that the projection parameters match the current pcs code.
#define RTTI_DEF1(cls, name, b1)
ossimDpt theFalseEastingNorthing
Hold the false easting northing.
#define POLY_COEFF_TIMES_SIN(coeff, x, latit)
#define FLOAT_EQ(x, v, epsilon)
long Convert_Geodetic_To_Polyconic(double Latitude, double Longitude, double *Easting, double *Northing) const
void Get_Polyconic_Parameters(double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing) const
#define POLY_M(c0lat, c1s2lat, c2s4lat, c3s6lat)
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.