31 #define CASS_NO_ERROR 0x0000 32 #define CASS_LAT_ERROR 0x0001 33 #define CASS_LON_ERROR 0x0002 34 #define CASS_EASTING_ERROR 0x0004 35 #define CASS_NORTHING_ERROR 0x0008 36 #define CASS_ORIGIN_LAT_ERROR 0x0010 37 #define CASS_CENT_MER_ERROR 0x0020 38 #define CASS_A_ERROR 0x0040 39 #define CASS_B_ERROR 0x0080 40 #define CASS_A_LESS_B_ERROR 0x0100 41 #define CASS_LON_WARNING 0x0200 43 #define PI_OVER_2 ( M_PI / 2.0) 44 #define CASS_M(c0lat, c1s2lat, c2s4lat, c3s6lat) (Cass_a*(c0lat-c1s2lat+c2s4lat-c3s6lat)) 45 #define CASS_RD(sinlat) (sqrt(1.0 - es2 * (sinlat * sinlat))) 46 #define CASS_COEFF_TIMES_SIN(coeff, x, latit) (coeff * (sin (x * latit))) 47 #define FLOAT_EQ(x,v,epsilon) (((v - epsilon) < x) && (x < (v + epsilon))) 48 #define THIRTY_ONE (31.0 * M_PI / 180.0) 62 const double falseEasting,
63 const double falseNorthing)
105 double falseNorthing)
138 double easting = 0.0;
139 double northing = 0.0;
192 double Origin_Latitude,
193 double Central_Meridian,
194 double False_Easting,
195 double False_Northing)
216 double x, e1, e2, e3, e4;
217 double lat, sin2lat, sin4lat, sin6lat;
251 j = 45.0 *
es6 / 1024.0;
252 three_es4 = 3.0 *
es4;
253 c0 = 1 -
es2 / 4.0 - three_es4 / 64.0 - 5.0 *
es6 / 256.0;
254 c1 = 3.0 *
es2 /8.0 + three_es4 / 32.0 + j;
255 c2 = 15.0 *
es4 / 256.0 + j;
256 c3 = 35.0 *
es6 / 3072.0;
261 M0 =
CASS_M(lat, sin2lat, sin4lat, sin6lat);
265 e1 = (1 -
x) / (1 +
x);
269 a0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0;
270 a1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
271 a2 = 151.0 * e3 / 96.0;
272 a3 = 1097.0 * e4 /512.0;
303 double *Origin_Latitude,
304 double *Central_Meridian,
305 double *False_Easting,
306 double *False_Northing)
const 338 double *Northing)
const 353 double lat, sin2lat, sin4lat, sin6lat;
355 double tlat = tan(Latitude);
356 double clat = cos(Latitude);
357 double slat = sin(Latitude);
361 double AA, A2, A3, A4, A5;
378 if (fabs(dlam) > (4.0 *
M_PI / 180.0))
404 MM =
CASS_M(lat, sin2lat, sin4lat, sin6lat);
406 *Easting = NN * (AA - (TT * A3 / 6.0) - (8.0 - TT + 8.0 * CC) *
408 *Northing = MM -
M0 + NN * tlat * ((A2 / 2.0) + (5.0 - TT +
418 double *Longitude)
const 436 double sin2mu, sin4mu, sin6mu, sin8mu;
439 double tanphi1, sinphi1, cosphi1;
443 double DD, D2, D3, D4, D5;
468 phi1 = mu1 + sin2mu + sin4mu + sin6mu + sin8mu;
485 T1 = tanphi1 * tanphi1;
494 T = (1.0 + 3.0 * T1);
495 *Latitude = phi1 - (N1 * tanphi1 / R1) * (D2 / 2.0 - T * D4 / 24.0);
497 *Longitude =
Cass_Origin_Long + (DD - T1 * D3 / 3.0 + T * T1 * D5 / 15.0) / cosphi1;
509 if (*Longitude >
M_PI)
511 else if (*Longitude < -
M_PI)
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 Cass_False_Northing
Represents serializable keyword/value map.
const char * find(const char *key) const
ossimCassiniProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
virtual const ossimString & code() const
long Convert_Cassini_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
#define CASS_COEFF_TIMES_SIN(coeff, x, latit)
virtual ossimGpt inverse(const ossimDpt &projectedPoint) const
Will take a point in meters and convert it to ground.
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 loadState(const ossimKeywordlist &kwl, const char *prefix=0)
long Set_Cassini_Parameters(double a, double f, double Origin_Latitude, double Central_Meridian, double False_Easting, double False_Northing)
#define CASS_M(c0lat, c1s2lat, c2s4lat, c3s6lat)
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 Cass_False_Easting
virtual ossimDpt forward(const ossimGpt &worldPoint) const
All map projections will convert the world coordinate to an easting northing (Meters).
void setFalseEasting(double falseEasting)
double latr() const
latr().
void Get_Cassini_Parameters(double *a, double *f, double *Origin_Latitude, double *Central_Meridian, double *False_Easting, double *False_Northing) const
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.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
void setFalseEastingNorthing(double falseEasting, double falseNorthing)
long Convert_Geodetic_To_Cassini(double Latitude, double Longitude, double *Easting, double *Northing) const
#define FLOAT_EQ(x, v, epsilon)
void setFalseNorthing(double falseNorthing)
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.