24 #define ALBERS_NO_ERROR 0x0000 25 #define ALBERS_LAT_ERROR 0x0001 26 #define ALBERS_LON_ERROR 0x0002 27 #define ALBERS_EASTING_ERROR 0x0004 28 #define ALBERS_NORTHING_ERROR 0x0008 29 #define ALBERS_ORIGIN_LAT_ERROR 0x0010 30 #define ALBERS_CENT_MER_ERROR 0x0020 31 #define ALBERS_A_ERROR 0x0040 32 #define ALBERS_INV_F_ERROR 0x0080 33 #define ALBERS_FIRST_STDP_ERROR 0x0100 34 #define ALBERS_SECOND_STDP_ERROR 0x0200 35 #define ALBERS_FIRST_SECOND_ERROR 0x0400 36 #define ALBERS_HEMISPHERE_ERROR 0x0800 38 #define PI_OVER_2 ( M_PI / 2.0) 39 #define ES_SIN(sinlat) (es * sinlat) 40 #define ONE_MINUS_SQR(x) (1.0 - x * x) 41 #define ALBERS_M(clat,oneminussqressin) (clat / sqrt(oneminussqressin)) 42 #define ALBERS_Q(slat,oneminussqressin,essin) (one_MINUS_es2)*(slat / (oneminussqressin)- \ 43 (1 / (two_es)) *log((1 - essin) / (1 + essin))) 117 double easting = 0.0;
118 double northing = 0.0;
151 double parallel2Degree)
172 double falseNorthing)
182 double falseNorthing)
271 double Origin_Latitude,
272 double Central_Meridian,
273 double Std_Parallel_1,
274 double Std_Parallel_2,
275 double False_Easting,
276 double False_Northing)
299 double sin_lat, sin_lat_1, cos_lat;
300 double m1, m2, SQRm1;
302 double es_sin, one_MINUS_SQRes_sin;
304 double inv_f = 1 / f;
311 if ((inv_f < 250) || (inv_f > 350))
319 if ((Central_Meridian < -
M_PI) || (Central_Meridian >
TWO_PI))
331 if ((Std_Parallel_1 == 0.0) && (Std_Parallel_2 == 0.0))
335 if (Std_Parallel_1 == -Std_Parallel_2)
347 if (Central_Meridian >
M_PI)
348 Central_Meridian -=
TWO_PI;
361 q0 =
ALBERS_Q(sin_lat, one_MINUS_SQRes_sin, es_sin);
365 es_sin =
ES_SIN(sin_lat_1);
367 m1 =
ALBERS_M(cos_lat, one_MINUS_SQRes_sin);
368 q1 =
ALBERS_Q(sin_lat_1, one_MINUS_SQRes_sin, es_sin);
377 m2 =
ALBERS_M(cos_lat, one_MINUS_SQRes_sin);
378 q2 =
ALBERS_Q(sin_lat, one_MINUS_SQRes_sin, es_sin);
379 n = (SQRm1 - m2 * m2) / (q2 - q1);
400 double *Origin_Latitude,
401 double *Central_Meridian,
402 double *Std_Parallel_1,
403 double *Std_Parallel_2,
404 double *False_Easting,
405 double *False_Northing)
const 441 double *Northing)
const 460 double es_sin, one_MINUS_SQRes_sin;
471 if ((Longitude < -
M_PI) || (Longitude >
TWO_PI))
488 sin_lat = sin(Latitude);
492 q =
ALBERS_Q(sin_lat, one_MINUS_SQRes_sin, es_sin);
511 double *Longitude)
const 527 double rho0_MINUS_dy;
528 double q, qconst, q_OVER_2;
530 double PHI, Delta_PHI = 1.0;
532 double es_sin, one_MINUS_SQRes_sin;
534 double tolerance = 4.85e-10;
553 rho0_MINUS_dy =
rho0 - dy;
554 rho = sqrt(dx * dx + rho0_MINUS_dy * rho0_MINUS_dy);
561 rho0_MINUS_dy *= -1.0;
565 theta = atan2(dx, rho0_MINUS_dy);
569 if (fabs(fabs(qconst) - fabs(q)) > 1.0e-6)
574 else if (q_OVER_2 < -1.0)
578 PHI = asin(q_OVER_2);
583 while (fabs(Delta_PHI) > tolerance)
588 Delta_PHI = (one_MINUS_SQRes_sin * one_MINUS_SQRes_sin) / (2.0 * cos(PHI)) *
590 (log((1.0 - es_sin) / (1.0 + es_sin)) / (
two_es)));
612 if (*Longitude >
M_PI)
614 if (*Longitude < -
M_PI)
617 if (*Longitude >
M_PI)
619 else if (*Longitude < -
M_PI)
631 if (!ossimMapProjection::operator==(proj))
return false;
634 if (!p)
return false;
double Albers_False_Northing
long Convert_Albers_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
virtual double getStandardParallel1() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
#define ALBERS_M(clat, oneminussqressin)
long Convert_Geodetic_To_Albers(double Latitude, double Longitude, double *Easting, double *Northing) const
#define ALBERS_NORTHING_ERROR
#define ALBERS_INV_F_ERROR
double Albers_Origin_Long
Represents serializable keyword/value map.
virtual ossimGpt inverse(const ossimDpt &projectedPoint) const
Will take a point in meters and convert it to ground.
const char * find(const char *key) const
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
virtual double getStandardParallel2() const
void setStandardParallels(double parallel1Degree, double prallel2Degree)
virtual const ossimString & code() const
ossimAlbersProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
#define ALBERS_FIRST_STDP_ERROR
virtual bool operator==(const ossimProjection &projection) const
Returns TRUE if principal parameters are within epsilon tolerance.
double Albers_Std_Parallel_2
static const char * TYPE_KW
#define ALBERS_HEMISPHERE_ERROR
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
void setStandardParallel1(double degree)
#define STATIC_TYPE_NAME(T)
const ossimDatum * datum() const
datum().
#define ALBERS_EASTING_ERROR
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
#define ALBERS_ORIGIN_LAT_ERROR
Albers Equal Area Conic Projection.
virtual ~ossimAlbersProjection()
ossimObject * dup() const
void setFalseNorthing(double falseNorthing)
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.
static const char * STD_PARALLEL_1_KW
virtual ossimDpt forward(const ossimGpt &worldPoint) const
All map projections will convert the world coordinate to an easting northing (Meters).
double Albers_Delta_Easting
#define ALBERS_CENT_MER_ERROR
void setFalseEastingNorthing(double falseEasting, double falseNorthing)
long Set_Albers_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double Std_Parallel_1, double Std_Parallel_2, double False_Easting, double False_Northing)
void setFalseEasting(double falseEasting)
void setParameters(double parallel1, double parallel2, double falseEasting, double falseNorthing)
void setStandardParallel2(double degree)
double Albers_Std_Parallel_1
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
double Albers_False_Easting
void Get_Albers_Parameters(double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *Std_Parallel_1, double *Std_Parallel_2, double *False_Easting, double *False_Northing) const
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.
static const char * STD_PARALLEL_2_KW
#define ALBERS_FIRST_SECOND_ERROR
#define ALBERS_SECOND_STDP_ERROR
#define ALBERS_Q(slat, oneminussqressin, essin)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
double Albers_Delta_Northing
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.