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

#include <ossimIkonosRpcModel.h>

Inheritance diagram for ossimIkonosRpcModel:
ossimRpcModel ossimSensorModel ossimProjection ossimOptimizableProjection ossimAdjustableParameterInterface ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimIkonosRpcModel ()
 
 ossimIkonosRpcModel (const ossimFilename &geom_file)
 
 ossimIkonosRpcModel (const ossimFilename &metadata, const ossimFilename &rpcdata)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 saveState Fulfills ossimObject base-class pure virtuals. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 loadState Fulfills ossimObject base-class pure virtuals. More...
 
virtual bool parseFile (const ossimFilename &file)
 
- Public Member Functions inherited from ossimRpcModel
 ossimRpcModel ()
 default constructor More...
 
 ossimRpcModel (const ossimRpcModel &copy_this)
 copy construtor More...
 
void setAttributes (ossim_float64 theSampleOffset, ossim_float64 theLineOffset, ossim_float64 theSampleScale, ossim_float64 theLineScale, ossim_float64 theLatOffset, ossim_float64 theLonOffset, ossim_float64 theHeightOffset, ossim_float64 theLatScale, ossim_float64 theLonScale, ossim_float64 theHeightScale, const std::vector< double > &xNumeratorCoeffs, const std::vector< double > &xDenominatorCoeffs, const std::vector< double > &yNumeratorCoeffs, const std::vector< double > &yDenominatorCoeffs, PolynomialType polyType=B, bool computeGsdFlag=true)
 
void setMetersPerPixel (const ossimDpt &metersPerPixel)
 
void setPositionError (const ossim_float64 &biasError, const ossim_float64 &randomError, bool initNominalPostionErrorFlag)
 Sets data member theBiasError, theRandError. More...
 
virtual void worldToLineSample (const ossimGpt &world_point, ossimDpt &image_point) const
 worldToLineSample() Overrides base class implementation. More...
 
virtual std::ostream & print (std::ostream &out) const
 print() Extends base-class implementation. More...
 
virtual void lineSampleToWorld (const ossimDpt &image_point, ossimGpt &world_point) const
 
virtual void lineSampleHeightToWorld (const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
 
virtual void imagingRay (const ossimDpt &image_point, ossimEcefRay &image_ray) const
 imagingRay() Overrides base class pure virtual. More...
 
virtual void updateModel ()
 
virtual void initAdjustableParameters ()
 
virtual ossimObjectdup () const
 dup() Returns pointer to a new instance, copy of this. More...
 
virtual bool useForward () const
 
virtual bool setupOptimizer (const ossimString &init_file)
 uses file path to init model More...
 
virtual ossimDpt getForwardDeriv (int parmIdx, const ossimGpt &gpos, double h)
 Compute partials of samp/line WRT ground point. More...
 
double getBiasError () const
 Returns Error - Bias. More...
 
double getRandError () const
 Returns Error - Random. More...
 
void getRpcParameters (ossimRpcModel::rpcModelStruct &model) const
 Returns RPC parameter set in structure. More...
 
void setImageOffset (const ossimDpt &offset_to_chip_ul)
 Allows setting an offset to a subimage while using the coefficients of a full-image model. More...
 
bool toJSON (std::ostream &json) const
 Serializes RPC to JSON format. More...
 
bool toRPB (std::ostream &out) const
 Serialize to WorldView-style .RPB file to the stream provided. More...
 
- 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 ossimDpt getMetersPerPixel () 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...
 
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 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)
 
- 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)
 
- Static Public Member Functions inherited from ossimRpcModel
static void writeGeomTemplate (ostream &os)
 STATIC METHOD: writeGeomTemplate(ostream) Writes a template of geom keywords processed by loadState and saveState to output stream. More...
 
- Static Public Member Functions inherited from ossimSensorModel
static void writeGeomTemplate (ostream &os)
 

Protected Member Functions

virtual ~ossimIkonosRpcModel ()
 
void finishConstruction ()
 
void parseMetaData (const ossimFilename &metadata)
 
void parseRpcData (const ossimFilename &rpcdata)
 
bool isNitf (const ossimFilename &filename)
 
bool parseTiffFile (const ossimFilename &filename)
 
bool parseHdrData (const ossimFilename &data_file)
 
- Protected Member Functions inherited from ossimRpcModel
virtual ~ossimRpcModel ()
 virtual destructor More...
 
double polynomial (const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
 
double dPoly_dLat (const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
 
double dPoly_dLon (const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
 
double dPoly_dHgt (const double &nlat, const double &nlon, const double &nhgt, const double *coeffs) const
 
- 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

ossimRefPtr< ossimIkonosMetaDatatheSupportData
 
- Protected Attributes inherited from ossimRpcModel
PolynomialType thePolyType
 
double theLineScale
 
double theSampScale
 
double theLatScale
 
double theLonScale
 
double theHgtScale
 
double theLineOffset
 
double theSampOffset
 
double theLatOffset
 
double theLonOffset
 
double theHgtOffset
 
double theIntrackOffset
 
double theCrtrackOffset
 
double theIntrackScale
 
double theCrtrackScale
 
double theCosMapRot
 
double theSinMapRot
 
double theBiasError
 error More...
 
double theRandError
 
double theLineNumCoef [20]
 
double theLineDenCoef [20]
 
double theSampNumCoef [20]
 
double theSampDenCoef [20]
 
- 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
 

Additional Inherited Members

- Public Types inherited from ossimRpcModel
enum  PolynomialType { A ='A', B ='B' }
 
- 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
}
 
- Protected Types inherited from ossimRpcModel
enum  AdjustParamIndex {
  INTRACK_OFFSET = 0, CRTRACK_OFFSET, INTRACK_SCALE, CRTRACK_SCALE,
  MAP_ROTATION, NUM_ADJUSTABLE_PARAMS
}
 

Detailed Description


CLASS: ossimIkonosRpcModel

Definition at line 32 of file ossimIkonosRpcModel.h.

Constructor & Destructor Documentation

◆ ossimIkonosRpcModel() [1/3]

ossimIkonosRpcModel::ossimIkonosRpcModel ( )

Definition at line 57 of file ossimIkonosRpcModel.cpp.

58  :ossimRpcModel(),
60 {
61 }
ossimRefPtr< ossimIkonosMetaData > theSupportData
ossimRpcModel()
default constructor

◆ ossimIkonosRpcModel() [2/3]

ossimIkonosRpcModel::ossimIkonosRpcModel ( const ossimFilename geom_file)

Definition at line 70 of file ossimIkonosRpcModel.cpp.

71  : ossimRpcModel(),
73 {
74  if (traceExec())
75  {
77  << "DEBUG ossimIkonosRpcModel Constructor #1: entering..."
78  << std::endl;
79  }
80 
81  ossimKeywordlist kwl(geom_file);
82  const char* value;
83 
84  //***
85  // Assure this keywordlist contains correct type info:
86  //***
87  value = kwl.find(ossimKeywordNames::TYPE_KW);
88  if (!value || (strcmp(value, "ossimIkonosRpcModel")))
89  {
90  if (traceDebug())
91  {
93  << "DEBUG ossimIkonosRpcModel Constructor #1:"
94  << "\nFailed attempt to construct. sensor type \""<<value
95  << "\" does not match \"ossimIkonosRpcModel\"." << std::endl;
96  }
97 
99  if (traceExec())
100  {
102  << "DEBUG ossimIkonosRpcModel Constructor #1: returning..."
103  << std::endl;
104  }
105  return;
106  }
107 
108  //***
109  // Read meta data filename from geom file:
110  //***
111  value = kwl.find(META_DATA_FILE);
112  if (!value)
113  {
114  theErrorStatus++;
115  if (traceExec())
116  {
118  << "DEBUG ossimIkonosRpcModel Constructor #1: returning..."
119  << std::endl;
120  }
121  return;
122  }
123 
124  ossimFilename metadata (value);
125 
126  //***
127  // Read RPC data filename from geom file:
128  //***
129  value = kwl.find(RPC_DATA_FILE);
130  if (!value)
131  {
132  theErrorStatus++;
133  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel Constructor #1: returning..." << std::endl;
134  return;
135  }
136  ossimFilename rpcdata (value);
137 
138  parseMetaData(metadata);
139  parseRpcData (rpcdata);
141 
142  ossimString drivePart;
143  ossimString pathPart;
144  ossimString filePart;
145  ossimString extPart;
146  geom_file.split(drivePart,
147  pathPart,
148  filePart,
149  extPart);
150 
151 
152 
153  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG returning..." << std::endl;
154 
155  return;
156 }
Represents serializable keyword/value map.
void split(ossimString &drivePart, ossimString &pathPart, ossimString &filePart, ossimString &extPart) const
ossimRefPtr< ossimIkonosMetaData > theSupportData
static const char * TYPE_KW
ossimRpcModel()
default constructor
void parseRpcData(const ossimFilename &rpcdata)
void parseMetaData(const ossimFilename &metadata)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ossimIkonosRpcModel() [3/3]

ossimIkonosRpcModel::ossimIkonosRpcModel ( const ossimFilename metadata,
const ossimFilename rpcdata 
)

Definition at line 164 of file ossimIkonosRpcModel.cpp.

166  :
167  ossimRpcModel(),
169 {
170  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel Constructor #2: entering..." << std::endl;
171 
172  parseMetaData(metadata);
173  parseRpcData (rpcdata);
175 
176  //***
177  // Save current state in RPC model format:
178  //***
179  ossimString drivePart;
180  ossimString pathPart;
181  ossimString filePart;
182  ossimString extPart;
183  metadata.split(drivePart,
184  pathPart,
185  filePart,
186  extPart);
187 
188  ossimFilename init_rpc_geom;
189  init_rpc_geom.merge(drivePart,
190  pathPart,
192  "");
193 // (metadata.path().dirCat(ossimRpcModel::INIT_RPC_GEOM_FILENAME));
194  ossimKeywordlist kwl (init_rpc_geom);
195  saveState(kwl);
196 
197  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel Constructor #2: returning..." << std::endl;
198 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
saveState Fulfills ossimObject base-class pure virtuals.
Represents serializable keyword/value map.
void split(ossimString &drivePart, ossimString &pathPart, ossimString &filePart, ossimString &extPart) const
ossimRefPtr< ossimIkonosMetaData > theSupportData
ossimRpcModel()
default constructor
const ossimFilename INIT_RPC_GEOM_FILENAME("rpc_init.geom")
void parseRpcData(const ossimFilename &rpcdata)
void parseMetaData(const ossimFilename &metadata)
void merge(const ossimString &drivePart, const ossimString &pathPart, const ossimString &filePart, const ossimString &extPart)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ~ossimIkonosRpcModel()

ossimIkonosRpcModel::~ossimIkonosRpcModel ( )
protectedvirtual

Definition at line 200 of file ossimIkonosRpcModel.cpp.

References theSupportData.

201 {
202  theSupportData = 0;
203 }
ossimRefPtr< ossimIkonosMetaData > theSupportData

Member Function Documentation

◆ finishConstruction()

void ossimIkonosRpcModel::finishConstruction ( )
protected

Definition at line 209 of file ossimIkonosRpcModel.cpp.

210 {
211  if (traceExec())
212  {
214  << "DEBUG ossimIkonosRpcModel finishConstruction(): entering..."
215  << std::endl;
216  }
217 
218  //***
219  // Assign other data members:
220  //***
221  thePolyType = B; // This may not be true for early RPC imagery
227 
228  //***
229  // Assign the bounding image space rectangle:
230  //***
231  theImageClipRect = ossimDrect(0.0, 0.0,
233 
234  //---
235  // NOTE: We must call "updateModel()" to set parameter used by base
236  // ossimRpcModel prior to calling lineSampleHeightToWorld or all
237  // the world points will be same.
238  //---
239  updateModel();
240 
241  //***
242  // Assign the bounding ground polygon:
243  //***
244  ossimGpt v0, v1, v2, v3;
245  ossimDpt ip0 (0.0, 0.0);
246  lineSampleHeightToWorld(ip0, 0.0, v0);
247  ossimDpt ip1 (theImageSize.samp-1.0, 0.0);
248  lineSampleHeightToWorld(ip1, 0.0, v1);
249  ossimDpt ip2 (theImageSize.samp-1.0, theImageSize.line-1.0);
250  lineSampleHeightToWorld(ip2, 0.0, v2);
251  ossimDpt ip3 (0.0, theImageSize.line-1.0);
252  lineSampleHeightToWorld(ip3, 0.0, v3);
254  = ossimPolygon (ossimDpt(v0), ossimDpt(v1), ossimDpt(v2), ossimDpt(v3));
255 
256  //---
257  // Call compute gsd:
258  //
259  // This will set theGSD and theMeanGSD using lineSampleHeightToWorld on
260  // three image points. Previously this was pulled from metadata. Some of
261  // which was in US Survey feet and not converted to meters. This method
262  // is more accurate as it uses the sensor model to compute.
263  //---
264  try
265  {
266  // Method throws ossimException.
267  computeGsd();
268  }
269  catch (const ossimException& e)
270  {
272  << "ossimIkonosRpcModel finishConstruction Caught Exception:\n"
273  << e.what() << std::endl;
274  }
275 
276  if (traceExec())
277  {
279  << "DEBUG ossimIkonosRpcModel finishConstruction(): returning..."
280  << std::endl;
281  }
282 }
double theSampOffset
PolynomialType thePolyType
double samp
Definition: ossimDpt.h:164
virtual void updateModel()
ossim_float64 hgt
Height in meters above the ellipsiod.
Definition: ossimGpt.h:274
double theLatOffset
double theHgtOffset
double theLonOffset
void computeGsd()
This method computes the ground sample distance(gsd) and sets class attributes theGSD and theMeanGSD ...
double line
Definition: ossimDpt.h:165
ossim_float64 lon
Definition: ossimGpt.h:266
virtual const char * what() const
Returns the error message.
ossimPolygon theBoundGndPolygon
virtual void lineSampleHeightToWorld(const ossimDpt &image_point, const double &heightEllipsoid, ossimGpt &worldPoint) const
ossimDrect theImageClipRect
ossim_int32 samp
Definition: ossimIpt.h:141
ossim_int32 line
Definition: ossimIpt.h:142
ossim_float64 lat
Definition: ossimGpt.h:265
double theLineOffset
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ isNitf()

bool ossimIkonosRpcModel::isNitf ( const ossimFilename filename)
protected

Definition at line 970 of file ossimIkonosRpcModel.cpp.

References ossimString::c_str().

971 {
972  std::ifstream in(filename.c_str(), ios::in|ios::binary);
973 
974  if(in)
975  {
976  char nitfFile[4];
977  in.read((char*)nitfFile, 4);
978 
979  return (ossimString(nitfFile,
980  nitfFile+4) == "NITF");
981  }
982 
983  return false;
984 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ loadState()

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

loadState Fulfills ossimObject base-class pure virtuals.

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

Reimplemented from ossimRpcModel.

Definition at line 868 of file ossimIkonosRpcModel.cpp.

References ossimIkonosMetaData::loadState(), ossimRpcModel::loadState(), theSupportData, and ossimRefPtr< T >::valid().

870 {
871  if(theSupportData.valid())
872  {
873  ossimString supportPrefix = ossimString(prefix) + "support_data.";
874  theSupportData->loadState(kwl, supportPrefix);
875  }
876 
877  return ossimRpcModel::loadState(kwl, prefix);
878 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimIkonosMetaData > theSupportData
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
loadState Fulfills ossimObject base-class pure virtuals.

◆ parseFile()

bool ossimIkonosRpcModel::parseFile ( const ossimFilename file)
virtual

Definition at line 880 of file ossimIkonosRpcModel.cpp.

References parseTiffFile().

881 {
882  return parseTiffFile(file);
883 }
bool parseTiffFile(const ossimFilename &filename)

◆ parseHdrData()

bool ossimIkonosRpcModel::parseHdrData ( const ossimFilename data_file)
protected

Definition at line 454 of file ossimIkonosRpcModel.cpp.

455 {
456  if (traceExec())
457  {
459  << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): entering..."
460  << std::endl;
461  }
462 
463  if( !data_file.exists() )
464  {
465  if (traceDebug())
466  {
468  << "ossimIkonosRpcModel::parseHdrData(data_file) WARN:"
469  << "\nrpc data file <" << data_file << ">. "<< "doesn't exist..."
470  << std::endl;
471  }
472  return false;
473  }
474 
475  FILE* fptr = fopen (data_file, "r");
476  if (!fptr)
477  {
478  ++theErrorStatus;
479 
480  if (traceDebug())
481  {
483  << "ossimIkonosRpcModel::parseHdrData(data_file) WARN:"
484  << "\nCould not open hdr data file <" << data_file << ">. "
485  << "returning with error..." << std::endl;
486  }
487  return false;
488  }
489 
490  char* strptr = 0;
491  // char linebuf[80];
492  char dummy[80];
493  // , name[80];
494 
495  //***
496  // Read the file into a buffer:
497  //***
498  char filebuf[5000];
499  fread(filebuf, 1, 5000, fptr);
500 
501  //***
502  // GSD: NOTE - this will be recomputed by computeGsd method later.
503  //***
504  strptr = strstr(filebuf, "\nPixel Size X:");
505  if (!strptr)
506  {
507  if(traceDebug())
508  {
510  << "ossimIkonosRpcModel::parseHdrData(data_file):"
511  << "\n\tAborting construction. Error encountered parsing "
512  << "presumed hdr file." << endl;
513  }
514 
515  fclose( fptr ); // cleanup
516  fptr = 0;
517  return false;
518  }
519 
520  sscanf(strptr, "%14c %lf", dummy, &theGSD.samp);
521  strptr = strstr(strptr, "\nPixel Size Y:");
522  if (!strptr)
523  {
524  if(traceDebug())
525  {
527  << "ossimIkonosRpcModel::parseHdrData(data_file): "
528  << "\n\tAborting construction. Error encountered parsing "
529  << "presumed hdr file." << endl;
530  }
531 
532  fclose( fptr ); // cleanup
533  fptr = 0;
534  return false;
535  }
536 
537  sscanf(strptr, "%14c %lf", dummy, &theGSD.line);
538 
539  //***
540  // Image size:
541  //***
542  strptr = strstr(strptr, "\nColumns:");
543  if (!strptr)
544  {
545  if(traceDebug())
546  {
548  << "ossimIkonosRpcModel::parseHdrData(data_file): "
549  << "\n\tAborting construction. Error encountered parsing "
550  << "presumed hdr file." << endl;
551  }
552 
553  fclose( fptr ); // cleanup
554  fptr = 0;
555  return false;
556  }
557  sscanf(strptr, "%s %d", dummy, &theImageSize.samp);
558  strptr = strstr(strptr, "\nRows:");
559  if (!strptr)
560  {
561  if(traceDebug())
562  {
564  << "ossimIkonosRpcModel::parseHdrData(data_file): "
565  << "\n\tAborting construction. Error encountered parsing "
566  << "presumed hdr file." << endl;
567  }
568  fclose( fptr ); // cleanup
569  fptr = 0;
570 
571  return false;
572  }
573  sscanf(strptr, "%s %d", dummy, &theImageSize.line);
574 
575  fclose( fptr ); // cleanup
576  fptr = 0;
577 
578  if (traceExec())
579  {
581  << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): returning..."
582  << std::endl;
583  }
584  return true;
585 }
std::basic_filebuf< char > filebuf
Class for char file buffers.
Definition: ossimIosFwd.h:41
double samp
Definition: ossimDpt.h:164
double line
Definition: ossimDpt.h:165
bool exists() const
ossim_int32 samp
Definition: ossimIpt.h:141
ossim_int32 line
Definition: ossimIpt.h:142
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ parseMetaData()

void ossimIkonosRpcModel::parseMetaData ( const ossimFilename metadata)
protected

Definition at line 290 of file ossimIkonosRpcModel.cpp.

291 {
292  if (traceExec())
293  {
295  << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): entering..."
296  << std::endl;
297  }
298 
299  FILE* fptr = fopen (data_file, "r");
300  if (!fptr)
301  {
302  ++theErrorStatus;
303  if (traceExec())
304  {
306  << "ossimIkonosRpcModel::parseMetaData(data_file) DEBUG:"
307  << "\nCould not open Meta data file: " << data_file
308  << "\nreturning with error..." << std::endl;
309  }
310  return;
311  }
312 
313  char* strptr;
314  // char linebuf[80];
315  char dummy[80], name[80];
316 
317  //***
318  // Read the file into a buffer:
319  //***
320  char filebuf[5000];
321  fread(filebuf, 1, 5000, fptr);
322 
323  //***
324  // Image ID:
325  //***
326  strptr = strstr(filebuf, "\nSource Image ID:");
327  if (!strptr)
328  {
329  if (traceDebug())
330  {
332  << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
333  << "\n\tAborting construction. Error encountered parsing "
334  << "presumed meta-data file." << endl;
335  }
336 
337  fclose( fptr );
338  fptr = 0;
339  return;
340  }
341 
342  sscanf(strptr, "%17c %s", dummy, name);
343  theImageID = name;
344 
345  //***
346  // Sensor Type:
347  //***
348  strptr = strstr(strptr, "\nSensor:");
349  if (!strptr)
350  {
351  if(traceDebug())
352  {
354  << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
355  << "\n\tAborting construction. Error encountered parsing "
356  << "presumed meta-data file." << endl;
357  }
358  fclose(fptr);
359  fptr = 0;
360  return;
361  }
362  sscanf(strptr, "%8c %s", dummy, name);
363  theSensorID = name;
364 
365  //***
366  // GSD: NOTE - this will be recomputed by computeGsd method later.
367  //***
368  strptr = strstr(strptr, "\nPixel Size X:");
369  if (!strptr)
370  {
371  if(traceDebug())
372  {
374  << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
375  << "\n\tAborting construction. Error encountered parsing "
376  << "presumed meta-data file." << endl;
377 
378  }
379  fclose(fptr);
380  fptr = 0;
381  return;
382  }
383 
384  sscanf(strptr, "%14c %lf", dummy, &theGSD.samp);
385  strptr = strstr(strptr, "\nPixel Size Y:");
386  if (!strptr)
387  {
388  if(traceDebug())
389  {
391  << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
392  << "\n\tAborting construction. Error encountered parsing "
393  << "presumed meta-data file." << endl;
394 
395  }
396  fclose(fptr);
397  fptr = 0;
398  return;
399  }
400  sscanf(strptr, "%14c %lf", dummy, &theGSD.line);
401 
402  //***
403  // Image size:
404  //***
405  strptr = strstr(strptr, "\nColumns:");
406  if (!strptr)
407  {
408  if(traceDebug())
409  {
411  << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
412  << "\n\tAborting construction. Error encountered parsing "
413  << "presumed meta-data file." << endl;
414  }
415 
416  fclose(fptr);
417  fptr = 0;
418  return;
419  }
420  sscanf(strptr, "%s %d", dummy, &theImageSize.samp);
421  strptr = strstr(strptr, "\nRows:");
422  if (!strptr)
423  {
424  if(traceDebug())
425  {
427  << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
428  << "\n\tAborting construction. Error encountered parsing "
429  << "presumed meta-data file." << endl;
430  }
431 
432  fclose(fptr);
433  fptr = 0;
434  return;
435  }
436  sscanf(strptr, "%s %d", dummy, &theImageSize.line);
437 
438  if (traceExec())
439  {
441  << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): returning..."
442  << std::endl;
443  }
444  fclose(fptr);
445  fptr = 0;
446 }
ossimString theSensorID
std::basic_filebuf< char > filebuf
Class for char file buffers.
Definition: ossimIosFwd.h:41
ossimString theImageID
double samp
Definition: ossimDpt.h:164
double line
Definition: ossimDpt.h:165
ossim_int32 samp
Definition: ossimIpt.h:141
ossim_int32 line
Definition: ossimIpt.h:142
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ parseRpcData()

void ossimIkonosRpcModel::parseRpcData ( const ossimFilename rpcdata)
protected

Definition at line 593 of file ossimIkonosRpcModel.cpp.

594 {
595  if (traceExec())
596  {
598  << "DEBUG ossimIkonosRpcModel::parseRpcData(data_file): entering..."
599  << std::endl;
600  }
601 
602  if( !data_file.exists() )
603  {
604  if (traceDebug())
605  {
607  << "ossimIkonosRpcModel::parseRpcData(data_file) WARN:"
608  << "\nrpc data file <" << data_file << ">. "<< "doesn't exist..."
609  << std::endl;
610  }
611  ++theErrorStatus;
612  return;
613  }
614 
615  //***
616  // The Ikonos RPC data file is conveniently formatted as KWL file:
617  //***
618  ossimKeywordlist kwl (data_file);
619  if (kwl.getErrorStatus())
620  {
622  << "ERROR ossimIkonosRpcModel::parseRpcData(data_file): Could not open RPC data file <" << data_file << ">. " << "Aborting..." << std::endl;
623  ++theErrorStatus;
624  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG)
625  << "returning with error..." << std::endl;
626  return;
627  }
628 
629  const char* buf;
630  const char* keyword;
631 
632  //***
633  // Parse data from KWL:
634  //***
635  keyword = LINE_OFF_KW;
636  buf = kwl.find(keyword);
637  if (!buf)
638  {
639  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
640  << "\nAborting construction. Error looking up keyword: "
641  << keyword << std::endl;
642  return;
643  }
644  theLineOffset = atof(buf);
645 
646  keyword = SAMP_OFF_KW;
647  buf = kwl.find(keyword);
648  if (!buf)
649  {
650  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
651  << "\nAborting construction. Error looking up keyword: "
652  << keyword << std::endl;
653  return;
654  }
655  theSampOffset = atof(buf);
656 
657  keyword = LAT_OFF_KW;
658  buf = kwl.find(keyword);
659  if (!buf)
660  {
661  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
662  << "\nAborting construction. Error looking up keyword: "
663  << keyword << std::endl;
664  return;
665  }
666 
667  theLatOffset = atof(buf);
668 
669  keyword = LONG_OFF_KW;
670  buf = kwl.find(keyword);
671  if (!buf)
672  {
673  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
674  << "\nAborting construction. Error looking up keyword: "
675  << keyword << std::endl;
676  return;
677  }
678  theLonOffset = atof(buf);
679 
680  keyword = HEIGHT_OFF_KW;
681  buf = kwl.find(keyword);
682  if (!buf)
683  {
684  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
685  << "\nAborting construction. Error looking up keyword: "
686  << keyword << std::endl;
687  return;
688  }
689 
690  theHgtOffset = atof(buf);
691 
692  keyword = LINE_SCALE_KW;
693  buf = kwl.find(keyword);
694  if (!buf)
695  {
696  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
697  << "\nAborting construction. Error looking up keyword: "
698  << keyword << std::endl;
699  return;
700  }
701  theLineScale = atof(buf);
702 
703  keyword = SAMP_SCALE_KW;
704  buf = kwl.find(keyword);
705  if (!buf)
706  {
707  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
708  << "\nAborting construction. Error looking up keyword: "
709  << keyword << std::endl;
710  return;
711  }
712  theSampScale = atof(buf);
713 
714  keyword = LAT_SCALE_KW;
715  buf = kwl.find(keyword);
716  if (!buf)
717  {
718  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
719  << "\nAborting construction. Error looking up keyword: "
720  << keyword << std::endl;
721  return;
722  }
723  else
724  {
725  // copy ossimIkonosMetada-sensor into ossimIkonosRpcModel-sensorId
727  }
728 
729 
730  theLatScale = atof(buf);
731 
732  keyword = LONG_SCALE_KW;
733  buf = kwl.find(keyword);
734  if (!buf)
735  {
736  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
737  << "\nAborting construction. Error looking up keyword: "
738  << keyword << std::endl;
739  return;
740  }
741  theLonScale = atof(buf);
742 
743  keyword = HEIGHT_SCALE_KW;
744  buf = kwl.find(keyword);
745  if (!buf)
746  {
747  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
748  << "\nAborting construction. Error looking up keyword: "
749  << keyword << std::endl;
750  return;
751  }
752 
753  theHgtScale = atof(buf);
754 
755  char kwbuf[32];
756  keyword = kwbuf;
757  for(int i=1; i<=20; i++)
758  {
759  sprintf(kwbuf, "%s%d", LINE_NUM_COEFF_KW, i);
760  buf = kwl.find(keyword);
761  if (!buf)
762  {
763  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
764  << "\nAborting construction. Error looking up keyword: "
765  << keyword << std::endl;
766  return;
767  }
768 
769  theLineNumCoef[i-1] = atof(buf);
770 
771  sprintf(kwbuf, "%s%d", LINE_DEN_COEFF_KW, i);
772  buf = kwl.find(keyword);
773  if (!buf)
774  {
775  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
776  << "\nAborting construction. Error looking up keyword: "
777  << keyword << std::endl;
778  return;
779  }
780  theLineDenCoef[i-1] = atof(buf);
781 
782  sprintf(kwbuf, "%s%d", SAMP_NUM_COEFF_KW, i);
783  buf = kwl.find(keyword);
784  if (!buf)
785  {
786  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
787  << "\nAborting construction. Error looking up keyword: "
788  << keyword << std::endl;
789  return;
790  }
791  theSampNumCoef[i-1] = atof(buf);
792 
793  sprintf(kwbuf, "%s%d", SAMP_DEN_COEFF_KW, i);
794  buf = kwl.find(keyword);
795  if (!buf)
796  {
797  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
798  << "\nAborting construction. Error looking up keyword: "
799  << keyword << std::endl;
800  return;
801  }
802  theSampDenCoef[i-1] = atof(buf);
803  }
804 
805  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel::parseRpcData(data_file): returning..." << std::endl;
806  return;
807 
808  theErrorStatus++;
809  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel::parseRpcData(data_file): returning with error..." << std::endl;
810 
811  return;
812 }
double theSampOffset
ossimString theSensorID
double theSampNumCoef[20]
Represents serializable keyword/value map.
ossimRefPtr< ossimIkonosMetaData > theSupportData
double theLonScale
double theLineScale
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
double theHgtOffset
double theLonOffset
double theLatScale
double theSampScale
double theLineDenCoef[20]
ossimString getSensorID() const
double theLineOffset
double theHgtScale
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ parseTiffFile()

bool ossimIkonosRpcModel::parseTiffFile ( const ossimFilename filename)
protected

Definition at line 885 of file ossimIkonosRpcModel.cpp.

References ossimIkonosMetaData::open(), ossimTiffTileSource::open(), and theSupportData.

Referenced by parseFile().

886 {
887  bool result = false;
888 
890 
891  if ( tiff->open(filename) )
892  {
893  if ( !theSupportData )
894  {
896  }
897 
898  if ( theSupportData->open(filename) == false )
899  {
900  if(traceDebug())
901  {
902  // Currently not required by model so we will not error out here.
904  << "WARNING: ossimIkonosMetaData::open returned false.\n"
905  << std::endl;
906  }
907  }
908  else
909  {
910  // copy ossimIkonosMetada-sensor into ossimIkonosRpcModel-sensorId
912  }
913 
914  //convert file to rpc filename and hdr filename so we can get some info
915  ossimFilename rpcfile = filename.noExtension();
916  rpcfile += "_rpc.txt";
917 
918  ossimFilename hdrfile = filename;
919  hdrfile.setExtension(ossimString("hdr"));
920 
921  if( parseHdrData(hdrfile) )
922  {
923  // parseRpcData sets the error status on error.
924  parseRpcData (rpcfile);
925  if ( !getErrorStatus() ) //check for errors in parsing rpc data
926  {
928 
929  //---
930  // Save current state in RPC model format:
931  //---
932  ossimString drivePart;
933  ossimString pathPart;
934  ossimString filePart;
935  ossimString extPart;
936  filename.split(drivePart,
937  pathPart,
938  filePart,
939  extPart);
940 
941  ossimFilename init_rpc_geom;
942  init_rpc_geom.merge(drivePart,
943  pathPart,
945  "");
946 
947  ossimKeywordlist kwl (init_rpc_geom);
948  saveState(kwl);
949 
950  // If we get here set the return status to true.
951  result = true;
952 
953  } // matches: if ( !getErrorStatus() )
954 
955  } // matches: if( parseHdrData(hdrfile) )
956 
957  } // matches: if ( tiff->open(filename) )
958 
959  if ( traceExec() )
960  {
962  << "return status: " << (result?"true\n":"false\n")
963  << "DEBUG ossimIkonosRpcModel parseTiffFile: returning..."
964  << std::endl;
965  }
966 
967  return result;
968 }
ossimString theSensorID
ossimFilename noExtension() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
saveState Fulfills ossimObject base-class pure virtuals.
Represents serializable keyword/value map.
void split(ossimString &drivePart, ossimString &pathPart, ossimString &filePart, ossimString &extPart) const
ossimRefPtr< ossimIkonosMetaData > theSupportData
const ossimFilename INIT_RPC_GEOM_FILENAME("rpc_init.geom")
void parseRpcData(const ossimFilename &rpcdata)
bool open(const ossimFilename &imageFile)
Open method that takes the image file, derives the metadata, header and rpc files, then calls parse methods parseMetaData, parseHdrData, and parseRpcData.
virtual ossimErrorCode getErrorStatus() const
virtual bool open(const ossimFilename &image_file)
Returns true if the image_file can be opened and is a valid tiff file.
void merge(const ossimString &drivePart, const ossimString &pathPart, const ossimString &filePart, const ossimString &extPart)
ossimString getSensorID() const
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
bool parseHdrData(const ossimFilename &data_file)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ saveState()

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

saveState Fulfills ossimObject base-class pure virtuals.

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

Reimplemented from ossimRpcModel.

Definition at line 842 of file ossimIkonosRpcModel.cpp.

References ossimIkonosMetaData::saveState(), ossimRpcModel::saveState(), theSupportData, and ossimRefPtr< T >::valid().

844 {
845  if(theSupportData.valid())
846  {
847  ossimString supportPrefix = ossimString(prefix) + "support_data.";
848  // copy ossimIkonosMetada-sensor into ossimIkonosRpcModel-sensorId
849  theSupportData->saveState(kwl, supportPrefix);
850  }
851 
852  ossimRpcModel::saveState(kwl, prefix);
853 
854  // this model just sets the base class values so
855  // we do not need to re-construct this model so
856  // specify the type as the base class type
857  //
858 // kwl.add(prefix,
859 // ossimKeywordNames::TYPE_KW,
860 // STATIC_TYPE_NAME(ossimRpcModel),
861 // true);
862 
863  // cout << "kwl:\n" << kwl << std::endl;
864 
865  return true;
866 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of the object to a keyword list.
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimIkonosMetaData > theSupportData
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
saveState Fulfills ossimObject base-class pure virtuals.

◆ writeGeomTemplate()

void ossimIkonosRpcModel::writeGeomTemplate ( ostream &  os)
static

STATIC METHOD: writeGeomTemplate(ostream) Writes a template of an ossimIkonosRpcModel geometry file.

Definition at line 820 of file ossimIkonosRpcModel.cpp.

821 {
822  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(os): entering..." << std::endl;
823 
824  os <<
825  "//**************************************************************\n"
826  "// Template for Ikonos RPC geometry keywordlist\n"
827  "//\n"
828  "// NOTE: It is preferable to select the full RPC geometry KWL \n"
829  "// that should have been created with the first use of the\n"
830  "// derived model type ossimIkonosRpcModel. Using this KWL \n"
831  "// implies that an initial geometry is being constructed \n"
832  "// with all adjustable parameters initialized to 0. \n"
833  "//**************************************************************\n"
834  << ossimKeywordNames::TYPE_KW << ": " << MODEL_TYPE << endl;
835  os << META_DATA_FILE << ": <string>\n"
836  << RPC_DATA_FILE << ": <string>\n" << endl;
837 
838  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(os): returning..." << std::endl;
839  return;
840 }
static const char * TYPE_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Data Documentation

◆ theSupportData

ossimRefPtr<ossimIkonosMetaData> ossimIkonosRpcModel::theSupportData
protected

Definition at line 71 of file ossimIkonosRpcModel.h.

Referenced by loadState(), parseTiffFile(), saveState(), and ~ossimIkonosRpcModel().


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