OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ossimCadrgProjection Class Reference

#include <ossimCadrgProjection.h>

Inheritance diagram for ossimCadrgProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimCadrgProjection ()
 
virtual ossimObjectdup () const
 
virtual ossimGpt inverse (const ossimDpt &eastingNorthing) const
 Will take a point in meters and convert it to ground. More...
 
virtual ossimDpt forward (const ossimGpt &latLon) const
 All map projections will convert the world coordinate to an easting northing (Meters). More...
 
virtual ossimDpt worldToLineSample (const ossimGpt &worldPoint) const
 
virtual ossimGpt lineSampleToWorld (const ossimDpt &projectedPoint) const
 
virtual void worldToLineSample (const ossimGpt &worldPoint, ossimDpt &lineSample) const
 
virtual void lineSampleToWorld (const ossimDpt &projectedPoint, ossimGpt &gpt) const
 
double computeXPixConstant (double scale, long zone) const
 
double computeYPixConstant (double scale) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
ossimString getProjectionName () const
 Returns the projection name. More...
 
virtual bool operator== (const ossimProjection &projection) const
 Returns TRUE if principal parameters are within epsilon tolerance. More...
 
- Public Member Functions inherited from ossimMapProjection
 ossimMapProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimMapProjection (const ossimMapProjection &src)
 
virtual ossimGpt origin () const
 
virtual void lineSampleHeightToWorld (const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const
 This is the pure virtual that projects the image point to the given elevation above ellipsoid, thereby bypassing reference to a DEM. More...
 
virtual void lineSampleToEastingNorthing (const ossimDpt &liineSample, ossimDpt &eastingNorthing) const
 
virtual void eastingNorthingToLineSample (const ossimDpt &eastingNorthing, ossimDpt &lineSample) const
 
virtual void eastingNorthingToWorld (const ossimDpt &eastingNorthing, ossimGpt &worldPt) const
 
virtual double getFalseEasting () const
 
virtual double getFalseNorthing () const
 
virtual double getStandardParallel1 () const
 Derived classes should implement as needed. More...
 
virtual double getStandardParallel2 () const
 Derived classes should implement as needed. More...
 
virtual void update ()
 
virtual void setPcsCode (ossim_uint32 pcsCode)
 
virtual ossim_uint32 getPcsCode () const
 Returns the EPSG PCS code or 32767 if the projection is a custom (non-EPSG) projection. More...
 
virtual double getA () const
 ACCESS METHODS: More...
 
virtual double getB () const
 
virtual double getF () const
 
virtual ossimDpt getMetersPerPixel () const
 
virtual const ossimDptgetDecimalDegreesPerPixel () const
 Returns decimal degrees per pixel as an ossimDpt with "x" representing longitude and "y" representing latitude. More...
 
virtual const ossimDptgetUlEastingNorthing () const
 
virtual const ossimGptgetUlGpt () const
 
virtual const ossimDatumgetDatum () const
 
const ossimEllipsoidgetEllipsoid () const
 
const ossimGptgetOrigin () const
 
virtual bool isGeographic () const
 
virtual void applyScale (const ossimDpt &scale, bool recenterTiePoint)
 Applies scale to theDeltaLonPerPixel, theDeltaLatPerPixel and theMetersPerPixel data members (eg: theDeltaLonPerPixel *= scale.x). More...
 
virtual void setEllipsoid (const ossimEllipsoid &ellipsoid)
 SET METHODS: More...
 
virtual void setAB (double a, double b)
 
virtual void setDatum (const ossimDatum *datum)
 Sets theDatum to datum. More...
 
virtual void setOrigin (const ossimGpt &origin)
 Sets theOrigin to origin. More...
 
virtual void setMetersPerPixel (const ossimDpt &gsd)
 
virtual void setDecimalDegreesPerPixel (const ossimDpt &gsd)
 
virtual void setUlTiePoints (const ossimGpt &gpt)
 
virtual void setUlTiePoints (const ossimDpt &eastingNorthing)
 
virtual void setUlEastingNorthing (const ossimDpt &ulEastingNorthing)
 
virtual void setUlGpt (const ossimGpt &ulGpt)
 
virtual void assign (const ossimProjection &aProjection)
 
virtual std::ostream & print (std::ostream &out) const
 Prints data members to stream. More...
 
virtual void computeDegreesPerPixel ()
 Computes the approximate resolution in degrees/pixel. More...
 
virtual void computeMetersPerPixel ()
 This will go from the ground point and give you an approximate meters per pixel. More...
 
void setMatrix (double rotation, const ossimDpt &scale, const ossimDpt &translation)
 
void setMatrixScale (const ossimDpt &scale)
 
void setMatrixRotation (double rotation)
 
void setMatrixTranslation (const ossimDpt &translation)
 
void snapTiePointTo (ossim_float64 multiple, ossimUnitType unitType)
 Utility method to snap the tie point to some multiple. More...
 
void snapTiePointToOrigin ()
 
void setElevationLookupFlag (bool flag)
 
bool getElevationLookupFlag () const
 
ossimUnitType getModelTransformUnitType () const
 
void setModelTransformUnitType (ossimUnitType unit)
 
bool hasModelTransform () const
 
virtual bool isAffectedByElevation () const
 Implementation of pure virtual ossimProjection::isAffectedByElevation method. More...
 
void setProjectionUnits (ossimUnitType units)
 
ossimUnitType getProjectionUnits () const
 OSSIM considers all map projection coordinates (including false eastings and northings) to be in meters. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimProjection
 ossimProjection ()
 
virtual ~ossimProjection ()
 
virtual void getRoundTripError (const ossimDpt &imagePoint, ossimDpt &errorResult) const
 
virtual void getRoundTripError (const ossimGpt &groundPoint, ossimDpt &errorResult) const
 
virtual void getGroundClipPoints (ossimGeoPolygon &gpts) const
 
virtual bool operator!= (const ossimProjection &projection) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Protected Member Functions

virtual ~ossimCadrgProjection ()
 
void computeParameters ()
 
- Protected Member Functions inherited from ossimMapProjection
virtual ~ossimMapProjection ()
 
void updateFromTransform ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

ossim_int32 theCadrgZone
 
ossimDpt thePixelConstant
 
double theMapScale
 
double theWidth
 
double theHeight
 
ossimDpt theUlLineSample
 
ossimGpt theUlGpt
 
ossimGpt theLlGpt
 
ossimGpt theLrGpt
 
ossimGpt theUrGpt
 
- Protected Attributes inherited from ossimMapProjection
ossimEllipsoid theEllipsoid
 This method verifies that the projection parameters match the current pcs code. More...
 
ossimGpt theOrigin
 
const ossimDatumtheDatum
 This is only set if we want to have built in datum shifting. More...
 
ossimDpt theMetersPerPixel
 Holds the number of meters per pixel. More...
 
ossimDpt theDegreesPerPixel
 Hold the decimal degrees per pixel. More...
 
ossimGpt theUlGpt
 Hold tie point in decimal degrees. More...
 
ossimDpt theUlEastingNorthing
 Hold tie point as easting northing. More...
 
ossimDpt theFalseEastingNorthing
 Hold the false easting northing. More...
 
ossim_uint32 thePcsCode
 Projection Coordinate System(PCS) code. More...
 
bool theElevationLookupFlag
 
ossimMatrix4x4 theModelTransform
 
ossimMatrix4x4 theInverseModelTransform
 
ossimUnitType theModelTransformUnitType
 
ossimUnitType theProjectionUnits
 Linear units of the projection as indicated in the projection's specification: More...
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Static Protected Attributes

static double theCadrgArcA [8]
 
static double theOldZoneExtents [10]
 
static double theNorthLimit = 90.0*M_PI/180.0
 
static double theSouthLimit = -90.0*M_PI/180.0
 

Detailed Description

Definition at line 15 of file ossimCadrgProjection.h.

Constructor & Destructor Documentation

◆ ossimCadrgProjection()

ossimCadrgProjection::ossimCadrgProjection ( )

Definition at line 27 of file ossimCadrgProjection.cpp.

References computeParameters().

Referenced by dup().

29  theCadrgZone(1),
30  theMapScale(5000000),
31  theWidth(0.0),
32  theHeight(0.0)
33 {
35 }
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimCadrgProjection()

ossimCadrgProjection::~ossimCadrgProjection ( )
protectedvirtual

Definition at line 37 of file ossimCadrgProjection.cpp.

38 {
39 
40 }

Member Function Documentation

◆ computeParameters()

void ossimCadrgProjection::computeParameters ( )
protected

Definition at line 163 of file ossimCadrgProjection.cpp.

References computeXPixConstant(), computeYPixConstant(), theCadrgZone, theHeight, theMapScale, thePixelConstant, theUlLineSample, theWidth, ossimDpt::x, and ossimDpt::y.

Referenced by loadState(), and ossimCadrgProjection().

164 {
165  theUlLineSample = ossimDpt(0,0);
166 
169  theCadrgZone);
170  double height = theHeight;
171  double width = theWidth;
172 
173  if(width > thePixelConstant.x)
174  {
175  width = thePixelConstant.x;
176  }
177 
178  if(height > thePixelConstant.y)
179  {
180  height = thePixelConstant.y;
181  }
182 
183 
184  theUlLineSample.x = -width/2.0;
185  theUlLineSample.y = -height/2.0;
186 }
double y
Definition: ossimDpt.h:165
double computeYPixConstant(double scale) const
double computeXPixConstant(double scale, long zone) const
double x
Definition: ossimDpt.h:164

◆ computeXPixConstant()

double ossimCadrgProjection::computeXPixConstant ( double  scale,
long  zone 
) const

Definition at line 126 of file ossimCadrgProjection.cpp.

References theCadrgArcA.

Referenced by computeParameters().

128 {
129  double adrgscale = 1000000/scale;
130 
131  // E-W pixel constant
132  double x_pix = (double) adrgscale*theCadrgArcA[zone-1] / 512.0;
133 
134  // Increase, if necessary, to the next highest integer value
135  x_pix = ceil(x_pix);
136  x_pix = x_pix * 1.33333;//(512*100)/(150*256);
137 
138  // Round the final result.
139  x_pix = ossim::round<int>(x_pix);
140 
141  return x_pix*256.0;
142 
143 }
static double theCadrgArcA[8]

◆ computeYPixConstant()

double ossimCadrgProjection::computeYPixConstant ( double  scale) const

Definition at line 145 of file ossimCadrgProjection.cpp.

Referenced by computeParameters().

146 {
147  double adrgscale = 1000000/scale;
148  const long CADRG_ARC_B = 400384;
149 
150  double y_pix = (double) adrgscale * CADRG_ARC_B / 512.0;
151 
152  // Increase, if necessary, to the next highest integer value
153  y_pix = ceil(y_pix);
154 
155  y_pix = y_pix * 0.33333;//(512*100)/(4*150*256);
156 
157  // Round the final result.
158  y_pix = ossim::round<int>(y_pix);
159 
160  return y_pix*256.0;
161 }

◆ dup()

ossimObject * ossimCadrgProjection::dup ( ) const
virtual

Implements ossimProjection.

Definition at line 42 of file ossimCadrgProjection.cpp.

References ossimCadrgProjection().

43 {
44  return new ossimCadrgProjection(*this);
45 }

◆ forward()

ossimDpt ossimCadrgProjection::forward ( const ossimGpt worldPoint) const
virtual

All map projections will convert the world coordinate to an easting northing (Meters).

Implements ossimMapProjection.

Definition at line 65 of file ossimCadrgProjection.cpp.

References ossimGpt::changeDatum(), ossimDatum::code(), ossimGpt::datum(), and ossimMapProjection::theDatum.

66 {
67  double easting = 0.0;
68  double northing = 0.0;
69  ossimGpt gpt = latLon;
70 
71  if (theDatum)
72  {
73  if (theDatum->code() != latLon.datum()->code())
74  {
75  gpt.changeDatum(theDatum); // Shift to our datum.
76  }
77  }
78 
79  return ossimDpt(easting, northing);
80 }
virtual const ossimString & code() const
Definition: ossimDatum.h:57
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
Definition: ossimGpt.cpp:316
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ getProjectionName()

ossimString ossimCadrgProjection::getProjectionName ( ) const
inlinevirtual

Returns the projection name.

Reimplemented from ossimMapProjection.

Definition at line 49 of file ossimCadrgProjection.h.

References ossimObject::getClassName().

50  {
51  return getClassName();
52  }
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64

◆ inverse()

ossimGpt ossimCadrgProjection::inverse ( const ossimDpt projectedPoint) const
virtual

Will take a point in meters and convert it to ground.

Implements ossimMapProjection.

Definition at line 57 of file ossimCadrgProjection.cpp.

References DEG_PER_RAD, and ossimMapProjection::theDatum.

58 {
59  double lat=0.0;
60  double lon=0.0;
61 
62  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
63 }
#define DEG_PER_RAD
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ lineSampleToWorld() [1/2]

ossimGpt ossimCadrgProjection::lineSampleToWorld ( const ossimDpt projectedPoint) const
virtual

Reimplemented from ossimMapProjection.

Definition at line 82 of file ossimCadrgProjection.cpp.

83 {
84  ossimGpt worldPoint;
85 
86  lineSampleToWorld(projectedPoint, worldPoint);
87 
88  return worldPoint;
89 }
virtual ossimGpt lineSampleToWorld(const ossimDpt &projectedPoint) const

◆ lineSampleToWorld() [2/2]

void ossimCadrgProjection::lineSampleToWorld ( const ossimDpt lineSampPt,
ossimGpt worldPt 
) const
virtual

METHOD: lineSampleToWorld() Performs the inverse projection from line, sample to ground (world):

Reimplemented from ossimMapProjection.

Definition at line 105 of file ossimCadrgProjection.cpp.

References ossimGpt::clampLat(), ossimGpt::clampLon(), ossimGpt::latd(), ossimGpt::lond(), ossimMapProjection::theOrigin, thePixelConstant, theUlLineSample, ossimDpt::x, and ossimDpt::y.

107 {
108  gpt = theOrigin;
109 
110 
111  ossimDpt adjustedPixel(projectedPoint.x + theUlLineSample.x,
112  projectedPoint.y + theUlLineSample.y);
113 
114 // double lat = gpt.latd() - (90/thePixelConstant.y)*adjustedPixel.y;
115 // double lon = gpt.lond() + (360/thePixelConstant.x)*adjustedPixel.x;
116  double lat = gpt.latd() - (90/thePixelConstant.y)*adjustedPixel.y;
117  double lon = gpt.lond() + (360/thePixelConstant.x)*adjustedPixel.x;
118 
119  gpt.latd(lat);
120  gpt.lond(lon);
121 
122  gpt.clampLat(-90, 90);
123  gpt.clampLon(-180, 180);
124 }
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164

◆ loadState()

bool ossimCadrgProjection::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimMapProjection.

Definition at line 267 of file ossimCadrgProjection.cpp.

References computeParameters(), ossimKeywordlist::find(), ossimGpt::latd(), ossimKeywordNames::LL_LAT_KW, ossimKeywordNames::LL_LON_KW, ossimProjection::loadState(), ossimGpt::lond(), ossimKeywordNames::LR_LAT_KW, ossimKeywordNames::LR_LON_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, theCadrgZone, theHeight, theLlGpt, theLrGpt, theMapScale, theUlGpt, theUrGpt, theWidth, ossimString::toDouble(), ossimString::toLong(), ossimKeywordNames::UL_LAT_KW, ossimKeywordNames::UL_LON_KW, ossimKeywordNames::UR_LAT_KW, ossimKeywordNames::UR_LON_KW, and ossimKeywordNames::ZONE_KW.

269 {
270  ossimProjection::loadState(kwl, prefix);
271 
272 
273  const char* lookup = kwl.find(prefix, ossimKeywordNames::UL_LAT_KW);
274  if(lookup)
275  {
276  theUlGpt.latd(ossimString(lookup).toDouble());
277  }
278  else
279  {
280  theUlGpt.latd(90.0);
281  }
282 
283  lookup = kwl.find(prefix, ossimKeywordNames::UL_LON_KW);
284  if(lookup)
285  {
286  theUlGpt.lond(ossimString(lookup).toDouble());
287  }
288  else
289  {
290  theUlGpt.lond(-180.0);
291  }
292 
293  lookup = kwl.find(prefix, ossimKeywordNames::LL_LAT_KW);
294  if(lookup)
295  {
296  theLlGpt.latd(ossimString(lookup).toDouble());
297  }
298  else
299  {
300  theLlGpt.latd(0.0);
301  }
302 
303  lookup = kwl.find(prefix, ossimKeywordNames::LL_LON_KW);
304  if(lookup)
305  {
306  theLlGpt.lond(ossimString(lookup).toDouble());
307  }
308  else
309  {
310  theLlGpt.lond(-180.0);
311  }
312 
313  lookup = kwl.find(prefix, ossimKeywordNames::LR_LAT_KW);
314  if(lookup)
315  {
316  theLrGpt.latd(ossimString(lookup).toDouble());
317  }
318  else
319  {
320  theLrGpt.latd(0.0);
321  }
322 
323  lookup = kwl.find(prefix, ossimKeywordNames::LR_LON_KW);
324  if(lookup)
325  {
326  theLrGpt.lond(ossimString(lookup).toDouble());
327  }
328  else
329  {
330  theLrGpt.lond(180.0);
331  }
332 
333  lookup = kwl.find(prefix, ossimKeywordNames::LR_LAT_KW);
334  if(lookup)
335  {
336  theLrGpt.latd(ossimString(lookup).toDouble());
337  }
338  else
339  {
340  theLrGpt.latd(0.0);
341  }
342 
343  lookup = kwl.find(prefix, ossimKeywordNames::LR_LON_KW);
344  if(lookup)
345  {
346  theLrGpt.lond(ossimString(lookup).toDouble());
347  }
348  else
349  {
350  theLrGpt.lond(180.0);
351  }
352 
353  lookup = kwl.find(prefix, ossimKeywordNames::UR_LAT_KW);
354  if(lookup)
355  {
356  theUrGpt.latd(ossimString(lookup).toDouble());
357  }
358  else
359  {
360  theUrGpt.latd(90.0);
361  }
362 
363  lookup = kwl.find(prefix, ossimKeywordNames::UR_LON_KW);
364  if(lookup)
365  {
366  theUrGpt.lond(ossimString(lookup).toDouble());
367  }
368  else
369  {
370  theUrGpt.lond(180.0);
371  }
372 
373  const char* zone = kwl.find(prefix,
375  if(zone)
376  {
377  theCadrgZone = ossimString(zone).toLong();
378  }
379  const char* mapScale = kwl.find(prefix,
380  "map_scale");
381  if(mapScale)
382  {
383  theMapScale = ossimString(mapScale).toDouble();
384  }
385  const char *height = kwl.find(prefix,
387  const char *width = kwl.find(prefix,
389  if(height)
390  {
391  theHeight = ossimString(height).toDouble();
392  }
393 
394  if(width)
395  {
396  theWidth = ossimString(width).toDouble();
397  }
398 
400 
401  return true;
402 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
static const char * UL_LAT_KW
const char * find(const char *key) const
static const char * NUMBER_LINES_KW
static const char * LR_LON_KW
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static const char * ZONE_KW
static const char * LR_LAT_KW
static const char * LL_LON_KW
double toDouble() const
static const char * LL_LAT_KW
long toLong() const
toLong&#39;s deprecated, please use the toInts...
static const char * UL_LON_KW
static const char * UR_LAT_KW
static const char * UR_LON_KW
static const char * NUMBER_SAMPLES_KW

◆ operator==()

bool ossimCadrgProjection::operator== ( const ossimProjection projection) const
virtual

Returns TRUE if principal parameters are within epsilon tolerance.

Reimplemented from ossimMapProjection.

Definition at line 407 of file ossimCadrgProjection.cpp.

References ossim::almostEqual(), theCadrgZone, theHeight, theLlGpt, theLrGpt, theUlGpt, theUrGpt, and theWidth.

408 {
409  if (!ossimMapProjection::operator==(proj))
410  return false;
411 
412  const ossimCadrgProjection* p = dynamic_cast<const ossimCadrgProjection*>(&proj);
413  if (!p) return false;
414 
415  if (theUlGpt != p->theUlGpt) return false;
416  if (theLlGpt != p->theLlGpt) return false;
417  if (theLrGpt != p->theLrGpt) return false;
418  if (theUrGpt != p->theUrGpt) return false;
419  if (!ossim::almostEqual(theWidth,p->theWidth)) return false;
420  if (!ossim::almostEqual(theHeight,p->theHeight)) return false;
421  if (theCadrgZone != p->theCadrgZone) return false;
422 
423  return true;
424 }
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53

◆ saveState()

bool ossimCadrgProjection::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list. Return true if ok or false on error.

Reimplemented from ossimMapProjection.

Definition at line 188 of file ossimCadrgProjection.cpp.

References ossimKeywordlist::add(), ossimDatum::code(), ossimKeywordNames::DATUM_KW, ossimGpt::latd(), ossimKeywordNames::LL_LAT_KW, ossimKeywordNames::LL_LON_KW, ossimGpt::lond(), ossimKeywordNames::LR_LAT_KW, ossimKeywordNames::LR_LON_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimProjection::saveState(), theCadrgZone, ossimMapProjection::theDatum, theHeight, theLlGpt, theLrGpt, theMapScale, theUlGpt, theUrGpt, theWidth, ossimKeywordNames::UL_LAT_KW, ossimKeywordNames::UL_LON_KW, ossimKeywordNames::UR_LAT_KW, ossimKeywordNames::UR_LON_KW, and ossimKeywordNames::ZONE_KW.

190 {
191  bool result = ossimProjection::saveState(kwl, prefix);
192 
193  kwl.add(prefix,
195  theCadrgZone,
196  true);
197 
198  kwl.add(prefix,
199  "map_scale",
200  theMapScale,
201  true);
202 
203  kwl.add(prefix,
205  theHeight,
206  true);
207 
208  kwl.add(prefix,
210  theWidth,
211  true);
212 
213  kwl.add(prefix,
215  theUlGpt.latd(),
216  true);
217 
218  kwl.add(prefix,
220  theUlGpt.lond(),
221  true);
222 
223  kwl.add(prefix,
225  theLlGpt.latd(),
226  true);
227 
228  kwl.add(prefix,
230  theLlGpt.lond(),
231  true);
232 
233  kwl.add(prefix,
235  theLrGpt.latd(),
236  true);
237 
238  kwl.add(prefix,
240  theLrGpt.lond(),
241  true);
242 
243  kwl.add(prefix,
245  theUrGpt.latd(),
246  true);
247 
248  kwl.add(prefix,
250  theUrGpt.lond(),
251  true);
252 
253 
254 
255  if(theDatum)
256  {
257  kwl.add(prefix,
259  theDatum->code(),
260  true);
261  }
262 
263  return result;
264 }
static const char * DATUM_KW
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
static const char * UL_LAT_KW
virtual const ossimString & code() const
Definition: ossimDatum.h:57
static const char * NUMBER_LINES_KW
static const char * LR_LON_KW
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static const char * ZONE_KW
static const char * LR_LAT_KW
static const char * LL_LON_KW
static const char * LL_LAT_KW
static const char * UL_LON_KW
static const char * UR_LAT_KW
static const char * UR_LON_KW
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
static const char * NUMBER_SAMPLES_KW
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ worldToLineSample() [1/2]

ossimDpt ossimCadrgProjection::worldToLineSample ( const ossimGpt worldPoint) const
virtual

Reimplemented from ossimMapProjection.

Definition at line 48 of file ossimCadrgProjection.cpp.

49 {
50  ossimDpt lineSample;
51 
52  worldToLineSample(worldPoint, lineSample);
53 
54  return lineSample;
55 }
virtual ossimDpt worldToLineSample(const ossimGpt &worldPoint) const

◆ worldToLineSample() [2/2]

void ossimCadrgProjection::worldToLineSample ( const ossimGpt worldPoint,
ossimDpt lineSampPt 
) const
virtual

METHOD: worldToLineSample() Performs the forward projection from ground point to line, sample.

Reimplemented from ossimMapProjection.

Definition at line 91 of file ossimCadrgProjection.cpp.

References DEG_PER_RAD, ossimGpt::latd(), ossimGpt::lond(), ossimMapProjection::theOrigin, thePixelConstant, theUlLineSample, ossimDpt::x, and ossimDpt::y.

93 {
94  double lat = worldPoint.latd();
95  double lon = worldPoint.lond();
96  double centerLat = theOrigin.latd();
97  double centerLon = theOrigin.lond()*DEG_PER_RAD;
98 
99  lineSample.y = (centerLat - lat)/90.0*thePixelConstant.y;
100  lineSample.x = (lon - centerLon)/360.0*thePixelConstant.x;
101 
102  lineSample = lineSample - theUlLineSample;
103 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
#define DEG_PER_RAD
double y
Definition: ossimDpt.h:165
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
double x
Definition: ossimDpt.h:164

Member Data Documentation

◆ theCadrgArcA

double ossimCadrgProjection::theCadrgArcA
staticprotected
Initial value:
= { 369664, 302592, 245760, 199168,
163328, 137216, 110080, 82432 }

Definition at line 63 of file ossimCadrgProjection.h.

Referenced by computeXPixConstant().

◆ theCadrgZone

ossim_int32 ossimCadrgProjection::theCadrgZone
protected

Definition at line 71 of file ossimCadrgProjection.h.

Referenced by computeParameters(), loadState(), operator==(), and saveState().

◆ theHeight

double ossimCadrgProjection::theHeight
protected

Definition at line 77 of file ossimCadrgProjection.h.

Referenced by computeParameters(), loadState(), operator==(), and saveState().

◆ theLlGpt

ossimGpt ossimCadrgProjection::theLlGpt
protected

Definition at line 82 of file ossimCadrgProjection.h.

Referenced by loadState(), operator==(), and saveState().

◆ theLrGpt

ossimGpt ossimCadrgProjection::theLrGpt
protected

Definition at line 83 of file ossimCadrgProjection.h.

Referenced by loadState(), operator==(), and saveState().

◆ theMapScale

double ossimCadrgProjection::theMapScale
protected

Definition at line 74 of file ossimCadrgProjection.h.

Referenced by computeParameters(), loadState(), and saveState().

◆ theNorthLimit

double ossimCadrgProjection::theNorthLimit = 90.0*M_PI/180.0
staticprotected

Definition at line 68 of file ossimCadrgProjection.h.

◆ theOldZoneExtents

double ossimCadrgProjection::theOldZoneExtents
staticprotected
Initial value:
= {0.0, 32.0, 48.0, 56.0, 64.0,
68.0, 72.0, 76.0, 80.0, 90.0}

Definition at line 66 of file ossimCadrgProjection.h.

◆ thePixelConstant

ossimDpt ossimCadrgProjection::thePixelConstant
protected

Definition at line 73 of file ossimCadrgProjection.h.

Referenced by computeParameters(), lineSampleToWorld(), and worldToLineSample().

◆ theSouthLimit

double ossimCadrgProjection::theSouthLimit = -90.0*M_PI/180.0
staticprotected

Definition at line 69 of file ossimCadrgProjection.h.

◆ theUlGpt

ossimGpt ossimCadrgProjection::theUlGpt
protected

Definition at line 81 of file ossimCadrgProjection.h.

Referenced by loadState(), operator==(), and saveState().

◆ theUlLineSample

ossimDpt ossimCadrgProjection::theUlLineSample
protected

Definition at line 79 of file ossimCadrgProjection.h.

Referenced by computeParameters(), lineSampleToWorld(), and worldToLineSample().

◆ theUrGpt

ossimGpt ossimCadrgProjection::theUrGpt
protected

Definition at line 84 of file ossimCadrgProjection.h.

Referenced by loadState(), operator==(), and saveState().

◆ theWidth

double ossimCadrgProjection::theWidth
protected

Definition at line 76 of file ossimCadrgProjection.h.

Referenced by computeParameters(), loadState(), operator==(), and saveState().


The documentation for this class was generated from the following files: