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

#include <ossimPleiadesModel.h>

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

Public Member Functions

 ossimPleiadesModel ()
 default constructor More...
 
 ossimPleiadesModel (const ossimPleiadesModel &rhs)
 copy constructor More...
 
virtual ~ossimPleiadesModel ()
 Destructor. More...
 
bool open (const ossimFilename &file)
 
virtual ossimObjectdup () const
 
virtual std::ostream & print (std::ostream &out) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=NULL) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=NULL)
 loadState Fulfills ossimObject base-class pure virtuals. More...
 
void setSupportData (ossimPleiadesDimapSupportData *supportData)
 
ossimPleiadesDimapSupportDatagetSupportData ()
 
const ossimPleiadesDimapSupportDatagetSupportData () const
 
- 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 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 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...
 

Protected Member Functions

bool parseMetaData (const ossimFilename &file)
 
bool parseRpcData (const ossimFilename &file)
 
void finishConstruction ()
 Collects common code among all parsers. More...
 
- 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< ossimPleiadesDimapSupportDatatheSupportData
 
ossimFilename _productXmlFile
 
- 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
}
 
- 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 Types inherited from ossimRpcModel
enum  AdjustParamIndex {
  INTRACK_OFFSET = 0, CRTRACK_OFFSET, INTRACK_SCALE, CRTRACK_SCALE,
  MAP_ROTATION, NUM_ADJUSTABLE_PARAMS
}
 

Detailed Description

Definition at line 43 of file ossimPleiadesModel.h.

Constructor & Destructor Documentation

◆ ossimPleiadesModel() [1/2]

ossimplugins::ossimPleiadesModel::ossimPleiadesModel ( )

default constructor

CONSTRUCTORS:

Definition at line 61 of file ossimPleiadesModel.cpp.

References ossimRpcModel::theLineDenCoef, ossimRpcModel::theLineNumCoef, ossimRpcModel::theSampDenCoef, and ossimRpcModel::theSampNumCoef.

Referenced by dup().

62  :ossimRpcModel (),
63  theSupportData (0)
64  {
65  for (unsigned int i = 0; i < 20; i++)
66  {
67  theLineDenCoef[i] = 0.0;
68  theLineNumCoef[i] = 0.0;
69  theSampNumCoef[i] = 0.0;
70  theSampDenCoef[i] = 0.0;
71  }
72  }
double theSampNumCoef[20]
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData
double theSampDenCoef[20]
double theLineNumCoef[20]
ossimRpcModel()
default constructor
double theLineDenCoef[20]

◆ ossimPleiadesModel() [2/2]

ossimplugins::ossimPleiadesModel::ossimPleiadesModel ( const ossimPleiadesModel rhs)

copy constructor

Definition at line 77 of file ossimPleiadesModel.cpp.

78  :ossimRpcModel (rhs),
79  theSupportData (0)
80  {
81  }
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData
ossimRpcModel()
default constructor

◆ ~ossimPleiadesModel()

ossimplugins::ossimPleiadesModel::~ossimPleiadesModel ( )
virtual

Destructor.

Definition at line 86 of file ossimPleiadesModel.cpp.

References ossimNotify(), ossimNotifyLevel_DEBUG, and theSupportData.

87  {
88  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimPleiadesModel(): entering..." << std::endl;
89 
90  theSupportData = 0;
91 
92  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimPleiadesModel(): returning..." << std::endl;
93  }
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Function Documentation

◆ dup()

ossimObject * ossimplugins::ossimPleiadesModel::dup ( ) const
virtual

Returns pointer to a new instance, copy of this. Not implemented yet! Returns NULL...

Reimplemented from ossimRpcModel.

Definition at line 97 of file ossimPleiadesModel.cpp.

References ossimPleiadesModel().

98  {
99  return new ossimPleiadesModel(*this);
100  }
ossimPleiadesModel()
default constructor

◆ finishConstruction()

void ossimplugins::ossimPleiadesModel::finishConstruction ( )
protected

Collects common code among all parsers.

Definition at line 355 of file ossimPleiadesModel.cpp.

References ossimSensorModel::computeGsd(), ossimDpt::hasNans(), ossimDrect::height(), ossimGpt::hgt, ossimGpt::lat, ossimIpt::line, ossimDpt::line, ossimRpcModel::lineSampleHeightToWorld(), ossimDrect::ll(), ossimGpt::lon, ossimDrect::lr(), ossimDrect::midPoint(), ossimNotify(), ossimNotifyLevel_WARN, ossimIpt::samp, ossimDpt::samp, ossimSensorModel::theBoundGndPolygon, ossimSensorModel::theGSD, ossimRpcModel::theHgtOffset, ossimSensorModel::theImageClipRect, ossimSensorModel::theImageSize, ossimRpcModel::theLatOffset, ossimRpcModel::theLonOffset, ossimSensorModel::theRefGndPt, ossimSensorModel::theRefImgPt, ossimDrect::ul(), ossimRpcModel::updateModel(), ossimDrect::ur(), ossimException::what(), ossimDrect::width(), ossimDpt::x, and ossimDpt::y.

Referenced by open().

356  {
364 
365  //---
366  // NOTE: We must call "updateModel()" to set parameter used by base
367  // ossimRpcModel prior to calling lineSampleHeightToWorld or all
368  // the world points will be same.
369  //---
370  updateModel();
371 
372  ossimGpt v0, v1, v2, v3;
377 
379 
380  // Set the ground reference point using the model.
382 
383  if( theGSD.hasNans() )
384  {
385  try
386  {
387  // This will set theGSD and theMeanGSD. Method throws ossimException.
388  computeGsd();
389  }
390  catch (const ossimException& e)
391  {
393  << "ossimPleiadesModel::finishConstruction -- caught exception:\n"
394  << e.what() << std::endl;
395  }
396  }
397  }
ossim_float64 width() const
Definition: ossimDrect.h:522
double samp
Definition: ossimDpt.h:164
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
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
bool hasNans() const
Definition: ossimDpt.h:67
ossim_float64 height() const
Definition: ossimDrect.h:517
ossimDrect theImageClipRect
ossim_int32 samp
Definition: ossimIpt.h:141
ossimDpt midPoint() const
Definition: ossimDrect.h:817
const ossimDpt & ur() const
Definition: ossimDrect.h:340
double x
Definition: ossimDpt.h:164
ossim_int32 line
Definition: ossimIpt.h:142
const ossimDpt & ll() const
Definition: ossimDrect.h:342
ossim_float64 lat
Definition: ossimGpt.h:265
const ossimDpt & lr() const
Definition: ossimDrect.h:341
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getSupportData() [1/2]

ossimPleiadesDimapSupportData* ossimplugins::ossimPleiadesModel::getSupportData ( )
inline

Definition at line 85 of file ossimPleiadesModel.h.

86  {
87  return theSupportData.get();
88  }
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData

◆ getSupportData() [2/2]

const ossimPleiadesDimapSupportData* ossimplugins::ossimPleiadesModel::getSupportData ( ) const
inline

Definition at line 89 of file ossimPleiadesModel.h.

90  {
91  return theSupportData.get();
92  }
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData

◆ loadState()

bool ossimplugins::ossimPleiadesModel::loadState ( const ossimKeywordlist kwl,
const char *  prefix = NULL 
)
virtual

loadState Fulfills ossimObject base-class pure virtuals.

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

Reimplemented from ossimRpcModel.

Definition at line 159 of file ossimPleiadesModel.cpp.

References ossimRpcModel::loadState(), and theSupportData.

161  {
162  if(!theSupportData)
163  {
164  theSupportData = new ossimPleiadesDimapSupportData;
165  }
166 
167  ossimString supportPrefix = ossimString(prefix) + "support_data.";
168  theSupportData->loadState(kwl, supportPrefix);
169 
170  // If only it is a sensor product we load parameters from RPC model only, its avoid to
171  // add a empty RPC model
172  if (theSupportData->getProcessingLevel() == "SENSOR")
173  {
174  ossimRpcModel::loadState(kwl, prefix);
175  return true;
176  }
177  else
178  {
179  return true;
180  }
181  }
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
loadState Fulfills ossimObject base-class pure virtuals.

◆ open()

bool ossimplugins::ossimPleiadesModel::open ( const ossimFilename file)

Definition at line 186 of file ossimPleiadesModel.cpp.

References _productXmlFile, ossimSupportFilesList::add(), ossimRpcModel::B, ossimErrorStatusInterface::clearErrorStatus(), ossimFilename::dirCat(), ossimString::downcase(), ossimFilename::exists(), ossimFilename::ext(), ossimFilename::file(), finishConstruction(), ossimSupportFilesList::instance(), ossimDpt::makeNan(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimNotifyLevel_WARN, ossimFilename::path(), ossimString::replaceStrThatMatch(), ossimFilename::setExtension(), ossimFilename::setFile(), ossimSensorModel::theGSD, ossimRpcModel::theHgtOffset, ossimRpcModel::theHgtScale, ossimSensorModel::theImageClipRect, ossimSensorModel::theImageID, ossimSensorModel::theImageSize, ossimRpcModel::theLatOffset, ossimRpcModel::theLatScale, ossimRpcModel::theLineDenCoef, ossimRpcModel::theLineNumCoef, ossimRpcModel::theLineOffset, ossimRpcModel::theLineScale, ossimRpcModel::theLonOffset, ossimRpcModel::theLonScale, ossimRpcModel::thePolyType, ossimRpcModel::theSampDenCoef, ossimRpcModel::theSampNumCoef, ossimRpcModel::theSampOffset, ossimRpcModel::theSampScale, ossimSensorModel::theSensorID, and theSupportData.

187  {
188  static const char MODULE[] = "ossimPleiadesModel::open";
189  //traceDebug.setTraceFlag(true);
190 
191  if (traceDebug())
192  {
193  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
194  }
195 
196  // Make the gsd nan so it gets computed.
197  theGSD.makeNan();
198 
199  bool result = false;
200 
201  // Filename used.
202  ossimFilename DIMxmlFile;
203  ossimFilename RPCxmlFile;
204 
205  // Generate metadata and rpc filename
206  if ( (file.ext().downcase() != "jp2" && file.ext().downcase() != "tif")
207  || !file.exists())
208  {
209  //not a valid file
210  return false;
211  }
212  else
213  {
214 
215  // DIMAPv1
216  ossimFilename DIMv1xmlFileTmp = file;
217  DIMv1xmlFileTmp.setFile("PHRDIMAP");
218  DIMv1xmlFileTmp.setExtension("XML");
219 
220  if (DIMv1xmlFileTmp.exists())
221  {
222  DIMxmlFile = DIMv1xmlFileTmp;
223  RPCxmlFile = DIMv1xmlFileTmp;
224  }
225  else
226  {
227  //---
228  // DIMAPv2
229  // Example file names:
230  // DIM_PHR1A_P_201202250025329_SEN_PRG_FC_5110-001.XML
231  // IMG_PHR1A_P_201202250025329_SEN_PRG_FC_5110-001_R1C1.tif
232  // RPC_PHR1A_P_201202250025329_SEN_PRG_FC_5110-001.XML
233  //---
234  DIMxmlFile = file.path();
235  RPCxmlFile = file.path();
236  ossimFilename DIMxmlFileTmp = file.file();
237  ossimFilename RPCxmlFileTmp;
238 
239  DIMxmlFileTmp = DIMxmlFileTmp.file().replaceStrThatMatch("^IMG_", "DIM_");
240 
241  //---
242  // Below substitution failing on lower case "tif" extension.
243  // Replacee with sustitute + setExtension call. (drb 17 Feb. 2016)
244  // DIMxmlFileTmp =
245  // DIMxmlFileTmp.replaceStrThatMatch("_R[0-9]+C[0-9]+\\.(JP2|TIF)$", ".XML");
246  //---
247  DIMxmlFileTmp = DIMxmlFileTmp.replaceStrThatMatch("_R[0-9]+C[0-9]", "");
248  DIMxmlFileTmp.setExtension("XML");
249 
250  RPCxmlFileTmp = DIMxmlFileTmp.file().replaceStrThatMatch("^DIM_", "RPC_");
251 
252  DIMxmlFile = DIMxmlFile.dirCat(DIMxmlFileTmp);
253  RPCxmlFile = RPCxmlFile.dirCat(RPCxmlFileTmp);
254  }
255 
256  if (!DIMxmlFile.exists())
257  {
258  if (traceDebug())
259  {
261  << "PHR main DIMAP file " << DIMxmlFile << " doesn't exist ...\n";
262  }
263  return false;
264  }
265  }
266 
267  if (traceDebug())
268  {
269  ossimNotify(ossimNotifyLevel_DEBUG) << "Metadata xml file: " << DIMxmlFile << "\n";
270  ossimNotify(ossimNotifyLevel_DEBUG) << "RPC xml file: " << RPCxmlFile << "\n";
271  }
272 
273  ossimString processingLevel;
274  // Parse the metadata xml file
275  if ( !theSupportData.valid() )
276  theSupportData = new ossimPleiadesDimapSupportData();
277 
278  if(!theSupportData->parseXmlFile(DIMxmlFile))
279  {
280  theSupportData = 0; // ossimRefPtr
281  if (traceDebug())
282  {
284  << "ossimPleiadesModel::open DEBUG:"
285  << "\nCould not open correctly DIMAP file" << std::endl;
286  }
287  return false;
288  }
289 
290  theSensorID = theSupportData->getSensorID();
291  theImageID = theSupportData->getImageID();
292  // Get the processing level (ORTHO or SENSOR or perhaps MOSAIC ?)
293  processingLevel = theSupportData->getProcessingLevel();
294 
295  // Parse the RPC xml file if necessary
296  if (RPCxmlFile.exists() && processingLevel == "SENSOR")
297  {
298  if (!theSupportData->parseXmlFile(RPCxmlFile))
299  {
300  theSupportData = 0; // ossimRefPtr
302  << "ossimPleiadesModel::open WARNING:"
303  << "\nCould not open correctly RPC file" << std::endl;
304  return false;
305  }
306 
307  thePolyType = B;
308 
309  for (unsigned int i = 0 ; i < 20; i++ )
310  {
311  theLineNumCoef[i] = theSupportData->getLineNumCoeff()[i];
312  theLineDenCoef[i] = theSupportData->getLineDenCoeff()[i];
313  theSampNumCoef[i] = theSupportData->getSampNumCoeff()[i];
314  theSampDenCoef[i] = theSupportData->getSampDenCoeff()[i];
315  }
316 
317  theLineScale = theSupportData->getLineScale();
318  theSampScale = theSupportData->getSampScale();
319  theLatScale = theSupportData->getLatScale();
320  theLonScale = theSupportData->getLonScale();
321  theHgtScale = theSupportData->getHeightScale();
322  theLineOffset = theSupportData->getLineOffset();
323  theSampOffset = theSupportData->getSampOffset();
324  theLatOffset = theSupportData->getLatOffset();
325  theLonOffset = theSupportData->getLonOffset();
326  theHgtOffset = theSupportData->getHeightOffset();
327  }
328 
329  // TODO MSD Check if this part is necessary
330  _productXmlFile = DIMxmlFile;
332 
333  // TODO MSD WARNING File with multi tiles are not well managed
334  theSupportData->getImageRect(theImageClipRect);
335  theSupportData->getImageSize(theImageSize);
336 
339 
340  result = true;
341  if (traceDebug())
342  {
343  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exit status = " << (result ? "true" : "false\n") << std::endl;
344  }
345 
346  /*std::cout << "---------------------------" << std::endl;
347  print(std::cout);
348  std::cout << "---------------------------" << std::endl;*/
349  return result;
350  }
double theSampOffset
ossimString theSensorID
PolynomialType thePolyType
double theSampNumCoef[20]
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData
ossimFilename & setFile(const ossimString &f)
ossimString theImageID
double theLonScale
double theLineScale
void finishConstruction()
Collects common code among all parsers.
double theSampDenCoef[20]
double theLineNumCoef[20]
double theLatOffset
void add(const ossimFilename &f)
Add support data filename to the list:
double theHgtOffset
double theLonOffset
bool exists() const
double theLatScale
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString replaceStrThatMatch(const char *regularExpressionPattern, const char *value="") const
ossimDrect theImageClipRect
ossimFilename dirCat(const ossimFilename &file) const
double theSampScale
ossimFilename file() const
ossimString ext() const
static ossimSupportFilesList * instance()
double theLineDenCoef[20]
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
double theLineOffset
double theHgtScale
ossimFilename path() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void makeNan()
Definition: ossimDpt.h:65

◆ parseMetaData()

bool ossimplugins::ossimPleiadesModel::parseMetaData ( const ossimFilename file)
protected

◆ parseRpcData()

bool ossimplugins::ossimPleiadesModel::parseRpcData ( const ossimFilename file)
protected

◆ print()

std::ostream & ossimplugins::ossimPleiadesModel::print ( std::ostream &  out) const
virtual

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

Reimplemented from ossimRpcModel.

Definition at line 105 of file ossimPleiadesModel.cpp.

References ossimRpcModel::print(), ossimSensorModel::theImageID, ossimSensorModel::theImageSize, ossimSensorModel::theRefGndPt, ossimSensorModel::theRefImgPt, and theSupportData.

106  {
107  // Capture stream flags since we are going to mess with them.
108  std::ios_base::fmtflags f = out.flags();
109 
110  out << "\nDump of ossimPleiadesModel at address " << (hex) << this
111  << (dec)
112  << "\n------------------------------------------------"
113  << "\n theImageID = " << theImageID
114  << "\n theImageSize = " << theImageSize
115  << "\n theRefGndPt = " << theRefGndPt
116  << "\n theRefImgPt = " << theRefImgPt
117  << "\n theProcessingLevel = " << theSupportData->getProcessingLevel()
118  << "\n------------------------------------------------"
119  << "\n " << endl;
120 
121  // Set the flags back.
122  out.flags(f);
123 
124  if (theSupportData->getProcessingLevel() == "SENSOR")
125  return ossimRpcModel::print(out);
126  else
127  return out;
128  }
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData
ossimString theImageID
virtual std::ostream & print(std::ostream &out) const
print() Extends base-class implementation.

◆ saveState()

bool ossimplugins::ossimPleiadesModel::saveState ( ossimKeywordlist kwl,
const char *  prefix = NULL 
) const
virtual

Fulfills ossimObject base-class pure virtuals. Loads and saves geometry KWL files. Returns true if successful.

Reimplemented from ossimRpcModel.

Definition at line 133 of file ossimPleiadesModel.cpp.

References ossimKeywordlist::add(), ossimRpcModel::saveState(), ossimSensorModel::theSensorID, and theSupportData.

135  {
136  if(theSupportData.valid())
137  {
138  ossimString supportPrefix = ossimString(prefix) + "support_data.";
139  theSupportData->saveState(kwl, supportPrefix);
140  }
141 
142  // If only it is a sensor product we save parameters from RPC model, its avoid to
143  // propagate a empty RPC model
144  if (theSupportData->getProcessingLevel() == "SENSOR")
145  {
146  ossimRpcModel::saveState(kwl, prefix);
147  return true;
148  }
149  else
150  {
151  kwl.add(prefix, "sensor", theSensorID, true);
152  return true;
153  }
154  }
ossimString theSensorID
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
saveState Fulfills ossimObject base-class pure virtuals.

◆ setSupportData()

void ossimplugins::ossimPleiadesModel::setSupportData ( ossimPleiadesDimapSupportData supportData)
inline

Definition at line 81 of file ossimPleiadesModel.h.

82  {
83  theSupportData = supportData;
84  }
ossimRefPtr< ossimPleiadesDimapSupportData > theSupportData

Member Data Documentation

◆ _productXmlFile

ossimFilename ossimplugins::ossimPleiadesModel::_productXmlFile
protected

Definition at line 107 of file ossimPleiadesModel.h.

Referenced by open().

◆ theSupportData

ossimRefPtr<ossimPleiadesDimapSupportData> ossimplugins::ossimPleiadesModel::theSupportData
protected

Definition at line 105 of file ossimPleiadesModel.h.

Referenced by loadState(), open(), print(), saveState(), and ~ossimPleiadesModel().


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