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

Special "sensor model" that provides a conventional map projection but with. More...

#include <ossimAdjMapModel.h>

Inheritance diagram for ossimAdjMapModel:
ossimSensorModel ossimProjection ossimOptimizableProjection ossimAdjustableParameterInterface ossimObject ossimErrorStatusInterface ossimReferenced

Public Types

enum  AdjParamIndex {
  OFFSET_X = 0, OFFSET_Y, ROTATION, SCALE_X,
  SCALE_Y, NUM_ADJ_PARAMS
}
 Enumeration for adjustable parameter positions in theAdjParams vector. More...
 
- Public Types inherited from ossimSensorModel
enum  CovMatStatus { COV_INVALID = 0, COV_PARTIAL = 1, COV_FULL = 2 }
 
enum  DeriveMode {
  OBS_INIT =-99, EVALUATE =-98, P_WRT_X = -1, P_WRT_Y = -2,
  P_WRT_Z = -3
}
 

Public Member Functions

 ossimAdjMapModel ()
 Constructs to uninitialized state (needed by factory). More...
 
 ossimAdjMapModel (ossimMapProjection *map_proj, const ossimIpt &image_size)
 Constructs with map projection and image rectangle size. More...
 
 ossimAdjMapModel (const ossimAdjMapModel &copy_this)
 Copy constructor. More...
 
 ossimAdjMapModel (const ossimKeywordlist &kwl, const char *prefix)
 Constructs given geom KWL. More...
 
 ossimAdjMapModel (const ossimFilename &geom_filename)
 Constructs given geom filename. More...
 
bool initializeFromMap ()
 Initializes base class data members after map model established. More...
 
virtual ossimObjectdup () const
 Returns pointer to a new instance, copy of this. More...
 
virtual std::ostream & print (std::ostream &out) const
 Extends base-class implementation. Dumps contents of object to ostream. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Fulfills ossimObject base-class pure virtuals. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Fulfills ossimObject base-class pure virtuals. More...
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
 Overrides base class pure virtual. More...
 
virtual void lineSampleToWorld (const ossimDpt &image_point, ossimGpt &worldPoint) const
 Overrides base class virtual. More...
 
virtual void worldToLineSample (const ossimGpt &world_point, ossimDpt &image_point) const
 Rigorous inverse transform implented, overrides base-class' iterative. More...
 
virtual void updateModel ()
 Following a change to the adjustable parameter set, this virtual is. More...
 
virtual void initAdjustableParameters ()
 Initializes adjustable parameters to their default values. More...
 
virtual ossimDpt getMetersPerPixel () const
 Fetches the GSD from the internal map projection. More...
 
virtual bool useForward () const
 
- Public Member Functions inherited from ossimSensorModel
 ossimSensorModel ()
 
 ossimSensorModel (const ossimSensorModel &copy_this)
 
 ossimSensorModel (const ossimKeywordlist &geom_kwl)
 
const ossimSensorModeloperator= (const ossimSensorModel &rhs)
 assignment operator More...
 
virtual ossimObjectgetBaseObject ()
 
virtual const ossimObjectgetBaseObject () const
 
virtual ossimGpt origin () const
 
virtual const double & getNominalPosError () const
 Returns the estimated Absolute horizontal position error (CE90) of the sensor model. More...
 
virtual const double & getRelativePosError () const
 Returns the estimated RELATIVE horizontal position error (CE90) of the sensor model. More...
 
virtual void setNominalPosError (const double &ce90)
 Assigns the absolute image position error uncertainty (abs CE90) More...
 
virtual void setRelativePosError (const double &ce90)
 Assigns the relative image position error uncertainty (rel CE90) More...
 
virtual void imagingRay (const ossimDpt &image_point, ossimEcefRay &image_ray) const
 
void setRefImgPt (const ossimDpt &pt)
 Sets the center line sampe of the image. More...
 
void setRefGndPt (const ossimGpt &pt)
 Sets the center latitude, longitude, height of the image. More...
 
void setImageRect (const ossimDrect &imageRect)
 
void setGroundRect (const ossimGpt &ul, const ossimGpt &ur, const ossimGpt &lr, const ossimGpt &ll)
 
ossimDpt imageSize () const
 
void setImageSize (const ossimDpt &size)
 
virtual void adjustableParametersChanged ()
 
virtual bool insideImage (const ossimDpt &p) const
 
virtual bool operator== (const ossimProjection &proj) const
 
const ossimStringgetImageID () const
 Access methods: More...
 
const ossimDrectgetImageClipRect () const
 
virtual ossim_uint32 degreesOfFreedom () const
 
virtual bool needsInitialState () const
 needsInitialState() More...
 
virtual double optimizeFit (const ossimTieGptSet &tieSet, double *targetVariance=0)
 
virtual ossimDpt getForwardDeriv (int parmIdx, const ossimGpt &gpos, double hdelta=1e-11)
 
virtual ossimGpt getInverseDeriv (int parmIdx, const ossimDpt &ipos, double hdelta=1e-11)
 
virtual ossimSensorModel::CovMatStatus getObsCovMat (const ossimDpt &ipos, NEWMAT::SymmetricMatrix &Cov, const ossim_float64 defPointingSigma=0.5) const
 Gives 2X2 covariance matrix of observations. More...
 
virtual bool isAffectedByElevation () const
 Implementation of pure virtual ossimProjection::isAffectedByElevation method. More...
 
void computeGsd ()
 This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD by doing a lineSampleHeightToWorld on four points and calculating the distance from them. More...
 
virtual bool getImageGeometry (const ossimString &, const ossimString &, ossimKeywordlist &) const
 Extracts geometry info from a non-ossim key,value pair to an ossim keyword list. More...
 
- Public Member Functions inherited from ossimProjection
 ossimProjection ()
 
virtual ~ossimProjection ()
 
virtual ossimDpt forward (const ossimGpt &wp) const
 
virtual ossimGpt inverse (const ossimDpt &pp) const
 
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 isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) 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
 
- Public Member Functions inherited from ossimOptimizableProjection
 ossimOptimizableProjection ()
 
 ossimOptimizableProjection (const ossimOptimizableProjection &source)
 
virtual ~ossimOptimizableProjection ()
 
virtual ossimOptimizableProjectionoperator= (const ossimOptimizableProjection &source)
 
virtual bool setupOptimizer (const ossimString &setup)
 setupFromString() Derived classes should implement as needed. Initialize parameters needed for optimizeFit and degreesOfFreedom More...
 
- Public Member Functions inherited from ossimAdjustableParameterInterface
 ossimAdjustableParameterInterface ()
 
 ossimAdjustableParameterInterface (const ossimAdjustableParameterInterface &rhs)
 
virtual ~ossimAdjustableParameterInterface ()
 
void newAdjustment (ossim_uint32 numberOfParameters=0)
 
void setAdjustmentDescription (const ossimString &description)
 
ossimString getAdjustmentDescription () const
 
ossimString getAdjustmentDescription (ossim_uint32 adjustmentIdx) const
 Returns adjustmentDescription of specific adjustmentInfo. More...
 
void setCurrentAdjustment (ossim_uint32 adjustmentIndex, bool notify=false)
 
bool setCurrentAdjustment (const ossimString &description, bool notify=false)
 Sets the current adjustment to the adjustment with a matching description. More...
 
void eraseAdjustment (bool notify)
 
void eraseAdjustment (ossim_uint32 idx, bool notify)
 
void resetAdjustableParameters (bool notify=false)
 
void copyAdjustment (ossim_uint32 idx, bool notify)
 
void copyAdjustment (bool notify=false)
 
void keepAdjustment (ossim_uint32 idx, bool createCopy)
 
virtual void keepAdjustment (bool createCopy=true)
 
const ossimAdjustableParameterInterfaceoperator= (const ossimAdjustableParameterInterface &rhs)
 
void removeAllAdjustments ()
 
ossim_uint32 getNumberOfAdjustableParameters () const
 
double getAdjustableParameter (ossim_uint32 idx) const
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, bool notify=false)
 
virtual void setAdjustableParameter (ossim_uint32 idx, double value, double sigma, bool notify=false)
 
double getParameterSigma (ossim_uint32 idx) const
 
void setParameterSigma (ossim_uint32 idx, double value, bool notify=false)
 
ossimUnitType getParameterUnit (ossim_uint32 idx) const
 
void setParameterUnit (ossim_uint32 idx, ossimUnitType unit)
 
void setParameterUnit (ossim_uint32 idx, const ossimString &unit)
 
void setParameterCenter (ossim_uint32 idx, double center, bool notify=false)
 
double getParameterCenter (ossim_uint32 idx) const
 
double computeParameterOffset (ossim_uint32 idx) const
 
void setParameterOffset (ossim_uint32 idx, ossim_float64 value, bool notify=false)
 
ossimString getParameterDescription (ossim_uint32 idx) const
 
void setParameterDescription (ossim_uint32 idx, const ossimString &descrption)
 
ossim_int32 findParameterIdxGivenDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
ossim_int32 findParameterIdxContainingDescription (ossim_uint32 adjustmentIdx, const ossimString &name) const
 
bool isParameterLocked (ossim_uint32 idx) const
 
void setParameterLockFlag (ossim_uint32 idxParam, bool flag)
 
bool getParameterLockFlag (ossim_uint32 idx) const
 
void lockAllParametersCurrentAdjustment ()
 
void unlockAllParametersCurrentAdjustment ()
 
void lockAllParameters (ossim_uint32 idxAdjustment)
 
void unlockAllParameters (ossim_uint32 idxAdjustment)
 
void resizeAdjustableParameterArray (ossim_uint32 numberOfParameters)
 
void setAdjustment (const ossimAdjustmentInfo &adj, bool notify=false)
 
void setAdjustment (ossim_uint32 idx, const ossimAdjustmentInfo &adj, bool notify=false)
 
void addAdjustment (const ossimAdjustmentInfo &adj, bool notify)
 
void getAdjustment (ossimAdjustmentInfo &adj) const
 
void getAdjustment (ossim_uint32 idx, ossimAdjustmentInfo &adj) const
 
ossim_uint32 getNumberOfAdjustments () const
 
ossim_uint32 getCurrentAdjustmentIdx () const
 
void setDirtyFlag (bool flag=true)
 
void setAllDirtyFlag (bool flag=true)
 
bool hasDirtyAdjustments () const
 
virtual void saveCurrentAdjustmentOnly (ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 Saves the current active adjustment to the KWL file. More...
 
bool saveAdjustments (ossimKeywordlist &kwl, const ossimString &prefix=ossimString("")) const
 Save all adjustments to the KWL file. More...
 
bool loadAdjustments (const ossimKeywordlist &kwl, const ossimString &prefix=ossimString(""))
 
std::ostream & print (std::ostream &out) const
 Dumps the currently active adjustment to ostream. More...
 

Static Public Member Functions

static void writeGeomTemplate (ostream &os)
 Writes a template of geom keywords processed by loadState and saveState. More...
 
- Static Public Member Functions inherited from ossimSensorModel
static void writeGeomTemplate (ostream &os)
 

Private Member Functions

virtual ~ossimAdjMapModel ()
 ground to image faster (you don't need DEM) More...
 

Private Attributes

ColumnVector theAdjParams
 This is the vector of UNNORMALIZED, BIASED parameters as used in the model. More...
 
ossimRefPtr< ossimMapProjectiontheMapProjection
 
double theCosTheta
 
double theSinTheta
 

Additional Inherited Members

- Protected Member Functions inherited from ossimSensorModel
virtual ~ossimSensorModel ()
 
virtual ossimDpt extrapolate (const ossimGpt &gp) const
 
virtual ossimGpt extrapolate (const ossimDpt &ip, const double &height=ossim::nan()) const
 
void buildNormalEquation (const ossimTieGptSet &tieSet, NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &residue, NEWMAT::ColumnVector &projResidue, double pstep_scale)
 
NEWMAT::ColumnVector getResidue (const ossimTieGptSet &tieSet)
 
NEWMAT::ColumnVector solveLeastSquares (NEWMAT::SymmetricMatrix &A, NEWMAT::ColumnVector &r) const
 
NEWMAT::Matrix invert (const NEWMAT::Matrix &m) const
 stable invert stolen from ossimRpcSolver More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimAdjustableParameterInterface
bool paramChanged (ossim_uint32 param_idx) const
 Returns true if specified parameter has been modified since last setAllChangeFlag(false) call. More...
 
void setAllChangeFlags (bool areChanged)
 Sets all the change flags to the boolean indicated to indicate parameters are changed (TRUE) or not (FALSE). More...
 
void initChangeFlags ()
 Initializes the change flags to TRUE. More...
 
- Protected Attributes inherited from ossimSensorModel
ossimIpt theImageSize
 
ossimDpt theSubImageOffset
 
ossimString theImageID
 
ossimString theSensorID
 
ossimDpt theGSD
 
ossim_float64 theMeanGSD
 
ossimGpt theRefGndPt
 
ossimDpt theRefImgPt
 
ossimPolygon theBoundGndPolygon
 
ossimDrect theImageClipRect
 
ossim_float64 theRelPosError
 
ossim_float64 theNominalPosError
 
ossimDpt theParWRTx
 Partials for current point. More...
 
ossimDpt theParWRTy
 
ossimDpt theParWRTz
 
ossimDpt theObs
 Observations & residuals for current point. More...
 
ossimDpt theResid
 
ossimRefPtr< ossimProjectiontheSeedFunction
 Used as an initial guess for iterative solutions and a guess for points outside the support bounds. More...
 
bool theExtrapolateImageFlag
 
bool theExtrapolateGroundFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Special "sensor model" that provides a conventional map projection but with.

capability for adjusting the map x,y coordinates with offset, scale, and

Definition at line 39 of file ossimAdjMapModel.h.

Member Enumeration Documentation

◆ AdjParamIndex

Enumeration for adjustable parameter positions in theAdjParams vector.

Enumerator
OFFSET_X 
OFFSET_Y 
ROTATION 
SCALE_X 
SCALE_Y 
NUM_ADJ_PARAMS 

Definition at line 104 of file ossimAdjMapModel.h.

Constructor & Destructor Documentation

◆ ossimAdjMapModel() [1/5]

ossimAdjMapModel::ossimAdjMapModel ( )

Constructs to uninitialized state (needed by factory).

Definition at line 41 of file ossimAdjMapModel.cpp.

References initAdjustableParameters(), ossimErrorStatusInterface::theErrorStatus, and ossimSensorModel::theImageSize.

Referenced by dup().

42  :
46  theCosTheta(0.0),
47  theSinTheta(0.0)
48 {
49  theImageSize = ossimIpt(0,0);
52 }
virtual void initAdjustableParameters()
Initializes adjustable parameters to their default values.
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
ossimRefPtr< ossimMapProjection > theMapProjection

◆ ossimAdjMapModel() [2/5]

ossimAdjMapModel::ossimAdjMapModel ( ossimMapProjection map_proj,
const ossimIpt image_size 
)

Constructs with map projection and image rectangle size.

Definition at line 58 of file ossimAdjMapModel.cpp.

References initAdjustableParameters(), initializeFromMap(), and ossimSensorModel::theImageSize.

60  :
63  theMapProjection(map_proj),
64  theCosTheta(0.0),
65  theSinTheta(0.0)
66 {
68  theImageSize = image_size;
70 }
virtual void initAdjustableParameters()
Initializes adjustable parameters to their default values.
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
bool initializeFromMap()
Initializes base class data members after map model established.
ossimRefPtr< ossimMapProjection > theMapProjection

◆ ossimAdjMapModel() [3/5]

ossimAdjMapModel::ossimAdjMapModel ( const ossimAdjMapModel copy_this)

Copy constructor.

Definition at line 76 of file ossimAdjMapModel.cpp.

References theAdjParams.

77  :
78  ossimSensorModel(copy_this),
81  theCosTheta(0.0),
82  theSinTheta(0.0)
83 {
84  theAdjParams = copy_this.theAdjParams;
85 }
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
ossimRefPtr< ossimMapProjection > theMapProjection

◆ ossimAdjMapModel() [4/5]

ossimAdjMapModel::ossimAdjMapModel ( const ossimKeywordlist kwl,
const char *  prefix 
)

Constructs given geom KWL.

Constructs from Geom KWL.

Definition at line 90 of file ossimAdjMapModel.cpp.

References initAdjustableParameters(), and loadState().

92  :
93  ossimSensorModel(kwl),
96  theCosTheta(0.0),
97  theSinTheta(0.0)
98 
99 {
101  loadState(kwl, prefix);
102 }
virtual void initAdjustableParameters()
Initializes adjustable parameters to their default values.
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
ossimRefPtr< ossimMapProjection > theMapProjection
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Fulfills ossimObject base-class pure virtuals.

◆ ossimAdjMapModel() [5/5]

ossimAdjMapModel::ossimAdjMapModel ( const ossimFilename geom_filename)

Constructs given geom filename.

Constructs from Geom KWL.

Definition at line 108 of file ossimAdjMapModel.cpp.

References initAdjustableParameters(), and loadState().

109  :
113  theCosTheta(0.0),
114  theSinTheta(0.0)
115 {
117  ossimKeywordlist kwl (kwl_filename);
118  loadState(kwl);
119 }
virtual void initAdjustableParameters()
Initializes adjustable parameters to their default values.
Represents serializable keyword/value map.
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
ossimRefPtr< ossimMapProjection > theMapProjection
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Fulfills ossimObject base-class pure virtuals.

◆ ~ossimAdjMapModel()

ossimAdjMapModel::~ossimAdjMapModel ( )
privatevirtual

ground to image faster (you don't need DEM)

Destructor.

Destructor only deletes the map projection.

Definition at line 142 of file ossimAdjMapModel.cpp.

References ColumnVector::CleanUp(), and theAdjParams.

143 {
145 }
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
void CleanUp()
Definition: newmat4.cpp:895

Member Function Documentation

◆ dup()

ossimObject * ossimAdjMapModel::dup ( ) const
virtual

Returns pointer to a new instance, copy of this.

Implements ossimProjection.

Definition at line 426 of file ossimAdjMapModel.cpp.

References ossimAdjMapModel().

427 {
428  return new ossimAdjMapModel(*this);
429 }
ossimAdjMapModel()
Constructs to uninitialized state (needed by factory).

◆ getMetersPerPixel()

ossimDpt ossimAdjMapModel::getMetersPerPixel ( ) const
virtual

Fetches the GSD from the internal map projection.

Reimplemented from ossimSensorModel.

Definition at line 416 of file ossimAdjMapModel.cpp.

References ossimMapProjection::getMetersPerPixel(), theMapProjection, and ossimRefPtr< T >::valid().

417 {
418  if (theMapProjection.valid())
419  {
421  }
422 
423  return ossimDpt(0,0);
424 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimMapProjection > theMapProjection
virtual ossimDpt getMetersPerPixel() const

◆ initAdjustableParameters()

void ossimAdjMapModel::initAdjustableParameters ( )
virtual

Initializes adjustable parameters to their default values.

Overrides ossimAdjustableParameterInterface virtual method.

Reimplemented from ossimAdjustableParameterInterface.

Definition at line 151 of file ossimAdjMapModel.cpp.

References ossimAdjustableParameterInterface::newAdjustment(), NUM_ADJ_PARAMS, OFFSET_X, OFFSET_Y, ossimAdjustableParameterInterface::removeAllAdjustments(), ROTATION, SCALE_X, SCALE_Y, ossimAdjustableParameterInterface::setAdjustableParameter(), ossimAdjustableParameterInterface::setAdjustmentDescription(), ossimAdjustableParameterInterface::setParameterCenter(), ossimAdjustableParameterInterface::setParameterDescription(), and updateModel().

Referenced by ossimAdjMapModel().

152 {
153  // Initialize this adjustment as the initial geometry "adjustment":
156  setAdjustmentDescription("Initial Geometry");
157 
158  // Initialize each adjustable parameter for this initial:
159  setAdjustableParameter (OFFSET_X, 0.0, 1.0);
160  setParameterDescription(OFFSET_X, "map_offset_x");
162 
163  setAdjustableParameter (OFFSET_Y, 0.0, 1.0);
164  setParameterDescription(OFFSET_Y, "map_offset_y");
166 
167  setAdjustableParameter (ROTATION, 0.0, 1.0);
168  setParameterDescription(ROTATION, "map_rotation");
170 
171  setAdjustableParameter (SCALE_X, 0.0, 1.0);
172  setParameterDescription(SCALE_X, "map_scale_x");
174 
175  setAdjustableParameter (SCALE_Y, 0.0, 1.0);
176  setParameterDescription(SCALE_Y, "map_scale_y");
178 
179  updateModel();
180 }
void setParameterDescription(ossim_uint32 idx, const ossimString &descrption)
void setAdjustmentDescription(const ossimString &description)
virtual void updateModel()
Following a change to the adjustable parameter set, this virtual is.
void newAdjustment(ossim_uint32 numberOfParameters=0)
virtual void setAdjustableParameter(ossim_uint32 idx, double value, bool notify=false)
void setParameterCenter(ossim_uint32 idx, double center, bool notify=false)

◆ initializeFromMap()

bool ossimAdjMapModel::initializeFromMap ( )

Initializes base class data members after map model established.

Initializes base class data members after map model established. Returns TRUE if all's well.

Definition at line 124 of file ossimAdjMapModel.cpp.

References ossimMapProjection::getMetersPerPixel(), ossimMapProjection::origin(), ossimErrorStatusInterface::theErrorStatus, ossimSensorModel::theGSD, theMapProjection, ossimSensorModel::theMeanGSD, ossimSensorModel::theRefGndPt, ossimSensorModel::theSensorID, ossimDpt::x, and ossimDpt::y.

Referenced by ossimAdjMapModel().

125 {
126  if (!theMapProjection)
127  {
128  theErrorStatus++;
129  return false;
130  }
131  theSensorID = "AdjMapModel";
133  theMeanGSD = 0.5*(theGSD.x + theGSD.y);
135 
136  return true;
137 }
ossimString theSensorID
double y
Definition: ossimDpt.h:165
virtual ossimGpt origin() const
double x
Definition: ossimDpt.h:164
ossimRefPtr< ossimMapProjection > theMapProjection
virtual ossimDpt getMetersPerPixel() const
ossim_float64 theMeanGSD

◆ lineSampleHeightToWorld()

void ossimAdjMapModel::lineSampleHeightToWorld ( const ossimDpt image_point,
const double &  heightEllipsoid,
ossimGpt worldPoint 
) const
virtual

Overrides base class pure virtual.

Implements ossimSensorModel.

Definition at line 198 of file ossimAdjMapModel.cpp.

References ossimGpt::height(), ossimMapProjection::lineSampleHeightToWorld(), ossim::nan(), OFFSET_X, OFFSET_Y, SCALE_X, SCALE_Y, theAdjParams, theCosTheta, theMapProjection, theSinTheta, ossimDpt::x, x, ossimDpt::y, and y.

Referenced by lineSampleToWorld().

201 {
202  // Just call other transform method
203  // Check for bad map projection pointer:
204  if (!theMapProjection)
205  {
206  worldPoint = ossimGpt(ossim::nan(), ossim::nan(), ossim::nan());
207  return;
208  }
209 
210  // Adjust image point by transform:
211  double x = theAdjParams[SCALE_X]*(image_point.x - theAdjParams[OFFSET_X]);
212  double y = theAdjParams[SCALE_Y]*(image_point.y - theAdjParams[OFFSET_Y]);
213  ossimDpt adjusted_point(x*theCosTheta + y*theSinTheta,
215 
216  // Obtain ground point given adjusted image point:
218  heightEllipsoid,
219  worldPoint);
220  worldPoint.height(heightEllipsoid);
221 }
ossim_uint32 x
ossim_uint32 y
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
double y
Definition: ossimDpt.h:165
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
double height() const
Definition: ossimGpt.h:107
double x
Definition: ossimDpt.h:164
ossimRefPtr< ossimMapProjection > theMapProjection
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...

◆ lineSampleToWorld()

void ossimAdjMapModel::lineSampleToWorld ( const ossimDpt image_point,
ossimGpt worldPoint 
) const
virtual

Overrides base class virtual.

Reimplemented from ossimSensorModel.

Definition at line 226 of file ossimAdjMapModel.cpp.

References ossimGpt::hasNans(), and lineSampleHeightToWorld().

228 {
229  lineSampleHeightToWorld(image_point, 0.0, worldPoint);
230  if (!worldPoint.hasNans())
231  {
232 // worldPoint.height(theElevation->getHeightAboveEllipsoid(worldPoint));
233  }
234 }
bool hasNans() const
Definition: ossimGpt.h:135
virtual void lineSampleHeightToWorld(const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
Overrides base class pure virtual.

◆ loadState()

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

Fulfills ossimObject base-class pure virtuals.

Loads geometry KWL files. Returns true if successful.

Reimplemented from ossimSensorModel.

Definition at line 292 of file ossimAdjMapModel.cpp.

References ossimString::chars(), ossimMapProjectionFactory::createProjection(), ossimKeywordlist::find(), ossimMapProjectionFactory::instance(), ossimString::size(), theMapProjection, ossimKeywordNames::TYPE_KW, and TYPE_NAME.

Referenced by ossimAdjMapModel().

293 {
294  static const ossimString MODULE ("ossimAdjMapModel::loadState() -- ");
295  bool success = true;
296  const char* value_str;
297  double value;
298  ossimString error_msg (MODULE+"Error encountered reading keyword: ");
299 
300  try
301  {
302  // Verify correct model type:
303  value_str = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
304  if ((!value_str) || (strcmp(value_str, TYPE_NAME(this))))
305  {
306  throw (error_msg + ossimKeywordNames::TYPE_KW);
307  }
308 
309  ossimString map_prefix(prefix);
310  if (map_prefix.size() && (map_prefix[map_prefix.size()-1] != '.'))
311  map_prefix += ".";
312  map_prefix += "map_proj.";
313  theMapProjection = dynamic_cast<ossimMapProjection*>(
314  ossimMapProjectionFactory::instance()->createProjection(kwl, map_prefix.chars()));
315 
316  //---
317  // Instantiate the map projection via the factory if one has not been
318  // initialized yet:
319  //---
320  if (!theMapProjection)
321  {
322  // should find the map projection filename in the KWL:
323  value_str = kwl.find(prefix, MAP_PROJ_FILE_KW);
324  if (!value_str)
325  {
326  throw (error_msg + MAP_PROJ_FILE_KW);
327  }
329  ossimMapProjectionFactory::instance()->createProjection(ossimKeywordlist(value_str)));
330  if (!theMapProjection)
331  {
332  throw "Error encountered instantiating map ";
333  }
334  }
335 
336  // Hand off to base class for common stuff:
337  ossimSensorModel::loadState(kwl, prefix);
338 
339  // Everything OK so far, just load in the adjustable parameters. This involves modifying the
340  // center value of the bsae class adjustable parameter:
341  for (int i=0; i<NUM_ADJ_PARAMS; i++)
342  {
343  value_str = kwl.find(prefix, PARAMETER_KEYWORDS[i]);
344  if (!value_str)
345  {
346  throw (error_msg + PARAMETER_KEYWORDS[i]).chars();
347  }
348  value = atof(value_str);
349  setParameterCenter(i, value);
350  }
351  }
352  catch (const char* /*message*/)
353  {
354  theErrorStatus++;
355  success = false;
356  }
357 
358  //---
359  // updateModel() reads the base class adjustable parameters and initializes
360  // theAdjParams
361  // with the unnormalized, biased (to the "center" set above) quantities
362  // used in the projection:
363  //---
364  if (success)
365  {
367  updateModel();
368  }
369 
370  return success;
371 }
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
takes a filename.
#define TYPE_NAME(p)
Definition: ossimRtti.h:326
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Represents serializable keyword/value map.
const char * find(const char *key) const
static ossimMapProjectionFactory * instance()
static const char * TYPE_KW
virtual void updateModel()
Following a change to the adjustable parameter set, this virtual is.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
bool initializeFromMap()
Initializes base class data members after map model established.
ossimRefPtr< ossimMapProjection > theMapProjection
void setParameterCenter(ossim_uint32 idx, double center, bool notify=false)

◆ print()

std::ostream & ossimAdjMapModel::print ( std::ostream &  out) const
virtual

Extends base-class implementation. Dumps contents of object to ostream.

Reimplemented from ossimSensorModel.

Definition at line 403 of file ossimAdjMapModel.cpp.

References NUM_ADJ_PARAMS, and ossimSensorModel::print().

404 {
406  for (int i=0; i<NUM_ADJ_PARAMS; i++)
407  out << PARAMETER_KEYWORDS[i] << ": " << theAdjParams[i] << endl;
408  out << endl;
409 
410  return out;
411 }
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
virtual std::ostream & print(std::ostream &out) const

◆ saveState()

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

Fulfills ossimObject base-class pure virtuals.

Loads and saves geometry KWL files. Returns true if successful.

Saves geometry KWL files. Returns true if successful.

Reimplemented from ossimSensorModel.

Definition at line 265 of file ossimAdjMapModel.cpp.

References ossimKeywordlist::add(), ossimString::chars(), NUM_ADJ_PARAMS, ossimMapProjection::saveState(), ossimSensorModel::saveState(), ossimString::size(), theMapProjection, ossimKeywordNames::TYPE_KW, and ossimRefPtr< T >::valid().

266 {
267  // Save off map projection info:
268  if (theMapProjection.valid())
269  {
270  ossimString map_prefix(prefix);
271  if (map_prefix.size() && (map_prefix[map_prefix.size()-1] != '.'))
272  map_prefix += ".";
273  map_prefix += "map_proj.";
274  theMapProjection->saveState(kwl, map_prefix.chars());
275  }
276 
277  // Hand off to base class for common stuff:
278  ossimSensorModel::saveState(kwl, prefix);
279 
280  // Save off data members:
281  kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimAdjMapModel");
282  for (int i=0; i<NUM_ADJ_PARAMS; i++)
283  kwl.add(prefix, PARAMETER_KEYWORDS[i], theAdjParams[i]);
284 
285  return true;
286 }
bool valid() const
Definition: ossimRefPtr.h:75
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
static const char * TYPE_KW
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
ossimRefPtr< ossimMapProjection > theMapProjection

◆ updateModel()

void ossimAdjMapModel::updateModel ( )
virtual

Following a change to the adjustable parameter set, this virtual is.

Following a change to the adjustable parameter set, this virtual is called to permit instances to compute derived quantities after parameter change.

instances to compute derived quantities after parameter change.

Reimplemented from ossimSensorModel.

Definition at line 186 of file ossimAdjMapModel.cpp.

References ossimAdjustableParameterInterface::computeParameterOffset(), ossim::cosd(), NUM_ADJ_PARAMS, ROTATION, ossim::sind(), theAdjParams, theCosTheta, and theSinTheta.

Referenced by initAdjustableParameters().

187 {
188  for (int i=0; i<NUM_ADJ_PARAMS; i++)
190 
193 }
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
double sind(double x)
Definition: ossimCommon.h:260
double cosd(double x)
Definition: ossimCommon.h:259

◆ useForward()

virtual bool ossimAdjMapModel::useForward ( ) const
inlinevirtual

ossimOptimizableProjection

Implements ossimOptimizableProjection.

Definition at line 117 of file ossimAdjMapModel.h.

117 {return true;}

◆ worldToLineSample()

void ossimAdjMapModel::worldToLineSample ( const ossimGpt world_point,
ossimDpt image_point 
) const
virtual

Rigorous inverse transform implented, overrides base-class' iterative.

Rigorous inverse transform implented, overrides base-class' iterative solution.

Reimplemented from ossimSensorModel.

Definition at line 240 of file ossimAdjMapModel.cpp.

References ossim::nan(), OFFSET_X, OFFSET_Y, SCALE_X, SCALE_Y, theAdjParams, theCosTheta, theMapProjection, theSinTheta, ossimMapProjection::worldToLineSample(), ossimDpt::x, and ossimDpt::y.

242 {
243  // Check for bad map projection pointer:
244  if (!theMapProjection)
245  {
246  image_point = ossimDpt(ossim::nan(), ossim::nan());
247  return;
248  }
249 
250  // Obtain non-adjusted image point given ground point:
251  ossimDpt p1;
252  theMapProjection->worldToLineSample(world_point, p1);
253 
254  // Adjust image point by transform:
255  ossimDpt p2 (p1.x*theCosTheta - p1.y*theSinTheta,
256  p1.y*theCosTheta + p1.x*theSinTheta);
257  image_point.x = p2.x/theAdjParams[SCALE_X] + theAdjParams[OFFSET_X];
258  image_point.y = p2.y/theAdjParams[SCALE_Y] + theAdjParams[OFFSET_Y];
259 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
virtual ossimDpt worldToLineSample(const ossimGpt &worldPoint) const
double y
Definition: ossimDpt.h:165
ColumnVector theAdjParams
This is the vector of UNNORMALIZED, BIASED parameters as used in the model.
double x
Definition: ossimDpt.h:164
ossimRefPtr< ossimMapProjection > theMapProjection

◆ writeGeomTemplate()

void ossimAdjMapModel::writeGeomTemplate ( ostream &  os)
static

Writes a template of geom keywords processed by loadState and saveState.

Writes a template of geom keywords processed by loadState and saveState to output stream.

Definition at line 377 of file ossimAdjMapModel.cpp.

References ossimKeywordNames::TYPE_KW, and ossimSensorModel::writeGeomTemplate().

378 {
379  os <<
380  "//*****************************************************************\n"
381  "// Template for Adjustable Map Model keywordlist\n"
382  "//*****************************************************************\n"
383  << ossimKeywordNames::TYPE_KW << ": " << "ossimFcsiModel" << endl;
384 
386 
387  os << "//***\n"
388  << "// Derived-class AdjMapModel Keywords:\n"
389  << "//***\n"
390  << PARAMETER_KEYWORDS[OFFSET_X] << ": <east offset meters>\n"
391  << PARAMETER_KEYWORDS[OFFSET_Y] << ": <north offset meters>\n"
392  << PARAMETER_KEYWORDS[ROTATION] << ": <degrees CW>\n"
393  << PARAMETER_KEYWORDS[SCALE_X] << ": <ratio>\n"
394  << PARAMETER_KEYWORDS[SCALE_Y] << ": <ratio>\n"
395  << endl;
396 
397  return;
398 }
static const char * TYPE_KW
static void writeGeomTemplate(ostream &os)

Member Data Documentation

◆ theAdjParams

ColumnVector ossimAdjMapModel::theAdjParams
private

This is the vector of UNNORMALIZED, BIASED parameters as used in the model.

The collection of normalized, 0-biased, parameters used in registration are found in the ossimAdjustableParameterInterface and related classes. The quantities here are computed given the base class quantities.

Definition at line 128 of file ossimAdjMapModel.h.

Referenced by lineSampleHeightToWorld(), ossimAdjMapModel(), updateModel(), worldToLineSample(), and ~ossimAdjMapModel().

◆ theCosTheta

double ossimAdjMapModel::theCosTheta
private

Definition at line 131 of file ossimAdjMapModel.h.

Referenced by lineSampleHeightToWorld(), updateModel(), and worldToLineSample().

◆ theMapProjection

ossimRefPtr<ossimMapProjection> ossimAdjMapModel::theMapProjection
private

◆ theSinTheta

double ossimAdjMapModel::theSinTheta
private

Definition at line 132 of file ossimAdjMapModel.h.

Referenced by lineSampleHeightToWorld(), updateModel(), and worldToLineSample().


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