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

#include <ossimSpot6DimapSupportData.h>

Inheritance diagram for ossimplugins::ossimSpot6DimapSupportData:
ossimObject ossimErrorStatusInterface ossimReferenced

Public Types

enum  ossimSpot6DIMAPVersion { OSSIM_Spot6_UNKNOWN, OSSIM_Spot6_DIMAPv2 }
 
enum  ossimSpot6MetadataSubProfile { OSSIM_Spot6_METADATA_SUBPROFILE_UNKNOWN = 0, OSSIM_Spot6_METADATA_SUBPROFILE_PRODUCT = 1, OSSIM_Spot6_METADATA_SUBPROFILE_RPC = 2 }
 metadata subprofile type More...
 

Public Member Functions

 ossimSpot6DimapSupportData ()
 
virtual ~ossimSpot6DimapSupportData ()
 
void clearFields ()
 
bool parseXmlFile (const ossimFilename &file)
 
void printInfo (ostream &os) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of the object to a keyword list. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of the object from a keyword list. More...
 
ossimString getSensorID () const
 
ossimString getProcessingLevel () const
 
ossimString getAcquisitionDate () const
 
ossimString getProductionDate () const
 
ossimString getImageID () const
 
ossimString getInstrument () const
 
ossimString getInstrumentIndex () const
 
ossim_uint32 getNumberOfBands () const
 
void getSunAzimuth (std::vector< ossim_float64 > &az) const
 
void getSunElevation (std::vector< ossim_float64 > &el) const
 
void getImageSize (ossimIpt &sz) const
 
void getIncidenceAngle (std::vector< ossim_float64 > &ia) const
 
void getViewingAngle (std::vector< ossim_float64 > &va) const
 
void getUlCorner (ossimGpt &pt) const
 
void getUrCorner (ossimGpt &pt) const
 
void getLrCorner (ossimGpt &pt) const
 
void getLlCorner (ossimGpt &pt) const
 
void getRefGroundPoint (ossimGpt &gp) const
 Center of frame, sub image if there is one. More...
 
void getRefImagePoint (ossimDpt &rp) const
 zero base center point More...
 
void getImageRect (ossimDrect &rect) const
 Zero based image rectangle, sub image if there is one. More...
 
bool allMetadataRead ()
 
std::vector< double > getLineNumCoeff () const
 
std::vector< double > getLineDenCoeff () const
 
std::vector< double > getSampNumCoeff () const
 
std::vector< double > getSampDenCoeff () const
 
ossim_int32 getLineOffset () const
 
ossim_int32 getSampOffset () const
 
double getLatOffset () const
 
double getLonOffset () const
 
double getHeightOffset () const
 
double getLineScale () const
 
double getSampScale () const
 
double getLatScale () const
 
double getLonScale () const
 
double getHeightScale () const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
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 std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) 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
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 

Private Member Functions

ossimGpt createGround (const ossimString &s) const
 
ossimDpt createDpt (const ossimString &s) const
 
ossimIpt createIpt (const ossimString &s) const
 
bool parseRPCMetadata (ossimRefPtr< ossimXmlDocument > xmlDocument)
 
bool parseMetadataIdentificationDIMAPv2 (ossimRefPtr< ossimXmlDocument > xmlDocument)
 
bool parseDatasetIdentification (ossimRefPtr< ossimXmlDocument > xmlDocument)
 Dataset Identification: More...
 
bool parseDatasetContent (ossimRefPtr< ossimXmlDocument > xmlDocument)
 Dataset Content: More...
 
bool parseProductInformation (ossimRefPtr< ossimXmlDocument > xmlDocument)
 Product Information: More...
 
bool parseCoordinateReferenceSystem (ossimRefPtr< ossimXmlDocument > xmlDocument)
 Coordinate Reference System: More...
 
bool parseGeoposition (ossimRefPtr< ossimXmlDocument > xmlDocument)
 Geoposition: More...
 
bool parseProcessingInformation (ossimRefPtr< ossimXmlDocument > xmlDocument)
 Processing Information: More...
 
bool parseRasterData (ossimRefPtr< ossimXmlDocument > xmlDocument)
 
bool parseRadiometricData (ossimRefPtr< ossimXmlDocument > xmlDocument)
 
bool parseGeometricData (ossimRefPtr< ossimXmlDocument > xmlDocument)
 
bool parseQualityAssessment (ossimRefPtr< ossimXmlDocument > xmlDocument)
 QualityAssessment: More...
 
bool parseDatasetSources (ossimRefPtr< ossimXmlDocument > xmlDocument)
 

Private Attributes

ossimSpot6DIMAPVersion theDIMAPVersion
 
ossimSpot6MetadataSubProfile theMetadataSubProfile
 
bool theProductIsOk
 
bool theRpcIsOk
 
ossimString theXmlDocumentRoot
 
ossimString theSensorID
 
ossimString theImageID
 
ossimString theProductionDate
 
ossimString theAcquisitionDate
 
ossimString theInstrument
 
ossimString theInstrumentIndex
 
ossimString theProcessingLevelString
 
ossimString theSpectralProcessingString
 
std::vector< ossim_float64theSunAzimuth
 
std::vector< ossim_float64theSunElevation
 
std::vector< ossim_float64theIncidenceAngle
 
std::vector< ossim_float64theViewingAngle
 
std::vector< ossim_float64theAzimuthAngle
 
ossimIpt theImageSize
 
ossimIpt theTileSize
 
ossim_uint32 theNumberOfMegaTilesInRow
 
ossim_uint32 theNumberOfMegaTilesInCol
 
ossim_uint32 theNumberOfMegaTiles
 
ossimBooleanProperty theMultiDataFile
 
ossim_uint32 theNumBands
 
std::vector< ossimStringtheBandOrder
 
std::vector< ossim_float64thePhysicalBias
 Calibration information for radiometric corrections. More...
 
std::vector< ossim_float64thePhysicalGain
 
std::vector< ossim_float64theSolarIrradiance
 
ossimGpt theUlCorner
 
ossimGpt theUrCorner
 
ossimGpt theLrCorner
 
ossimGpt theLlCorner
 
ossimString theSpecId
 
double theErrBias
 
double theErrBiasX
 
double theErrBiasY
 
double theErrRand
 
ossim_int32 theLineOffset
 
ossim_int32 theSampOffset
 
double theLatOffset
 
double theLonOffset
 
double theHeightOffset
 
double theLineScale
 
double theSampScale
 
double theLatScale
 
double theLonScale
 
double theHeightScale
 
std::vector< double > theLineNumCoeff
 
std::vector< double > theLineDenCoeff
 
std::vector< double > theSampNumCoeff
 
std::vector< double > theSampDenCoeff
 
ossimGpt theRefGroundPoint
 Center of frame on ground, if sub image it's the center of that. More...
 
ossimDpt theRefImagePoint
 Zero based center of frame. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 56 of file ossimSpot6DimapSupportData.h.

Member Enumeration Documentation

◆ ossimSpot6DIMAPVersion

◆ ossimSpot6MetadataSubProfile

Constructor & Destructor Documentation

◆ ossimSpot6DimapSupportData()

ossimplugins::ossimSpot6DimapSupportData::ossimSpot6DimapSupportData ( )

Definition at line 127 of file ossimSpot6DimapSupportData.cpp.

131  theProductIsOk(false),
132  theRpcIsOk(false),
134 
135  theSensorID(),
136  theImageID(),
139  theInstrument(),
143 
144  theSunAzimuth(),
145  theSunElevation(),
147  theViewingAngle(),
148  theAzimuthAngle(),
149 
150  theImageSize(0, 0),
151  theTileSize(0, 0),
156 
157  theNumBands(0),
158  theBandOrder(),
159 
160  thePhysicalBias(),
161  thePhysicalGain(),
163 
164  theUlCorner(),
165  theUrCorner(),
166  theLrCorner(),
167  theLlCorner(),
168 
169  theSpecId(),
170  theErrBias(0),
171  theErrBiasX(0),
172  theErrBiasY(0),
173  theErrRand(0),
174  theLineOffset(0),
175  theSampOffset(0),
176  theLatOffset(0),
177  theLonOffset(0),
178  theHeightOffset(0),
179  theLineScale(0),
180  theSampScale(0),
181  theLatScale(0),
182  theLonScale(0),
183  theHeightScale(0),
184  theLineNumCoeff(),
185  theLineDenCoeff(),
186  theSampNumCoeff(),
187  theSampDenCoeff(),
188 
189  theRefGroundPoint(0.0, 0.0, 0.0),
190  theRefImagePoint(0.0, 0.0)
191  {
192  }
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
std::vector< ossim_float64 > thePhysicalBias
Calibration information for radiometric corrections.
ossimDpt theRefImagePoint
Zero based center of frame.

◆ ~ossimSpot6DimapSupportData()

ossimplugins::ossimSpot6DimapSupportData::~ossimSpot6DimapSupportData ( )
virtual

Definition at line 194 of file ossimSpot6DimapSupportData.cpp.

195  {
196  }

Member Function Documentation

◆ allMetadataRead()

bool ossimplugins::ossimSpot6DimapSupportData::allMetadataRead ( )
inline

◆ clearFields()

void ossimplugins::ossimSpot6DimapSupportData::clearFields ( )

Definition at line 199 of file ossimSpot6DimapSupportData.cpp.

References ossimErrorStatusInterface::clearErrorStatus(), ossimIpt::makeNan(), ossimDpt::makeNan(), ossimGpt::makeNan(), OSSIM_Spot6_METADATA_SUBPROFILE_UNKNOWN, OSSIM_Spot6_UNKNOWN, ossimBooleanProperty::setBooleanValue(), theAcquisitionDate, theAzimuthAngle, theBandOrder, theDIMAPVersion, theErrBias, theErrBiasX, theErrBiasY, theErrRand, theHeightOffset, theHeightScale, theImageID, theImageSize, theIncidenceAngle, theInstrument, theInstrumentIndex, theLatOffset, theLatScale, theLineDenCoeff, theLineNumCoeff, theLineOffset, theLineScale, theLlCorner, theLonOffset, theLonScale, theLrCorner, theMetadataSubProfile, theMultiDataFile, theNumBands, theNumberOfMegaTiles, theNumberOfMegaTilesInCol, theNumberOfMegaTilesInRow, thePhysicalBias, thePhysicalGain, theProcessingLevelString, theProductionDate, theProductIsOk, theRefGroundPoint, theRefImagePoint, theRpcIsOk, theSampDenCoeff, theSampNumCoeff, theSampOffset, theSampScale, theSensorID, theSolarIrradiance, theSpecId, theSpectralProcessingString, theSunAzimuth, theSunElevation, theTileSize, theUlCorner, theUrCorner, theViewingAngle, and theXmlDocumentRoot.

Referenced by loadState(), and parseXmlFile().

200  {
204  theProductIsOk = false;
205  theRpcIsOk = false;
206  theXmlDocumentRoot = "";
207  theImageID = "";
208  theSensorID="";
209  theProductionDate = "";
210  theAcquisitionDate = "";
211  theInstrument = "";
212  theInstrumentIndex = "";
215 
216  theSunAzimuth.clear();
217  theSunElevation.clear();
218  theIncidenceAngle.clear();
219  theViewingAngle.clear();
220  theAzimuthAngle.clear();
221 
227  ossimString msg = "";
228  theMultiDataFile.setBooleanValue(false, msg);
229 
230  theNumBands = 0;
231  theBandOrder.clear();
232 
233  thePhysicalBias.clear();
234  thePhysicalGain.clear();
235  theSolarIrradiance.clear();
236 
237  //---
238  // Corner points:
239  //---
244 
247 
248  //---
249  // RPC model parameters
250  //---
251  theErrBias = 0.0;
252  theErrBiasX = 0.0;
253  theErrBiasY = 0.0;
254  theErrRand = 0.0;
255  theLineOffset = 0;
256  theSampOffset = 0;
257  theLatOffset = 0.0;
258  theLonOffset = 0.0;
259  theHeightOffset = 0.0;
260  theLineScale = 0.0;
261  theSampScale = 0.0;
262  theLatScale = 0.0;
263  theLonScale = 0.0;
264  theHeightScale = 0.0;
265  theLineNumCoeff.clear();
266  theLineDenCoeff.clear();
267  theSampNumCoeff.clear();
268  theSampDenCoeff.clear();
269  theSpecId = "";
270  }
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
void makeNan()
Definition: ossimIpt.h:56
void makeNan()
Definition: ossimGpt.h:130
bool setBooleanValue(bool value, ossimString &msg)
std::vector< ossim_float64 > thePhysicalBias
Calibration information for radiometric corrections.
void makeNan()
Definition: ossimDpt.h:65
ossimDpt theRefImagePoint
Zero based center of frame.

◆ createDpt()

ossimDpt ossimplugins::ossimSpot6DimapSupportData::createDpt ( const ossimString s) const
private

Definition at line 1085 of file ossimSpot6DimapSupportData.cpp.

References ossimString::string(), x, and y.

Referenced by loadState().

1086  {
1087  std::istringstream in(s.string());
1088  ossimString x, y;
1089  ossimString code;
1090 
1091  in >> x.string() >> y.string();
1092 
1093  return ossimDpt(x.toDouble(), y.toDouble());
1094 
1095  }
ossim_uint32 x
ossim_uint32 y
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
const std::string & string() const
Definition: ossimString.h:414

◆ createGround()

ossimGpt ossimplugins::ossimSpot6DimapSupportData::createGround ( const ossimString s) const
private

Definition at line 1070 of file ossimSpot6DimapSupportData.cpp.

References ossimDatumFactory::create(), ossimDatumFactory::instance(), and ossimString::string().

Referenced by loadState().

1071  {
1072  std::istringstream in(s.string());
1073  ossimString lat, lon, height;
1074  ossimString code;
1075 
1076  in >> lat.string() >> lon.string() >> height.string() >> code.string();
1077 
1078  return ossimGpt(lat.toDouble(),
1079  lon.toDouble(),
1080  height.toDouble(),
1082 
1083  }
virtual const ossimDatum * create(const ossimString &code) const
create method
static ossimDatumFactory * instance()
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
const std::string & string() const
Definition: ossimString.h:414

◆ createIpt()

ossimIpt ossimplugins::ossimSpot6DimapSupportData::createIpt ( const ossimString s) const
private

Definition at line 1097 of file ossimSpot6DimapSupportData.cpp.

References ossimString::string(), x, and y.

Referenced by loadState().

1098  {
1099  std::istringstream in(s.string());
1100  ossimString x, y;
1101  ossimString code;
1102 
1103  in >> x.string() >> y.string();
1104 
1105  return ossimIpt(x.toInt(), y.toInt());
1106 
1107  }
ossim_uint32 x
ossim_uint32 y
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
const std::string & string() const
Definition: ossimString.h:414

◆ getAcquisitionDate()

ossimString ossimplugins::ossimSpot6DimapSupportData::getAcquisitionDate ( ) const

Definition at line 581 of file ossimSpot6DimapSupportData.cpp.

References theAcquisitionDate.

582  {
583  return theAcquisitionDate;
584  }

◆ getHeightOffset()

double ossimplugins::ossimSpot6DimapSupportData::getHeightOffset ( ) const
inline

◆ getHeightScale()

double ossimplugins::ossimSpot6DimapSupportData::getHeightScale ( ) const
inline

◆ getImageID()

ossimString ossimplugins::ossimSpot6DimapSupportData::getImageID ( ) const

Definition at line 591 of file ossimSpot6DimapSupportData.cpp.

References theImageID.

592  {
593  return theImageID;
594  }

◆ getImageRect()

void ossimplugins::ossimSpot6DimapSupportData::getImageRect ( ossimDrect rect) const

Zero based image rectangle, sub image if there is one.

Definition at line 666 of file ossimSpot6DimapSupportData.cpp.

References theImageSize, ossimIpt::x, and ossimIpt::y.

667  {
668  rect = ossimDrect(0.0, 0.0, theImageSize.x-1.0, theImageSize.y-1.0);
669  }
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ getImageSize()

void ossimplugins::ossimSpot6DimapSupportData::getImageSize ( ossimIpt sz) const

Definition at line 616 of file ossimSpot6DimapSupportData.cpp.

References theImageSize.

◆ getIncidenceAngle()

void ossimplugins::ossimSpot6DimapSupportData::getIncidenceAngle ( std::vector< ossim_float64 > &  ia) const

Definition at line 626 of file ossimSpot6DimapSupportData.cpp.

References theIncidenceAngle.

627  {
628  ia = theIncidenceAngle;
629  }

◆ getInstrument()

ossimString ossimplugins::ossimSpot6DimapSupportData::getInstrument ( ) const

Definition at line 596 of file ossimSpot6DimapSupportData.cpp.

References theInstrument.

597  {
598  return theInstrument;
599  }

◆ getInstrumentIndex()

ossimString ossimplugins::ossimSpot6DimapSupportData::getInstrumentIndex ( ) const

Definition at line 601 of file ossimSpot6DimapSupportData.cpp.

References theInstrumentIndex.

602  {
603  return theInstrumentIndex;
604  }

◆ getLatOffset()

double ossimplugins::ossimSpot6DimapSupportData::getLatOffset ( ) const
inline

◆ getLatScale()

double ossimplugins::ossimSpot6DimapSupportData::getLatScale ( ) const
inline

◆ getLineDenCoeff()

std::vector<double> ossimplugins::ossimSpot6DimapSupportData::getLineDenCoeff ( ) const
inline

Definition at line 140 of file ossimSpot6DimapSupportData.h.

◆ getLineNumCoeff()

std::vector<double> ossimplugins::ossimSpot6DimapSupportData::getLineNumCoeff ( ) const
inline

Definition at line 139 of file ossimSpot6DimapSupportData.h.

◆ getLineOffset()

ossim_int32 ossimplugins::ossimSpot6DimapSupportData::getLineOffset ( ) const
inline

◆ getLineScale()

double ossimplugins::ossimSpot6DimapSupportData::getLineScale ( ) const
inline

◆ getLlCorner()

void ossimplugins::ossimSpot6DimapSupportData::getLlCorner ( ossimGpt pt) const

Definition at line 661 of file ossimSpot6DimapSupportData.cpp.

References theLlCorner.

◆ getLonOffset()

double ossimplugins::ossimSpot6DimapSupportData::getLonOffset ( ) const
inline

◆ getLonScale()

double ossimplugins::ossimSpot6DimapSupportData::getLonScale ( ) const
inline

◆ getLrCorner()

void ossimplugins::ossimSpot6DimapSupportData::getLrCorner ( ossimGpt pt) const

Definition at line 656 of file ossimSpot6DimapSupportData.cpp.

References theLrCorner.

◆ getNumberOfBands()

ossim_uint32 ossimplugins::ossimSpot6DimapSupportData::getNumberOfBands ( ) const

Definition at line 621 of file ossimSpot6DimapSupportData.cpp.

References theNumBands.

622  {
623  return theNumBands;
624  }

◆ getProcessingLevel()

ossimString ossimplugins::ossimSpot6DimapSupportData::getProcessingLevel ( ) const

Definition at line 571 of file ossimSpot6DimapSupportData.cpp.

References theProcessingLevelString.

◆ getProductionDate()

ossimString ossimplugins::ossimSpot6DimapSupportData::getProductionDate ( ) const

Definition at line 586 of file ossimSpot6DimapSupportData.cpp.

References theProductionDate.

587  {
588  return theProductionDate;
589  }

◆ getRefGroundPoint()

void ossimplugins::ossimSpot6DimapSupportData::getRefGroundPoint ( ossimGpt gp) const

Center of frame, sub image if there is one.

Definition at line 636 of file ossimSpot6DimapSupportData.cpp.

References theRefGroundPoint.

637  {
638  gp = theRefGroundPoint;
639  }
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.

◆ getRefImagePoint()

void ossimplugins::ossimSpot6DimapSupportData::getRefImagePoint ( ossimDpt rp) const

zero base center point

Definition at line 641 of file ossimSpot6DimapSupportData.cpp.

References theRefImagePoint.

642  {
643  rp = theRefImagePoint;
644  }
ossimDpt theRefImagePoint
Zero based center of frame.

◆ getSampDenCoeff()

std::vector<double> ossimplugins::ossimSpot6DimapSupportData::getSampDenCoeff ( ) const
inline

Definition at line 142 of file ossimSpot6DimapSupportData.h.

◆ getSampNumCoeff()

std::vector<double> ossimplugins::ossimSpot6DimapSupportData::getSampNumCoeff ( ) const
inline

Definition at line 141 of file ossimSpot6DimapSupportData.h.

◆ getSampOffset()

ossim_int32 ossimplugins::ossimSpot6DimapSupportData::getSampOffset ( ) const
inline

◆ getSampScale()

double ossimplugins::ossimSpot6DimapSupportData::getSampScale ( ) const
inline

◆ getSensorID()

ossimString ossimplugins::ossimSpot6DimapSupportData::getSensorID ( ) const

Definition at line 576 of file ossimSpot6DimapSupportData.cpp.

References theSensorID.

577  {
578  return theSensorID;
579  }

◆ getSunAzimuth()

void ossimplugins::ossimSpot6DimapSupportData::getSunAzimuth ( std::vector< ossim_float64 > &  az) const

Definition at line 606 of file ossimSpot6DimapSupportData.cpp.

References theSunAzimuth.

607  {
608  az = theSunAzimuth;
609  }

◆ getSunElevation()

void ossimplugins::ossimSpot6DimapSupportData::getSunElevation ( std::vector< ossim_float64 > &  el) const

Definition at line 611 of file ossimSpot6DimapSupportData.cpp.

References theSunElevation.

612  {
613  el = theSunElevation;
614  }

◆ getUlCorner()

void ossimplugins::ossimSpot6DimapSupportData::getUlCorner ( ossimGpt pt) const

Definition at line 646 of file ossimSpot6DimapSupportData.cpp.

References theUlCorner.

◆ getUrCorner()

void ossimplugins::ossimSpot6DimapSupportData::getUrCorner ( ossimGpt pt) const

Definition at line 651 of file ossimSpot6DimapSupportData.cpp.

References theUrCorner.

◆ getViewingAngle()

void ossimplugins::ossimSpot6DimapSupportData::getViewingAngle ( std::vector< ossim_float64 > &  va) const

Definition at line 631 of file ossimSpot6DimapSupportData.cpp.

References theViewingAngle.

632  {
633  va = theViewingAngle;
634  }

◆ loadState()

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

Method to the load (recreate) the state of the object from a keyword list.

Return true if ok or false on error.

Reimplemented from ossimObject.

Definition at line 906 of file ossimSpot6DimapSupportData.cpp.

References ossimKeywordNames::AZIMUTH_ANGLE_KW, clearFields(), createDpt(), createGround(), createIpt(), ossimKeywordNames::ELEVATION_ANGLE_KW, ossimKeywordlist::find(), ossimKeywordNames::IMAGE_DATE_KW, ossimKeywordNames::NUMBER_BANDS_KW, ossimString::string(), theAcquisitionDate, theAzimuthAngle, theBandOrder, theImageID, theImageSize, theIncidenceAngle, theInstrument, theInstrumentIndex, theLlCorner, theLrCorner, theNumBands, thePhysicalBias, thePhysicalGain, theProcessingLevelString, theProductionDate, theRefGroundPoint, theRefImagePoint, theSensorID, theSolarIrradiance, theSunAzimuth, theSunElevation, theUlCorner, theUrCorner, theViewingAngle, and ossimKeywordNames::TYPE_KW.

908  {
909  ossim_uint32 idx = 0;
910  ossim_uint32 total;
911  ossimString tempString;
912 
913  clearFields();
914 
915 
916  ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
917 
918  if(type != "ossimSpot6DimapSupportData")
919  {
920  return false;
921  }
922 
923  total = ossimString(kwl.find(prefix,"number_of_azimuth_angle")).toUInt32();
924  theSunAzimuth.resize(total);
925  tempString = kwl.find(prefix,ossimKeywordNames::AZIMUTH_ANGLE_KW);
926  if(tempString != "")
927  {
928  std::istringstream in(tempString.string());
929  ossimString tempValue;
930  for(idx = 0; idx < theSunAzimuth.size();++idx)
931  {
932  in >> tempValue.string();
933  theSunAzimuth[idx] = tempValue.toDouble();
934  }
935  }
936 
937  total = ossimString(kwl.find(prefix,"number_of_elevation_angle")).toUInt32();
938  theSunElevation.resize(total);
939  tempString = kwl.find(prefix,ossimKeywordNames::ELEVATION_ANGLE_KW);
940  if(tempString != "")
941  {
942  std::istringstream in(tempString.string());
943  ossimString tempValue;
944  for(idx = 0; idx < theSunElevation.size();++idx)
945  {
946  in >> tempValue.string();
947  theSunElevation[idx] = tempValue.toDouble();
948  }
949  }
950 
951  theImageSize = createIpt(kwl.find(prefix, "image_size"));
952  theRefGroundPoint = createGround(kwl.find(prefix, "reference_ground_point"));
953  theRefImagePoint = createDpt(kwl.find(prefix, "reference_image_point"));
954 
956 
957  theBandOrder.resize(theNumBands);
958  tempString = kwl.find(prefix,"band_name_list");
959  if(tempString != "")
960  {
961  std::istringstream in(tempString.string());
962  ossimString tempValue;
963  for(idx = 0; idx < theBandOrder.size();++idx)
964  {
965  in >> tempValue.string();
966  theBandOrder[idx] = tempValue;
967  }
968  }
969 
971  theProductionDate = kwl.find(prefix, "production_date");
972  theImageID = kwl.find(prefix, "image_id");
973  theInstrument = kwl.find(prefix, "instrument");
974  theInstrumentIndex = kwl.find(prefix, "instrument_index");
975 
976  total = ossimString(kwl.find(prefix,"number_of_incident_angle")).toUInt32();
977  theIncidenceAngle.resize(total);
978  tempString = kwl.find(prefix,"incident_angle");
979  if(tempString != "")
980  {
981  std::istringstream in(tempString.string());
982  ossimString tempValue;
983  for(idx = 0; idx < theIncidenceAngle.size();++idx)
984  {
985  in >> tempValue.string();
986  theIncidenceAngle[idx] = tempValue.toDouble();
987  }
988  }
989 
990  total = ossimString(kwl.find(prefix,"number_of_viewing_angle")).toUInt32();
991  theViewingAngle.resize(total);
992  tempString = kwl.find(prefix,"viewing_angle");
993  if(tempString != "")
994  {
995  std::istringstream in(tempString.string());
996  ossimString tempValue;
997  for(idx = 0; idx < theViewingAngle.size();++idx)
998  {
999  in >> tempValue.string();
1000  theViewingAngle[idx] = tempValue.toDouble();
1001  }
1002  }
1003 
1004  total = ossimString(kwl.find(prefix,"number_of_scene_orientation")).toUInt32();
1005  theAzimuthAngle.resize(total);
1006  tempString = kwl.find(prefix,"scene_orientation");
1007  if(tempString != "")
1008  {
1009  std::istringstream in(tempString.string());
1010  ossimString tempValue;
1011  for(idx = 0; idx < theAzimuthAngle.size();++idx)
1012  {
1013  in >> tempValue.string();
1014  theAzimuthAngle[idx] = tempValue.toDouble();
1015  }
1016  }
1017 
1018 
1019  theUlCorner =createGround( kwl.find(prefix, "ul_ground_point"));
1020  theUrCorner =createGround( kwl.find(prefix, "ur_ground_point"));
1021  theLrCorner =createGround( kwl.find(prefix, "lr_ground_point"));
1022  theLlCorner =createGround( kwl.find(prefix, "ll_ground_point"));
1023 
1024  theSensorID = ossimString(kwl.find(prefix, "sensorID"));
1025 
1026  theProcessingLevelString = ossimString(kwl.find(prefix, "processing_level"));
1027 
1028  thePhysicalBias.resize(theNumBands);
1029  tempString = kwl.find(prefix,"physical_bias");
1030  if(tempString != "")
1031  {
1032  std::istringstream in(tempString.string());
1033  ossimString tempValue;
1034  for(idx = 0; idx < thePhysicalBias.size();++idx)
1035  {
1036  in >> tempValue.string();
1037  thePhysicalBias[idx] = tempValue.toDouble();
1038  }
1039  }
1040 
1041  thePhysicalGain.resize(theNumBands);
1042  tempString = kwl.find(prefix,"physical_gain");
1043  if(tempString != "")
1044  {
1045  std::istringstream in(tempString.string());
1046  ossimString tempValue;
1047  for(idx = 0; idx < thePhysicalGain.size();++idx)
1048  {
1049  in >> tempValue.string();
1050  thePhysicalGain[idx] = tempValue.toDouble();
1051  }
1052  }
1053 
1055  tempString = kwl.find(prefix,"solar_irradiance");
1056  if(tempString != "")
1057  {
1058  std::istringstream in(tempString.string());
1059  ossimString tempValue;
1060  for(idx = 0; idx < theSolarIrradiance.size();++idx)
1061  {
1062  in >> tempValue.string();
1063  theSolarIrradiance[idx] = tempValue.toDouble();
1064  }
1065  }
1066 
1067  return true;
1068  }
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
static const char * IMAGE_DATE_KW
const char * find(const char *key) const
static const char * TYPE_KW
ossimGpt createGround(const ossimString &s) const
unsigned int ossim_uint32
static const char * NUMBER_BANDS_KW
static const char * AZIMUTH_ANGLE_KW
ossimDpt createDpt(const ossimString &s) const
std::vector< ossim_float64 > thePhysicalBias
Calibration information for radiometric corrections.
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
static const char * ELEVATION_ANGLE_KW
ossimIpt createIpt(const ossimString &s) const
ossimDpt theRefImagePoint
Zero based center of frame.
const std::string & string() const
Definition: ossimString.h:414

◆ parseCoordinateReferenceSystem()

bool ossimplugins::ossimSpot6DimapSupportData::parseCoordinateReferenceSystem ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Coordinate Reference System:

From xml section: /Dimap_Document/Coordinate_Reference_System/

NOT YET USED

Returns
true.

Definition at line 1740 of file ossimSpot6DimapSupportData.cpp.

Referenced by parseXmlFile().

1742  {
1743  return true;
1744  }

◆ parseDatasetContent()

bool ossimplugins::ossimSpot6DimapSupportData::parseDatasetContent ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Dataset Content:

From xml section: /Dimap_Document/Dataset_Content/

Initializes: theRefGroundPoint theUlCorner theUrCorner theLrCorner theLlCorner

Note that the theRefGroundPoint will be the zero based center of the whole mega image. Note that the corners will be the corners of the whole mega image.

Returns
true on success, false if not found.

Definition at line 1138 of file ossimSpot6DimapSupportData.cpp.

References ossimString::clear(), ossimXmlDocument::findNodes(), ossimGpt::hgt, ossimGpt::lat, ossimDpt::line, ossimGpt::lon, ossimDpt::samp, ossimErrorStatusInterface::setErrorStatus(), theLlCorner, theLrCorner, theRefGroundPoint, theUlCorner, theUrCorner, theXmlDocumentRoot, and ossimString::toDouble().

Referenced by parseXmlFile().

1140  {
1141  ossimString xpath, nodeValue;
1142  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1143 
1144  //---
1145  // Corner points:
1146  //---
1147  xml_nodes.clear();
1148  xpath = "/Dataset_Content/Dataset_Extent/Vertex";
1149  xpath = theXmlDocumentRoot + xpath;
1150  xmlDocument->findNodes(xpath, xml_nodes);
1151  if (xml_nodes.size() != 4)
1152  {
1153  setErrorStatus();
1154  return false;
1155  }
1156  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node = xml_nodes.begin();
1157  while (node != xml_nodes.end())
1158  {
1159  ossimGpt gpt;
1160  ossimDpt ipt;
1161 
1162  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
1163  xpath = "LAT";
1164  (*node)->findChildNodes(xpath, sub_nodes);
1165  if (sub_nodes.size() == 0)
1166  {
1167  setErrorStatus();
1168  return false;
1169  }
1170  gpt.lat = sub_nodes[0]->getText().toDouble();
1171 
1172  sub_nodes.clear();
1173  xpath = "LON";
1174  (*node)->findChildNodes(xpath, sub_nodes);
1175  if (sub_nodes.size() == 0)
1176  {
1177  setErrorStatus();
1178  return false;
1179  }
1180  gpt.lon = sub_nodes[0]->getText().toDouble();
1181  gpt.hgt = 0.0; // assumed
1182 
1183  sub_nodes.clear();
1184  xpath = "ROW";
1185  (*node)->findChildNodes(xpath, sub_nodes);
1186  if (sub_nodes.size() == 0)
1187  {
1188  setErrorStatus();
1189  return false;
1190  }
1191  ipt.line = sub_nodes[0]->getText().toDouble() - 1.0;
1192 
1193  sub_nodes.clear();
1194  xpath = "COL";
1195  (*node)->findChildNodes(xpath, sub_nodes);
1196  if (sub_nodes.size() == 0)
1197  {
1198  setErrorStatus();
1199  return false;
1200  }
1201  ipt.samp = sub_nodes[0]->getText().toDouble() - 1.0;
1202 
1203  if (ipt.line < 1.0)
1204  if (ipt.samp < 1.0)
1205  theUlCorner = gpt;
1206  else
1207  theUrCorner = gpt;
1208  else
1209  if (ipt.samp < 1.0)
1210  theLlCorner = gpt;
1211  else
1212  theLrCorner = gpt;
1213 
1214  ++node;
1215  }
1216 
1217 
1218 
1219  //---
1220  // Center of frame.
1221  //---
1222  theRefGroundPoint.hgt = 0.0; // TODO needs to be looked up
1223 
1224  if (!readOneXmlNode(xmlDocument,
1225  theXmlDocumentRoot + "/Dataset_Content/Dataset_Extent/Center/LON", // DIMAPv2
1226  nodeValue))
1227  {
1228  return false;
1229  }
1230  theRefGroundPoint.lon = nodeValue.toDouble();
1231 
1232  if (!readOneXmlNode(xmlDocument, theXmlDocumentRoot + "/Dataset_Content/Dataset_Extent/Center/LAT", nodeValue)) // DIMAPv2
1233  {
1234  return false;
1235  }
1236  theRefGroundPoint.lat = nodeValue.toDouble();
1237 
1238  return true;
1239  }
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
void clear()
Erases the entire container.
Definition: ossimString.h:432
double samp
Definition: ossimDpt.h:164
ossim_float64 hgt
Height in meters above the ellipsiod.
Definition: ossimGpt.h:274
double line
Definition: ossimDpt.h:165
ossim_float64 lon
Definition: ossimGpt.h:266
double toDouble() const
ossim_float64 lat
Definition: ossimGpt.h:265
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):

◆ parseDatasetIdentification()

bool ossimplugins::ossimSpot6DimapSupportData::parseDatasetIdentification ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Dataset Identification:

From xml section: /Dimap_Document/Dataset_Identification/

NOT YET USED

Returns
true.

Definition at line 1734 of file ossimSpot6DimapSupportData.cpp.

Referenced by parseXmlFile().

1736  {
1737  return true;
1738  }

◆ parseDatasetSources()

bool ossimplugins::ossimSpot6DimapSupportData::parseDatasetSources ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Definition at line 2120 of file ossimSpot6DimapSupportData.cpp.

References ossimNotify(), ossimNotifyLevel_DEBUG, ossimErrorStatusInterface::setErrorStatus(), theAcquisitionDate, theInstrument, theInstrumentIndex, theSensorID, and theXmlDocumentRoot.

Referenced by parseXmlFile().

2121  {
2122  // static const char MODULE[] = "ossimSpot6DimapSupportData::parseDatasetSources";
2123  ossimString xpath, nodeValue;
2124  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2125 
2126  //---
2127  // Fetch the mission index (1A ou 1B) ?
2128  // and generate theSensorID
2129  //---
2130  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/MISSION";
2131  xpath = theXmlDocumentRoot + xpath;
2132  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
2133  {
2134  return false;
2135  }
2136 
2137  if (nodeValue != "SPOT")
2138  {
2139  setErrorStatus();
2140  if (traceDebug())
2141  {
2142  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nNot a SPOT mission!"<< std::endl;
2143  }
2144  return false;
2145  }
2146 
2147  //---
2148  // Fetch the mission index (1A ou 1B) ?
2149  // and generate theSensorID
2150  //---
2151  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/MISSION_INDEX"; //DIMAPv2
2152  xpath = theXmlDocumentRoot + xpath;
2153  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
2154  {
2155  return false;
2156  }
2157 
2158  if (nodeValue == "6")
2159  theSensorID = "SPOT 6";
2160  else
2161  {
2162  setErrorStatus();
2163  if (traceDebug())
2164  {
2165  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nNot a valid sensorID!"<< std::endl;
2166  }
2167  return false;
2168  }
2169 
2170  //---
2171  // Fetch the Instrument:
2172  //---
2173  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/INSTRUMENT";
2174  xpath = theXmlDocumentRoot + xpath;
2175  if (!readOneXmlNode(xmlDocument, xpath, theInstrument))
2176  {
2177  return false;
2178  }
2179 
2180  //---
2181  // Fetch the Instrument Index:
2182  //---
2183  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/INSTRUMENT_INDEX"; //DIMAPv2
2184  xpath = theXmlDocumentRoot + xpath;
2185  if (!readOneXmlNode(xmlDocument, xpath, theInstrumentIndex))
2186  {
2187  return false;
2188  }
2189 
2190  //---
2191  // Fetch the Imaging Date:
2192  //---
2193  ossimString firstLineImagingDate;
2194  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/IMAGING_DATE"; //DIMAPv2
2195  xpath = theXmlDocumentRoot + xpath;
2196  if (!readOneXmlNode(xmlDocument, xpath, firstLineImagingDate))
2197  {
2198  return false;
2199  }
2200 
2201  //---
2202  // Fetch the Imaging Time:
2203  //---
2204  ossimString firstLineImagingTime;
2205  xpath = "/Dataset_Sources/Source_Identification/Strip_Source/IMAGING_TIME"; //DIMAPv2
2206  xpath = theXmlDocumentRoot + xpath;
2207  if (!readOneXmlNode(xmlDocument, xpath, firstLineImagingTime))
2208  {
2209  return false;
2210  }
2211 
2212  theAcquisitionDate = firstLineImagingDate + "T" + firstLineImagingTime;
2213 
2214  return true;
2215  }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ parseGeometricData()

bool ossimplugins::ossimSpot6DimapSupportData::parseGeometricData ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Definition at line 2000 of file ossimSpot6DimapSupportData.cpp.

References ossimString::clear(), ossimXmlDocument::findNodes(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimErrorStatusInterface::setErrorStatus(), theAzimuthAngle, theIncidenceAngle, theSunAzimuth, theSunElevation, theViewingAngle, and theXmlDocumentRoot.

Referenced by parseXmlFile().

2001  {
2002  ossimString xpath;
2003  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
2004 
2005  xml_nodes.clear();
2006  xpath = "/Geometric_Data/Use_Area/Located_Geometric_Values"; //DIMAPv2
2007  xpath = theXmlDocumentRoot + xpath;
2008  xmlDocument->findNodes(xpath, xml_nodes);
2009  if (xml_nodes.size() != 9 )
2010  {
2011  setErrorStatus();
2012  if(traceDebug())
2013  {
2014  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2015  }
2016  return false;
2017  }
2018 
2019  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node = xml_nodes.begin();
2020  while (node != xml_nodes.end())
2021  {
2022  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
2023 
2024  //---
2025  // Fetch the Sun Azimuth:
2026  //---
2027  xpath = "Solar_Incidences/SUN_AZIMUTH";
2028  (*node)->findChildNodes(xpath, sub_nodes);
2029  if (sub_nodes.size() == 0)
2030  {
2031  setErrorStatus();
2032  if(traceDebug())
2033  {
2034  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2035  }
2036  return false;
2037  }
2038  theSunAzimuth.push_back(sub_nodes[0]->getText().toDouble());
2039 
2040  //---
2041  // Fetch the Sun Elevation:
2042  //---
2043  sub_nodes.clear();
2044  xpath = "Solar_Incidences/SUN_ELEVATION";
2045  (*node)->findChildNodes(xpath, sub_nodes);
2046  if (sub_nodes.size() == 0)
2047  {
2048  setErrorStatus();
2049  if(traceDebug())
2050  {
2051  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2052  }
2053  return false;
2054  }
2055  theSunElevation.push_back(sub_nodes[0]->getText().toDouble());
2056 
2057  //---
2058  // Fetch the Incidence Angle:
2059  //---
2060  sub_nodes.clear();
2061  xpath = "Acquisition_Angles/INCIDENCE_ANGLE"; //DIMAPv2
2062  (*node)->findChildNodes(xpath, sub_nodes);
2063  if (sub_nodes.size() == 0)
2064  {
2065  setErrorStatus();
2066  if(traceDebug())
2067  {
2068  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2069  }
2070  return false;
2071  }
2072  theIncidenceAngle.push_back(sub_nodes[0]->getText().toDouble());
2073 
2074  //---
2075  // Fetch the Viewing Angle:
2076  //---
2077  sub_nodes.clear();
2078  xpath = "Acquisition_Angles/VIEWING_ANGLE"; //DIMAPv2
2079  (*node)->findChildNodes(xpath, sub_nodes);
2080  if (sub_nodes.size() == 0)
2081  {
2082  setErrorStatus();
2083  if(traceDebug())
2084  {
2085  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2086  }
2087  return false;
2088  }
2089  theViewingAngle.push_back(sub_nodes[0]->getText().toDouble());
2090 
2091  //---
2092  // Fetch the Azimuth Angle:
2093  //---
2094  sub_nodes.clear();
2095  xpath = "Acquisition_Angles/AZIMUTH_ANGLE"; //DIMAPv2
2096  (*node)->findChildNodes(xpath, sub_nodes);
2097  if (sub_nodes.size() == 0)
2098  {
2099  setErrorStatus();
2100  if(traceDebug())
2101  {
2102  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << std::endl;
2103  }
2104  return false;
2105  }
2106  theAzimuthAngle.push_back(sub_nodes[0]->getText().toDouble());
2107 
2108  ++node;
2109  }
2110 
2111  return true;
2112  }
void clear()
Erases the entire container.
Definition: ossimString.h:432
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ parseGeoposition()

bool ossimplugins::ossimSpot6DimapSupportData::parseGeoposition ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Geoposition:

From xml section: /Dimap_Document/Geoposition/

NOT YET USED

Returns
true.

Definition at line 1746 of file ossimSpot6DimapSupportData.cpp.

Referenced by parseXmlFile().

1748  {
1749  return true;
1750  }

◆ parseMetadataIdentificationDIMAPv2()

bool ossimplugins::ossimSpot6DimapSupportData::parseMetadataIdentificationDIMAPv2 ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Definition at line 1607 of file ossimSpot6DimapSupportData.cpp.

References ossimString::clear(), ossimXmlDocument::findNodes(), OSSIM_Spot6_DIMAPv2, OSSIM_Spot6_METADATA_SUBPROFILE_PRODUCT, OSSIM_Spot6_METADATA_SUBPROFILE_RPC, OSSIM_Spot6_METADATA_SUBPROFILE_UNKNOWN, ossimNotify(), ossimNotifyLevel_DEBUG, ossimNotifyLevel_WARN, ossimErrorStatusInterface::setErrorStatus(), theDIMAPVersion, theMetadataSubProfile, and theXmlDocumentRoot.

Referenced by parseXmlFile().

1608  {
1609  // static const char MODULE[] = "ossimSpot6DimapSupportData::parseMetadataIdentification";
1610 
1611  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1612  ossimString xpath, nodeValue;
1613  theXmlDocumentRoot = "/DIMAP_Document";
1614 
1615  //---
1616  // Get the version string which can be used as a key for parsing.
1617  //---
1618  xml_nodes.clear();
1619  xpath = "/Metadata_Identification/METADATA_FORMAT";
1620  xpath = theXmlDocumentRoot + xpath;
1621  xmlDocument->findNodes(xpath, xml_nodes);
1622  if (xml_nodes.size() == 0)
1623  {
1624 
1625  // FIXME MSD: used to support Spot6/Pleiades samples from SPOT-IMAGES website which are not coherent
1626  // with the specification (28/09/2012). Should be remove when first data will be available and sample
1627  // replaced.
1628  theXmlDocumentRoot = "/SPOT_DIMAP_Document";
1629  if (traceDebug())
1630  {
1631  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nTry to use the old root: " << theXmlDocumentRoot << endl;
1632  }
1633 
1634  xml_nodes.clear();
1635  xpath = "/Metadata_Identification/METADATA_FORMAT";
1636  xpath = theXmlDocumentRoot + xpath;
1637  xmlDocument->findNodes(xpath, xml_nodes);
1638  if (xml_nodes.size() == 0)
1639  {
1640  // FIXME MSD: used to support spot6/peiades samples from SPOT-IMAGES website which are not coherent
1641  // with the specification (28/09/2012). Should be remove when first data will be available and sample
1642  // replaced.
1643  theXmlDocumentRoot = "/Dimap_Document";
1644  if (traceDebug())
1645  {
1646  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nTry to use the new root: " << theXmlDocumentRoot << endl;
1647  }
1648 
1649  xml_nodes.clear();
1650  xpath = "/Metadata_Identification/METADATA_FORMAT";
1651  xpath = theXmlDocumentRoot + xpath;
1652  xmlDocument->findNodes(xpath, xml_nodes);
1653  if (xml_nodes.size() == 0)
1654  {
1655  setErrorStatus();
1656  if (traceDebug())
1657  {
1658  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:\nCould not find: " << xpath << endl;
1659  }
1660  return false;
1661  }
1662  }
1663  }
1664 
1665  ossimString attribute = "version";
1666  ossimString value;
1667  xml_nodes[0]->getAttributeValue(value, attribute);
1668  if (value != "2.0")
1669  {
1670  setErrorStatus();
1671  if (traceDebug())
1672  {
1674  << "WARNING: DIMAP metadata version is not correct!" << std::endl;
1675  }
1676  return false;
1677  }
1678 
1679  //---
1680  // Check that it is a valid SPOT DIMAPv2 file
1681  //---
1682  xpath = "/Metadata_Identification/METADATA_PROFILE";
1683  xpath = theXmlDocumentRoot + xpath;
1684  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1685  {
1686  return false;
1687  }
1688 
1689  ossimString metadataProfile;
1690  if ( (nodeValue != "S6_SENSOR")
1691  && (nodeValue != "S6_ORTHO")
1692  && (nodeValue != "S6_MOSAIC") )
1693  {
1694  if (traceDebug())
1695  {
1697  << "DEBUG:\n Not a Spot6 DIMAPv2 file: metadata profile is incorrect!" << std::endl;
1698  }
1699  return false;
1700  }
1701  else
1702  metadataProfile = nodeValue;
1703 
1704  //---
1705  // Get the subprofile
1706  //---
1707  xpath = "/Metadata_Identification/METADATA_SUBPROFILE";
1708  xpath = theXmlDocumentRoot + xpath;
1709  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1710  {
1711  return false;
1712  }
1713 
1714  if ((nodeValue == "PRODUCT"))
1716  else if ( (nodeValue == "RPC") && (metadataProfile == "S6_SENSOR") )
1718  else
1719  {
1721  if (traceDebug())
1722  {
1724  << "DEBUG:\n Not a Spot6 DIMAPv2 file: metadata subprofile is incorrect !" << std::endl;
1725  }
1726  return false;
1727  }
1728 
1730 
1731  return true;
1732  }
void clear()
Erases the entire container.
Definition: ossimString.h:432
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ parseProcessingInformation()

bool ossimplugins::ossimSpot6DimapSupportData::parseProcessingInformation ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Processing Information:

From xml section: /Dimap_Document/Processing_Information/

Initializes: theProcessingLevel theSpectralProcessing

Returns
true on success, false if not found.

Definition at line 1752 of file ossimSpot6DimapSupportData.cpp.

References theProcessingLevelString, theSpectralProcessingString, and theXmlDocumentRoot.

Referenced by parseXmlFile().

1753  {
1754  // static const char MODULE[] = "ossimSpot6DimapSupportData::parseProcessingInformation";
1755 
1756  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1757  ossimString xpath, nodeValue;
1758 
1759  //---
1760  // Fetch the Processing Level:
1761  //---
1762  xpath = "/Processing_Information/Product_Settings/PROCESSING_LEVEL"; //DIMAPv2
1763  xpath = theXmlDocumentRoot + xpath;
1764  if (!readOneXmlNode(xmlDocument, xpath, theProcessingLevelString))
1765  {
1766  return false;
1767  }
1768 
1769  //---
1770  // Fetch the Spectral Processing:
1771  //---
1772  xpath = "/Processing_Information/Product_Settings/PROCESSING_LEVEL"; //DIMAPv2
1773  xpath = theXmlDocumentRoot + xpath;
1774  if (!readOneXmlNode(xmlDocument, xpath, theSpectralProcessingString))
1775  {
1776  return false;
1777  }
1778 
1779  return true;
1780  }

◆ parseProductInformation()

bool ossimplugins::ossimSpot6DimapSupportData::parseProductInformation ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Product Information:

From xml section: /Dimap_Document/Product_Information/

Initializes: theImageID theProductionDate

Returns
true on success, false if not found.

Definition at line 1109 of file ossimSpot6DimapSupportData.cpp.

References theImageID, theProductionDate, and theXmlDocumentRoot.

Referenced by parseXmlFile().

1111  {
1112  ossimString xpath;
1113  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1114 
1115  //---
1116  // Fetch the Image ID:
1117  //---
1118  xpath = "/Product_Information/Delivery_Identification/JOB_ID"; //DIMAPv2
1119  xpath = theXmlDocumentRoot + xpath;
1120  if (!readOneXmlNode(xmlDocument, xpath, theImageID))
1121  {
1122  return false;
1123  }
1124 
1125  //---
1126  // Fetch the ProductionDate:
1127  //---
1128  xpath = "/Product_Information/Delivery_Identification/PRODUCTION_DATE"; //DIMAPv2
1129  xpath = theXmlDocumentRoot + xpath;
1130  if (!readOneXmlNode(xmlDocument, xpath, theProductionDate))
1131  {
1132  return false;
1133  }
1134 
1135  return true;
1136  }

◆ parseQualityAssessment()

bool ossimplugins::ossimSpot6DimapSupportData::parseQualityAssessment ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

QualityAssessment:

From xml section: /Dimap_Document/Quality_Assessment/

NOT YET USED

Returns
true.

Definition at line 2114 of file ossimSpot6DimapSupportData.cpp.

Referenced by parseXmlFile().

2116  {
2117  return true;
2118  }

◆ parseRadiometricData()

bool ossimplugins::ossimSpot6DimapSupportData::parseRadiometricData ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Definition at line 1241 of file ossimSpot6DimapSupportData.cpp.

References ossimXmlDocument::findNodes(), ossimNotify(), ossimNotifyLevel_WARN, ossimErrorStatusInterface::setErrorStatus(), theNumBands, thePhysicalBias, thePhysicalGain, theSolarIrradiance, and theXmlDocumentRoot.

Referenced by parseXmlFile().

1243  {
1244  ossimString xpath;
1245  std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1246  std::vector<ossimRefPtr<ossimXmlNode> > sub_nodes;
1247  std::vector<ossimRefPtr<ossimXmlNode> >::iterator node;
1248 
1249  //---
1250  // Fetch the gain and bias for each spectral band:
1251  //---
1252  thePhysicalGain.assign(theNumBands, 1.000);
1253  thePhysicalBias.assign(theNumBands, 0.000);
1254 
1255  xml_nodes.clear();
1256  xpath = "/Radiometric_Data/Radiometric_Calibration/Instrument_Calibration/Band_Measurement_List/Band_Radiance"; //DIMAPv2
1257  xpath = theXmlDocumentRoot + xpath;
1258  xmlDocument->findNodes(xpath, xml_nodes);
1259 
1260  node = xml_nodes.begin();
1261  while (node != xml_nodes.end())
1262  {
1263  sub_nodes.clear();
1264  xpath = "BAND_ID";
1265  (*node)->findChildNodes(xpath, sub_nodes);
1266  if (sub_nodes.size() == 0)
1267  {
1268  setErrorStatus();
1269  return false;
1270  }
1271 
1272  ossimString bandName = sub_nodes[0]->getText();
1273  ossim_uint32 bandIndex = 0;
1274  if ( (theNumBands == 1) || (bandName == "B0") || (bandName == "P") )
1275  {
1276  bandIndex = 0;
1277  }
1278  else if (bandName == "B1")
1279  {
1280  bandIndex = 1;
1281  }
1282  else if (bandName == "B2")
1283  {
1284  bandIndex = 2;
1285  }
1286  else if (bandName == "B3")
1287  {
1288  bandIndex = 3;
1289  }
1290  else
1291  {
1293  << "ossimSpot6DimapSupportData::parseRadiometricMetadata ERROR: Band ID is incorrect\n";
1294  }
1295 
1296  if ((bandIndex >= theNumBands ) )
1297  {
1299  << "ossimSpot6DimapSupportData::parseRadiometricMetadata ERROR: Band index outside of range\n";
1300  return false;
1301  }
1302 
1303  sub_nodes.clear();
1304  xpath = "BIAS"; //DIMAPv2
1305  (*node)->findChildNodes(xpath, sub_nodes);
1306  if (sub_nodes.size() == 0)
1307  {
1308  setErrorStatus();
1309  return false;
1310  }
1311  thePhysicalBias[bandIndex] = sub_nodes[0]->getText().toDouble();
1312 
1313  sub_nodes.clear();
1314  xpath = "GAIN"; //DIMAPv2
1315  (*node)->findChildNodes(xpath, sub_nodes);
1316  if (sub_nodes.size() == 0)
1317  {
1318  setErrorStatus();
1319  return false;
1320  }
1321  thePhysicalGain[bandIndex] = sub_nodes[0]->getText().toDouble();
1322 
1323  ++node;
1324  }
1325 
1326  // Initialize to 999 : we find this value in some DIMAPv2 file
1327  // and there is no such tag in DIMAPv1 file
1328  theSolarIrradiance.assign(theNumBands, 999.000);
1329 
1330  xml_nodes.clear();
1331  xpath = "/Radiometric_Data/Radiometric_Calibration/Instrument_Calibration/Band_Measurement_List/Band_Solar_Irradiance";
1332  xpath = theXmlDocumentRoot + xpath;
1333  xmlDocument->findNodes(xpath, xml_nodes);
1334 
1335  node = xml_nodes.begin();
1336  while (node != xml_nodes.end())
1337  {
1338  sub_nodes.clear();
1339  xpath = "BAND_ID";
1340  (*node)->findChildNodes(xpath, sub_nodes);
1341  if (sub_nodes.size() == 0)
1342  {
1343  setErrorStatus();
1344  return false;
1345  }
1346 
1347  ossimString bandName = sub_nodes[0]->getText();
1348  ossim_uint32 bandIndex = 0;
1349  if ( (theNumBands == 1) || (bandName == "B0") || (bandName == "P") )
1350  {
1351  bandIndex = 0;
1352  }
1353  else if (bandName == "B1")
1354  {
1355  bandIndex = 1;
1356  }
1357  else if (bandName == "B2")
1358  {
1359  bandIndex = 2;
1360  }
1361  else if (bandName == "B3")
1362  {
1363  bandIndex = 3;
1364  }
1365  else
1366  {
1368  << "ossimSpot6DimapSupportData::parseRadiometricMetadata ERROR: Band ID is incorrect\n";
1369  }
1370 
1371  if ((bandIndex >= theNumBands))
1372  {
1374  << "ossimSpot6DimapSupportData::parseRadiometricMetadata ERROR: Band index outside of range 2\n";
1375  return false;
1376  }
1377 
1378  sub_nodes.clear();
1379  xpath = "VALUE";
1380  (*node)->findChildNodes(xpath, sub_nodes);
1381  if (sub_nodes.size() == 0)
1382  {
1383  setErrorStatus();
1384  return false;
1385  }
1386  theSolarIrradiance[bandIndex] = sub_nodes[0]->getText().toDouble();
1387 
1388  ++node;
1389  }
1390 
1391  return true;
1392  }
unsigned int ossim_uint32
std::vector< ossim_float64 > thePhysicalBias
Calibration information for radiometric corrections.
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ parseRasterData()

bool ossimplugins::ossimSpot6DimapSupportData::parseRasterData ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Definition at line 1782 of file ossimSpot6DimapSupportData.cpp.

References ossimXmlDocument::findNodes(), ossimBooleanProperty::getBoolean(), ossimIpt::line, ossimDpt::line, ossimNotify(), ossimNotifyLevel_DEBUG, ossimIpt::samp, ossimDpt::samp, ossimErrorStatusInterface::setErrorStatus(), ossimBooleanProperty::setValue(), theBandOrder, theImageSize, theMultiDataFile, theNumBands, theNumberOfMegaTiles, theNumberOfMegaTilesInCol, theNumberOfMegaTilesInRow, theRefImagePoint, theTileSize, theXmlDocumentRoot, ossimString::toInt(), and ossimString::toUInt32().

Referenced by parseXmlFile().

1783  {
1784  static const char MODULE[] = "ossimSpot6DimapSupportData::parseRasterData";
1785  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1786  ossimString xpath, nodeValue;
1787  //---
1788  // Fetch if the product file is linked to one or many JP2 files:
1789  //---
1790  xpath = "/Raster_Data/Data_Access/DATA_FILE_TILES"; //DIMAPv2
1791  xpath = theXmlDocumentRoot + xpath;
1792  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1793  {
1794  return false;
1795  }
1796  theMultiDataFile.setValue(nodeValue);
1797 
1798  //---
1799  // Fetch the MegaImageSize:
1800  //---
1801  xpath = "/Raster_Data/Raster_Dimensions/NCOLS"; //DIMAPv2
1802  xpath = theXmlDocumentRoot + xpath;
1803  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1804  {
1805  return false;
1806  }
1807  theImageSize.samp = nodeValue.toInt();
1808 
1809  xpath = "/Raster_Data/Raster_Dimensions/NROWS"; //DIMAPv2
1810  xpath = theXmlDocumentRoot + xpath;
1811  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1812  {
1813  return false;
1814  }
1815  theImageSize.line = nodeValue.toInt();
1816 
1818  {
1819  //---
1820  // Fetch the Number of MegaTiles:
1821  //---
1822  xpath = "/Raster_Data/Raster_Dimensions/Tile_Set/NTILES"; //DIMAPv2
1823  xpath = theXmlDocumentRoot + xpath;
1824  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1825  {
1826  return false;
1827  }
1828  theNumberOfMegaTiles = nodeValue.toUInt32();
1829 
1830  //---
1831  // Fetch the Number of MegaTiles in X and Y:
1832  //---
1833 
1834  xml_nodes.clear();
1835  xpath = "/Raster_Data/Raster_Dimensions/Tile_Set/Regular_Tiling/NTILES_COUNT"; //DIMAPv2
1836  xpath = theXmlDocumentRoot + xpath;
1837  xmlDocument->findNodes(xpath, xml_nodes);
1838  if (xml_nodes.size() == 0)
1839  {
1840  setErrorStatus();
1841  if (traceDebug())
1842  {
1843  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: \nCould not find: " << xpath << std::endl;
1844  }
1845  return false;
1846  }
1847 
1848  ossimString value;
1849  ossimString attribute = "ntiles_x";
1850  if (!xml_nodes[0]->getAttributeValue(value, attribute))
1851  {
1852  attribute = "ntiles_R";
1853  xml_nodes[0]->getAttributeValue(value, attribute);
1854  }
1856 
1857  attribute = "ntiles_y";
1858  if (!xml_nodes[0]->getAttributeValue(value, attribute))
1859  {
1860  attribute = "ntiles_C";
1861  xml_nodes[0]->getAttributeValue(value, attribute);
1862  }
1864 
1866  {
1867  setErrorStatus();
1868  if (traceDebug())
1869  {
1870  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: \nIncoherent number of tiles: " << xpath << std::endl;
1871  }
1872  return false;
1873  }
1874 
1875  //---
1876  // Fetch the size of MegaTiles:
1877  //---
1878  xml_nodes.clear();
1879  xpath = "/Raster_Data/Raster_Dimensions/Tile_Set/Regular_Tiling/NTILES_SIZE";
1880  xpath = theXmlDocumentRoot + xpath;
1881  xmlDocument->findNodes(xpath, xml_nodes);
1882  if (xml_nodes.size() == 0)
1883  {
1884  setErrorStatus();
1885  if (traceDebug())
1886  {
1887  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1888  }
1889  return false;
1890  }
1891 
1892 
1893  attribute = "nrows";
1894  xml_nodes[0]->getAttributeValue(value, attribute);
1895  theTileSize.line = value.toUInt32();
1896 
1897  attribute = "ncols";
1898  xml_nodes[0]->getAttributeValue(value, attribute);
1899  theTileSize.samp = value.toUInt32();
1900  }
1901 
1902  //--- TODO_MSD is it useful in the case of RPC model ???
1903  // We will make the RefImagePoint the zero base center of the image. This
1904  // is used by the ossimSensorModel::worldToLineSample iterative loop as
1905  // the starting point. Since the ossimSensorModel does not know of the
1906  // sub image we make it zero base. (comments from spot)
1907  //---
1910 
1911  //---
1912  // Fetch number of bands
1913  //---
1914  xpath = "/Raster_Data/Raster_Dimensions/NBANDS"; //DIMAPv2
1915  xpath = theXmlDocumentRoot + xpath;
1916  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1917  {
1918  return false;
1919  }
1920  theNumBands = nodeValue.toUInt32();
1921 
1922  if (traceDebug())
1923  {
1924  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nNumber of bands: " << theNumBands << std::endl;
1925  }
1926 
1927  //---
1928  // Fetch Band Display Order
1929  //---
1930  xml_nodes.clear();
1931  xpath = "/Raster_Data/Raster_Display/Band_Display_Order/RED_CHANNEL"; //DIMAPv2
1932  xpath = theXmlDocumentRoot + xpath;
1933  xmlDocument->findNodes(xpath, xml_nodes);
1934  if (xml_nodes.size() == 0)
1935  {
1936  setErrorStatus();
1937  if (traceDebug())
1938  {
1939  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1940  }
1941  return false;
1942  }
1943  theBandOrder.push_back(xml_nodes[0]->getText());
1944 
1945  if (theNumBands > 1)
1946  {
1947  xml_nodes.clear();
1948  xpath = "/Raster_Data/Raster_Display/Band_Display_Order/GREEN_CHANNEL"; //DIMAPv2
1949  xpath = theXmlDocumentRoot + xpath;
1950  xmlDocument->findNodes(xpath, xml_nodes);
1951  if (xml_nodes.size() == 0)
1952  {
1953  setErrorStatus();
1954  if (traceDebug())
1955  {
1956  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1957  }
1958  return false;
1959  }
1960  theBandOrder.push_back(xml_nodes[0]->getText());
1961 
1962  xml_nodes.clear();
1963  xpath = "/Raster_Data/Raster_Display/Band_Display_Order/BLUE_CHANNEL"; //DIMAPv2
1964  xpath = theXmlDocumentRoot + xpath;
1965  xmlDocument->findNodes(xpath, xml_nodes);
1966  if (xml_nodes.size() == 0)
1967  {
1968  setErrorStatus();
1969  if (traceDebug())
1970  {
1971  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1972  }
1973  return false;
1974  }
1975  theBandOrder.push_back(xml_nodes[0]->getText());
1976 
1977  if (theNumBands > 3)
1978  {
1979  xml_nodes.clear();
1980  xpath = "/Raster_Data/Raster_Display/Band_Display_Order/ALPHA_CHANNEL"; //DIMAPv2
1981  xpath = theXmlDocumentRoot + xpath;
1982  xmlDocument->findNodes(xpath, xml_nodes);
1983  if (xml_nodes.size() == 0)
1984  {
1985  setErrorStatus();
1986  if (traceDebug())
1987  {
1988  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1989  }
1990  return false;
1991  }
1992 
1993  theBandOrder.push_back(xml_nodes[0]->getText());
1994  }
1995  }
1996 
1997  return true;
1998  }
virtual bool setValue(const ossimString &value)
double samp
Definition: ossimDpt.h:164
ossim_uint32 toUInt32() const
double line
Definition: ossimDpt.h:165
ossim_int32 samp
Definition: ossimIpt.h:141
ossim_int32 line
Definition: ossimIpt.h:142
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
int toInt() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimDpt theRefImagePoint
Zero based center of frame.

◆ parseRPCMetadata()

bool ossimplugins::ossimSpot6DimapSupportData::parseRPCMetadata ( ossimRefPtr< ossimXmlDocument xmlDocument)
private

Definition at line 1395 of file ossimSpot6DimapSupportData.cpp.

References ossimString::clear(), ossimXmlDocument::findNodes(), ossimNotify(), ossimNotifyLevel_DEBUG, ossimErrorStatusInterface::setErrorStatus(), theErrBiasX, theErrBiasY, theHeightOffset, theHeightScale, theLatOffset, theLatScale, theLineDenCoeff, theLineNumCoeff, theLineOffset, theLineScale, theLonOffset, theLonScale, theSampDenCoeff, theSampNumCoeff, theSampOffset, theSampScale, theSpecId, theXmlDocumentRoot, ossimString::toDouble(), and ossimString::toInt32().

Referenced by parseXmlFile().

1397  {
1398  static const char MODULE[] = "ossimSpot6DimapSupportData::parseRPCMetadata";
1399  ossimString xpath, nodeValue;
1400  vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
1401 
1402  //---
1403  // Fetch the Global RFM - Direct Model - Bias:
1404  //---
1405  xpath = "/Rational_Function_Model/Resource_Reference/RESOURCE_ID"; //DIMAPv2
1406  xpath = theXmlDocumentRoot + xpath;
1407  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1408  {
1409  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: Could not find: " << xpath << std::endl;
1410  return false;
1411  }
1412  theSpecId = nodeValue;
1413 
1414  //---
1415  // Fetch the Global RFM - Inverse Model:
1416  //---
1417  xml_nodes.clear();
1418  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model"; //DIMAPv2
1419  xpath = theXmlDocumentRoot + xpath;
1420  xmlDocument->findNodes(xpath, xml_nodes);
1421  if (xml_nodes.empty())
1422  {
1423  setErrorStatus();
1424  if(traceDebug())
1425  {
1426  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: Could not find: " << xpath << std::endl;
1427  }
1428  return false;
1429  }
1430 
1431  for (ossim_uint32 it = 1; it < 21; it ++)
1432  {
1433  std::ostringstream valueStr;
1434  valueStr << it;
1435 
1436  xml_nodes.clear();
1437  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/LINE_NUM_COEFF_"; //DIMAPv2
1438  xpath = theXmlDocumentRoot + xpath;
1439  xpath = xpath + valueStr.str();
1440  xmlDocument->findNodes(xpath, xml_nodes);
1441  if (xml_nodes.size() == 0)
1442  {
1443  setErrorStatus();
1444  if(traceDebug())
1445  {
1446  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1447  }
1448  return false;
1449  }
1450  theLineNumCoeff.push_back(xml_nodes[0]->getText().toDouble());
1451 
1452  xml_nodes.clear();
1453  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/LINE_DEN_COEFF_"; //DIMAPv2
1454  xpath = theXmlDocumentRoot + xpath;
1455  xpath = xpath + valueStr.str();
1456  xmlDocument->findNodes(xpath, xml_nodes);
1457  if (xml_nodes.size() == 0)
1458  {
1459  setErrorStatus();
1460  if(traceDebug())
1461  {
1462  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1463  }
1464  return false;
1465  }
1466  theLineDenCoeff.push_back(xml_nodes[0]->getText().toDouble());
1467 
1468  xml_nodes.clear();
1469  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/SAMP_NUM_COEFF_"; //DIMAPv2
1470  xpath = theXmlDocumentRoot + xpath;
1471  xpath = xpath + valueStr.str();
1472  xmlDocument->findNodes(xpath, xml_nodes);
1473  if (xml_nodes.size() == 0)
1474  {
1475  setErrorStatus();
1476  if(traceDebug())
1477  {
1478  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1479  }
1480  return false;
1481  }
1482  theSampNumCoeff.push_back(xml_nodes[0]->getText().toDouble());
1483 
1484  xml_nodes.clear();
1485  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/SAMP_DEN_COEFF_"; //DIMAPv2
1486  xpath = theXmlDocumentRoot + xpath;
1487  xpath = xpath + valueStr.str();
1488  xmlDocument->findNodes(xpath, xml_nodes);
1489  if (xml_nodes.size() == 0)
1490  {
1491  setErrorStatus();
1492  if(traceDebug())
1493  {
1494  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nCould not find: " << xpath << std::endl;
1495  }
1496  return false;
1497  }
1498  theSampDenCoeff.push_back(xml_nodes[0]->getText().toDouble());
1499  }
1500 
1501 
1502  //---
1503  // Fetch the Global RFM - Inverse Model - Bias:
1504  //---
1505  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/ERR_BIAS_ROW"; //DIMAPv2
1506  xpath = theXmlDocumentRoot + xpath;
1507  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1508  {
1509  return false;
1510  }
1511  theErrBiasX = nodeValue.toDouble();
1512  xpath = "/Rational_Function_Model/Global_RFM/Inverse_Model/ERR_BIAS_COL"; //DIMAPv2
1513  xpath = theXmlDocumentRoot + xpath;
1514  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1515  {
1516  return false;
1517  }
1518  theErrBiasY = nodeValue.toDouble();
1519 
1520  //---
1521  // Fetch the Global RFM validity parameters :
1522  //---
1523 
1524  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LONG_SCALE"; //DIMAPv2
1525  xpath = theXmlDocumentRoot + xpath;
1526  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1527  {
1528  return false;
1529  }
1530  theLonScale = nodeValue.toDouble();
1531 
1532  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LONG_OFF"; //DIMAPv2
1533  xpath = theXmlDocumentRoot + xpath;
1534  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1535  {
1536  return false;
1537  }
1538  theLonOffset = nodeValue.toDouble();
1539 
1540  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LAT_SCALE"; //DIMAPv2
1541  xpath = theXmlDocumentRoot + xpath;
1542  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1543  {
1544  return false;
1545  }
1546  theLatScale = nodeValue.toDouble();
1547 
1548  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LAT_OFF"; //DIMAPv2
1549  xpath = theXmlDocumentRoot + xpath;
1550  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1551  {
1552  return false;
1553  }
1554  theLatOffset = nodeValue.toDouble();
1555 
1556  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/HEIGHT_SCALE";
1557  xpath = theXmlDocumentRoot + xpath;
1558  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1559  {
1560  return false;
1561  }
1562  theHeightScale = nodeValue.toDouble();
1563 
1564  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/HEIGHT_OFF"; //DIMAPv2
1565  xpath = theXmlDocumentRoot + xpath;
1566  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1567  {
1568  return false;
1569  }
1570  theHeightOffset = nodeValue.toDouble();
1571 
1572  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/SAMP_SCALE"; //DIMAPv2
1573  xpath = theXmlDocumentRoot + xpath;
1574  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1575  {
1576  return false;
1577  }
1578  theSampScale = nodeValue.toDouble();
1579 
1580  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/SAMP_OFF"; //DIMAPv2
1581  xpath = theXmlDocumentRoot + xpath;
1582  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1583  {
1584  return false;
1585  }
1586  theSampOffset = nodeValue.toInt32();
1587 
1588  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LINE_SCALE"; //DIMAPv2
1589  xpath = theXmlDocumentRoot + xpath;
1590  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1591  {
1592  return false;
1593  }
1594  theLineScale = nodeValue.toDouble();
1595 
1596  xpath = "/Rational_Function_Model/Global_RFM/RFM_Validity/LINE_OFF"; //DIMAPv2
1597  xpath = theXmlDocumentRoot + xpath;
1598  if (!readOneXmlNode(xmlDocument, xpath, nodeValue))
1599  {
1600  return false;
1601  }
1602  theLineOffset = nodeValue.toInt32();
1603 
1604  return true;
1605  }
void clear()
Erases the entire container.
Definition: ossimString.h:432
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
ossim_int32 toInt32() const
unsigned int ossim_uint32
double toDouble() const
void findNodes(const ossimString &xpath, std::vector< ossimRefPtr< ossimXmlNode > > &nodelist) const
Appends any matching nodes to the list supplied (should be empty):
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ parseXmlFile()

bool ossimplugins::ossimSpot6DimapSupportData::parseXmlFile ( const ossimFilename file)

Definition at line 339 of file ossimSpot6DimapSupportData.cpp.

References allMetadataRead(), ossimString::c_str(), clearFields(), ossimString::contains(), ossimString::empty(), ossimFilename::fileSize(), ossimErrorStatusInterface::getErrorStatus(), min, OSSIM_Spot6_METADATA_SUBPROFILE_PRODUCT, OSSIM_Spot6_METADATA_SUBPROFILE_RPC, ossimNotify(), ossimNotifyLevel_DEBUG, ossimNotifyLevel_FATAL, parseCoordinateReferenceSystem(), parseDatasetContent(), parseDatasetIdentification(), parseDatasetSources(), parseGeometricData(), parseGeoposition(), parseMetadataIdentificationDIMAPv2(), parseProcessingInformation(), parseProductInformation(), parseQualityAssessment(), parseRadiometricData(), parseRasterData(), parseRPCMetadata(), printInfo(), ossimXmlDocument::read(), ossimErrorStatusInterface::setErrorStatus(), ossimString::string(), theMetadataSubProfile, theProcessingLevelString, theProductIsOk, and theRpcIsOk.

340  {
341  static const char MODULE[] = "ossimSpot6DimapSupportData::parseXmlFile";
342  //traceDebug.setTraceFlag(true);
343 
344  if(traceDebug())
345  {
346  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:" << "\nFile: " << file << std::endl;
347  }
348 
349  if (allMetadataRead())
350  clearFields();
351 
352  //---
353  // Instantiate the file reading:
354  //---
355  ossim_int64 fileSize = file.fileSize();
356  std::ifstream in(file.c_str(), std::ios::binary|std::ios::in);
357  std::vector<char> fullBuffer;
358  ossimString bufferedIo;
359  if(in.good()&&(fileSize > 0))
360  {
361  char buf[100];
362  fullBuffer.resize(fileSize);
363  in.read(buf, std::min((ossim_int64)100, fileSize));
364  if(!in.fail())
365  {
366  ossimString testString = ossimString(buf,
367  buf + in.gcount());
368  if(testString.contains("xml"))
369  {
370  in.seekg(0);
371  in.read(&fullBuffer.front(), (std::streamsize)fullBuffer.size());
372  if(!in.fail())
373  {
374  bufferedIo = ossimString(fullBuffer.begin(),
375  fullBuffer.begin()+in.gcount());
376  }
377  }
378  }
379  }
380  else
381  {
382  return false;
383  }
384  //---
385  // Instantiate the XML parser:
386  //---
387  ossimRefPtr<ossimXmlDocument> xmlDocument;
388 
389  if(bufferedIo.empty())
390  {
391  xmlDocument = new ossimXmlDocument(file);
392  }
393  else
394  {
395  xmlDocument = new ossimXmlDocument;
396  std::istringstream inStringStream(bufferedIo.string());
397  if(!xmlDocument->read(inStringStream))
398  {
399  return false;
400  }
401  }
402  if (xmlDocument->getErrorStatus())
403  {
404  if(traceDebug())
405  {
407  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
408  << "\nUnable to parse xml file" << std::endl;
409  }
410  setErrorStatus();
411  return false;
412  }
413 
414  if (!parseMetadataIdentificationDIMAPv2(xmlDocument) )
415  {
416  if (traceDebug())
417  {
419  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
420  << "\nparseMetadataIdentification failed. Returning false"
421  << std::endl;
422  }
423  return false;
424  }
425 
426 
428  {
429  if (theProductIsOk)
430  clearFields();
431 
432  if (!parseDatasetIdentification(xmlDocument))
433  {
434  if (traceDebug())
435  {
437  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
438  << "\nparseDatasetdentification failed. Returning false" << std::endl;
439  }
440  return false;
441  }
442 
443  if (!parseDatasetContent(xmlDocument))
444  {
446  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
447  << "\nparseDatasetContent failed. Returning false" << std::endl;
448  return false;
449  }
450 
451  if (!parseProductInformation(xmlDocument))
452  {
453  if (traceDebug())
454  {
456  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
457  << "\nparseProductInformation failed. Returning false" << std::endl;
458  }
459  return false;
460  }
461 
462  if (!parseCoordinateReferenceSystem(xmlDocument))
463  {
464  if (traceDebug())
465  {
467  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
468  << "\nparseCoordinateReferenceSystem failed. Returning false" << std::endl;
469  }
470  return false;
471  }
472 
473  if (!parseGeoposition(xmlDocument))
474  {
475  if (traceDebug())
476  {
478  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
479  << "\nparseGeoposition failed. Returning false" << std::endl;
480  }
481  return false;
482  }
483 
484  if (!parseProcessingInformation(xmlDocument))
485  {
486  if (traceDebug())
487  {
489  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
490  << "\nparseProcessingInformation failed. Returning false" << std::endl;
491  }
492  return false;
493  }
494 
495  if (!parseRasterData(xmlDocument))
496  {
497  if (traceDebug())
498  {
500  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
501  << "\nparseRasterData failed. Returning false" << std::endl;
502  }
503  return false;
504  }
505 
506  if (!parseRadiometricData(xmlDocument))
507  {
509  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
510  << "\nparseRadiometricData failed. Returning false" << std::endl;
511  return false;
512  }
513 
514  if (!parseGeometricData(xmlDocument))
515  {
517  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
518  << "\nparseGeometricData failed. Returning false" << std::endl;
519  return false;
520  }
521 
522  if (!parseQualityAssessment(xmlDocument))
523  {
525  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
526  << "\nparseQualityAssessment failed. Returning false" << std::endl;
527  return false;
528  }
529 
530  if (!parseDatasetSources(xmlDocument))
531  {
533  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
534  << "\nparseDatasetSources failed. Returning false" << std::endl;
535  return false;
536  }
537 
538  theProductIsOk = true;
539  }
540 
542  {
543  // Parse RPC file
544  if (theProcessingLevelString == "SENSOR")
545  {
546  if (parseRPCMetadata(xmlDocument) == false)
547  {
549  << MODULE << " DEBUG:" << "ossimSpot6DimapSupportData::parseXmlFile:"
550  << "\nparseRPCMetadata initialization failed. Returning false" << std::endl;
551  return false;
552  }
553  theRpcIsOk = true;
554  }
555  else
556  theRpcIsOk = true;
557  }
558 
559  if (theProcessingLevelString != "SENSOR")
560  theRpcIsOk = true;
561 
562  if (traceDebug() && allMetadataRead())
563  {
565  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG: exited..." << std::endl;
566  }
567 
568  return true;
569  }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
ossim_int64 fileSize() const
bool parseProductInformation(ossimRefPtr< ossimXmlDocument > xmlDocument)
Product Information:
bool contains(char aChar) const
Definition: ossimString.h:58
bool parseProcessingInformation(ossimRefPtr< ossimXmlDocument > xmlDocument)
Processing Information:
bool parseDatasetIdentification(ossimRefPtr< ossimXmlDocument > xmlDocument)
Dataset Identification:
bool parseRasterData(ossimRefPtr< ossimXmlDocument > xmlDocument)
bool parseGeometricData(ossimRefPtr< ossimXmlDocument > xmlDocument)
bool parseQualityAssessment(ossimRefPtr< ossimXmlDocument > xmlDocument)
QualityAssessment:
bool parseRPCMetadata(ossimRefPtr< ossimXmlDocument > xmlDocument)
bool parseMetadataIdentificationDIMAPv2(ossimRefPtr< ossimXmlDocument > xmlDocument)
bool parseDatasetSources(ossimRefPtr< ossimXmlDocument > xmlDocument)
bool parseDatasetContent(ossimRefPtr< ossimXmlDocument > xmlDocument)
Dataset Content:
bool parseRadiometricData(ossimRefPtr< ossimXmlDocument > xmlDocument)
virtual ossimErrorCode getErrorStatus() const
long long ossim_int64
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
bool empty() const
Definition: ossimString.h:411
bool parseGeoposition(ossimRefPtr< ossimXmlDocument > xmlDocument)
Geoposition:
bool read(std::istream &in)
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
bool parseCoordinateReferenceSystem(ossimRefPtr< ossimXmlDocument > xmlDocument)
Coordinate Reference System:
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
#define min(a, b)
Definition: auxiliary.h:75
const std::string & string() const
Definition: ossimString.h:414

◆ printInfo()

void ossimplugins::ossimSpot6DimapSupportData::printInfo ( ostream &  os) const

Definition at line 272 of file ossimSpot6DimapSupportData.cpp.

References theAcquisitionDate, theImageID, theInstrument, theInstrumentIndex, theNumBands, theProcessingLevelString, theProductionDate, and theSpectralProcessingString.

Referenced by parseXmlFile().

273  {
274 
275  os << "\n----------------- Info on Spot6 Image -------------------"
276  << "\n "
277  << "\n Job Number (ID): " << theImageID
278  << "\n Acquisition Date: " << theAcquisitionDate
279  << "\n Instrument: " << theInstrument
280  << "\n Instrument Index: " << theInstrumentIndex
281  << "\n Production Date: " << theProductionDate
282  << "\n Processing Level: " << theProcessingLevelString
283  << "\n Spectral Processing: " << theSpectralProcessingString
284 
285  << "\n Number of Bands: " << theNumBands
286  << "\n Bands Display Order: " << getVectorStringAsString(theBandOrder)
287 
288  << "\n Image Size: " << theImageSize
289  << "\n Tile Size: " << theTileSize
290  << "\n Number Of Tiles (Row, Col): " << theNumberOfMegaTiles << " ("
291  << theNumberOfMegaTilesInRow << ", "
292  << theNumberOfMegaTilesInCol << ")"
293 
294  << "\n Incidence Angle (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theIncidenceAngle)
295  << "\n Viewing Angle (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theViewingAngle)
296  << "\n Azimuth Angle (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theAzimuthAngle)
297  << "\n Sun Azimuth (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theSunAzimuth)
298  << "\n Sun Elevation (TopCenter, Center, BottomCenter): " << getVectorFloat64AsString(theSunElevation)
299 
300  << "\n Physical Bias (for each band): " << getVectorFloat64AsString(thePhysicalBias)
301  << "\n Physical Gain (for each band): " << getVectorFloat64AsString(thePhysicalGain)
302  << "\n Solar Irradiance (for each band): " << getVectorFloat64AsString(theSolarIrradiance)
303 
304  << "\n Geo Center Point: " << theRefGroundPoint
305  // TODO add RefImagePoint if necessary
306 
307  << "\n Corner Points:"
308  << "\n UL: " << theUlCorner
309  << "\n UR: " << theUrCorner
310  << "\n LR: " << theLrCorner
311  << "\n LL: " << theLlCorner
312  << "\n"
313 
314  << "\n RPC model parameters:"
315  << "\n RPC ID: " << theSpecId
316  << "\n SampNumCoeff: " << getVectorDoubleAsString(theSampNumCoeff)
317  << "\n SampDenCoeff: " << getVectorDoubleAsString(theSampDenCoeff)
318  << "\n LineNumCoeff: " << getVectorDoubleAsString(theLineNumCoeff)
319  << "\n LineDenCoeff: " << getVectorDoubleAsString(theLineDenCoeff)
320  << "\n LonScale: " << theLonScale
321  << "\n LonOffset: " << theLonOffset
322  << "\n LatScale: " << theLatScale
323  << "\n LonScale: " << theLonScale
324  << "\n HeightScale: " << theHeightScale
325  << "\n HeightOffset: " << theHeightOffset
326  << "\n SampScale: " << theSampScale
327  << "\n SampOffset: " << theSampOffset
328  << "\n LineScale: " << theLineScale
329  << "\n LineOffset: " << theLineOffset
330  << "\n theErrBias: " << theErrBias
331  << "\n theErrBiasX: " << theErrBiasX
332  << "\n theErrBiasY: " << theErrBiasY
333  << "\n theErrRand: " << theErrRand
334  << "\n"
335  << "\n---------------------------------------------------------"
336  << "\n " << std::endl;
337  }
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
std::vector< ossim_float64 > thePhysicalBias
Calibration information for radiometric corrections.

◆ saveState()

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

Method to save the state of the object to a keyword list.

Return true if ok or false on error.

Reimplemented from ossimObject.

Definition at line 672 of file ossimSpot6DimapSupportData.cpp.

References ossimKeywordlist::add(), ossimKeywordNames::AZIMUTH_ANGLE_KW, ossimDatum::code(), ossimGpt::datum(), ossimKeywordNames::ELEVATION_ANGLE_KW, ossimGpt::height(), ossimKeywordNames::IMAGE_DATE_KW, ossimGpt::latd(), ossimGpt::lond(), ossimKeywordNames::NUMBER_BANDS_KW, theAcquisitionDate, theAzimuthAngle, theBandOrder, theImageID, theImageSize, theIncidenceAngle, theInstrument, theInstrumentIndex, theLlCorner, theLrCorner, theNumBands, thePhysicalBias, thePhysicalGain, theProcessingLevelString, theProductionDate, theRefGroundPoint, theRefImagePoint, theSensorID, theSolarIrradiance, theSunAzimuth, theSunElevation, theUlCorner, theUrCorner, theViewingAngle, ossimString::toString(), ossimKeywordNames::TYPE_KW, ossimIpt::x, ossimDpt::x, ossimIpt::y, and ossimDpt::y.

674  {
675  ossimString tempString;
676  ossim_uint32 idx = 0;
677 
678  kwl.add(prefix,
680  "ossimSpot6DimapSupportData",
681  true);
682 
683  tempString = "";
684  for(idx = 0; idx < theSunAzimuth.size(); ++idx)
685  {
686  tempString += (ossimString::toString(theSunAzimuth[idx]) + " ");
687  }
688 
689  kwl.add(prefix,
691  tempString,
692  true);
693 
694  kwl.add(prefix,
695  "number_of_azimuth_angle",
696  static_cast<ossim_uint32>(theSunAzimuth.size()),
697  true);
698 
699  tempString = "";
700  for(idx = 0; idx < theSunElevation.size(); ++idx)
701  {
702  tempString += (ossimString::toString(theSunElevation[idx]) + " ");
703  }
704 
705  kwl.add(prefix,
707  tempString,
708  true);
709 
710  kwl.add(prefix,
711  "number_of_elevation_angle",
712  static_cast<ossim_uint32>(theSunElevation.size()),
713  true);
714 
715  //---
716  // Note: since this is a new keyword, use the point.toString as there is
717  // no backwards compatibility issues.
718  //---
719 
720  kwl.add(prefix,
721  "image_size",
724  true);
725 
726  kwl.add(prefix,
727  "reference_ground_point",
732  true);
733 
734  kwl.add(prefix,
735  "reference_image_point",
738  true);
739 
740  kwl.add(prefix,
742  theNumBands,
743  true);
744 
745  tempString = "";
746  for(idx = 0; idx < theBandOrder.size(); ++idx)
747  {
748  tempString += (theBandOrder[idx] + " ");
749  }
750 
751  kwl.add(prefix,
752  "band_name_list",
753  tempString,
754  true);
755 
756  kwl.add(prefix,
757  "image_id",
758  theImageID,
759  true);
760 
761  kwl.add(prefix,
762  "processing_level",
764  true);
765 
766  kwl.add(prefix,
767  "instrument",
769  true);
770 
771  kwl.add(prefix,
772  "instrument_index",
774  true);
775 
776  kwl.add(prefix,
779  true);
780 
781  kwl.add(prefix,
782  "production_date",
784  true);
785 
786  tempString = "";
787  for(idx = 0; idx < theIncidenceAngle.size(); ++idx)
788  {
789  tempString += (ossimString::toString(theIncidenceAngle[idx]) + " ");
790  }
791 
792  kwl.add(prefix,
793  "incident_angle",
794  tempString,
795  true);
796 
797  kwl.add(prefix,
798  "number_of_incident_angle",
799  static_cast<ossim_uint32>(theIncidenceAngle.size()),
800  true);
801 
802  tempString = "";
803  for(idx = 0; idx < theViewingAngle.size(); ++idx)
804  {
805  tempString += (ossimString::toString(theViewingAngle[idx]) + " ");
806  }
807 
808  kwl.add(prefix,
809  "viewing_angle",
810  tempString,
811  true);
812 
813  kwl.add(prefix,
814  "number_of_viewing_angle",
815  static_cast<ossim_uint32>(theViewingAngle.size()),
816  true);
817 
818  tempString = "";
819  for(idx = 0; idx < theAzimuthAngle.size(); ++idx)
820  {
821  tempString += (ossimString::toString(theAzimuthAngle[idx]) + " ");
822  }
823 
824  kwl.add(prefix,
825  "scene_orientation",
826  tempString,
827  true);
828 
829  kwl.add(prefix,
830  "number_of_scene_orientation",
831  static_cast<ossim_uint32>(theAzimuthAngle.size()),
832  true);
833 
834  kwl.add(prefix,
835  "ul_ground_point",
839  theUlCorner.datum()->code(),
840  true);
841 
842  kwl.add(prefix,
843  "ur_ground_point",
847  theUrCorner.datum()->code(),
848  true);
849 
850  kwl.add(prefix,
851  "lr_ground_point",
855  theLrCorner.datum()->code(),
856  true);
857 
858  kwl.add(prefix,
859  "ll_ground_point",
863  theLlCorner.datum()->code(),
864  true);
865 
866  kwl.add(prefix,
867  "sensorID",
868  theSensorID,
869  true);
870 
871 
872  tempString = "";
873  for(idx = 0; idx < thePhysicalBias.size(); ++idx)
874  {
875  tempString += (ossimString::toString(thePhysicalBias[idx]) + " ");
876  }
877  kwl.add(prefix,
878  "physical_bias",
879  tempString,
880  true);
881 
882  tempString = "";
883  for(idx = 0; idx < thePhysicalGain.size(); ++idx)
884  {
885  tempString += (ossimString::toString(thePhysicalGain[idx]) + " ");
886  }
887  kwl.add(prefix,
888  "physical_gain",
889  tempString,
890  true);
891 
892  tempString = "";
893  for(idx = 0; idx < theSolarIrradiance.size(); ++idx)
894  {
895  tempString += (ossimString::toString(theSolarIrradiance[idx]) + " ");
896  }
897 
898  kwl.add(prefix,
899  "solar_irradiance",
900  tempString,
901  true);
902 
903  return true;
904  }
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
static const char * IMAGE_DATE_KW
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double y
Definition: ossimDpt.h:165
virtual const ossimString & code() const
Definition: ossimDatum.h:57
static ossimString toString(bool aValue)
Numeric to string methods.
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
static const char * TYPE_KW
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
unsigned int ossim_uint32
double height() const
Definition: ossimGpt.h:107
static const char * NUMBER_BANDS_KW
static const char * AZIMUTH_ANGLE_KW
std::vector< ossim_float64 > thePhysicalBias
Calibration information for radiometric corrections.
ossim_int32 y
Definition: ossimIpt.h:142
double x
Definition: ossimDpt.h:164
ossim_int32 x
Definition: ossimIpt.h:141
static const char * ELEVATION_ANGLE_KW
ossimDpt theRefImagePoint
Zero based center of frame.

Member Data Documentation

◆ theAcquisitionDate

ossimString ossimplugins::ossimSpot6DimapSupportData::theAcquisitionDate
private

◆ theAzimuthAngle

std::vector<ossim_float64> ossimplugins::ossimSpot6DimapSupportData::theAzimuthAngle
private

◆ theBandOrder

std::vector<ossimString> ossimplugins::ossimSpot6DimapSupportData::theBandOrder
private

Definition at line 187 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), loadState(), parseRasterData(), and saveState().

◆ theDIMAPVersion

ossimSpot6DIMAPVersion ossimplugins::ossimSpot6DimapSupportData::theDIMAPVersion
private

◆ theErrBias

double ossimplugins::ossimSpot6DimapSupportData::theErrBias
private

Definition at line 204 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields().

◆ theErrBiasX

double ossimplugins::ossimSpot6DimapSupportData::theErrBiasX
private

Definition at line 205 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theErrBiasY

double ossimplugins::ossimSpot6DimapSupportData::theErrBiasY
private

Definition at line 206 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theErrRand

double ossimplugins::ossimSpot6DimapSupportData::theErrRand
private

Definition at line 207 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields().

◆ theHeightOffset

double ossimplugins::ossimSpot6DimapSupportData::theHeightOffset
private

Definition at line 212 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theHeightScale

double ossimplugins::ossimSpot6DimapSupportData::theHeightScale
private

Definition at line 217 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theImageID

ossimString ossimplugins::ossimSpot6DimapSupportData::theImageID
private

◆ theImageSize

ossimIpt ossimplugins::ossimSpot6DimapSupportData::theImageSize
private

◆ theIncidenceAngle

std::vector<ossim_float64> ossimplugins::ossimSpot6DimapSupportData::theIncidenceAngle
private

◆ theInstrument

ossimString ossimplugins::ossimSpot6DimapSupportData::theInstrument
private

◆ theInstrumentIndex

ossimString ossimplugins::ossimSpot6DimapSupportData::theInstrumentIndex
private

◆ theLatOffset

double ossimplugins::ossimSpot6DimapSupportData::theLatOffset
private

Definition at line 210 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theLatScale

double ossimplugins::ossimSpot6DimapSupportData::theLatScale
private

Definition at line 215 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theLineDenCoeff

std::vector<double> ossimplugins::ossimSpot6DimapSupportData::theLineDenCoeff
private

Definition at line 220 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theLineNumCoeff

std::vector<double> ossimplugins::ossimSpot6DimapSupportData::theLineNumCoeff
private

Definition at line 219 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theLineOffset

ossim_int32 ossimplugins::ossimSpot6DimapSupportData::theLineOffset
private

Definition at line 208 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theLineScale

double ossimplugins::ossimSpot6DimapSupportData::theLineScale
private

Definition at line 213 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theLlCorner

ossimGpt ossimplugins::ossimSpot6DimapSupportData::theLlCorner
private

◆ theLonOffset

double ossimplugins::ossimSpot6DimapSupportData::theLonOffset
private

Definition at line 211 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theLonScale

double ossimplugins::ossimSpot6DimapSupportData::theLonScale
private

Definition at line 216 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theLrCorner

ossimGpt ossimplugins::ossimSpot6DimapSupportData::theLrCorner
private

◆ theMetadataSubProfile

ossimSpot6MetadataSubProfile ossimplugins::ossimSpot6DimapSupportData::theMetadataSubProfile
private

◆ theMultiDataFile

ossimBooleanProperty ossimplugins::ossimSpot6DimapSupportData::theMultiDataFile
private

Definition at line 184 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRasterData().

◆ theNumBands

ossim_uint32 ossimplugins::ossimSpot6DimapSupportData::theNumBands
private

◆ theNumberOfMegaTiles

ossim_uint32 ossimplugins::ossimSpot6DimapSupportData::theNumberOfMegaTiles
private

Definition at line 183 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRasterData().

◆ theNumberOfMegaTilesInCol

ossim_uint32 ossimplugins::ossimSpot6DimapSupportData::theNumberOfMegaTilesInCol
private

Definition at line 182 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRasterData().

◆ theNumberOfMegaTilesInRow

ossim_uint32 ossimplugins::ossimSpot6DimapSupportData::theNumberOfMegaTilesInRow
private

Definition at line 181 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRasterData().

◆ thePhysicalBias

std::vector<ossim_float64> ossimplugins::ossimSpot6DimapSupportData::thePhysicalBias
private

Calibration information for radiometric corrections.

Definition at line 190 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), loadState(), parseRadiometricData(), and saveState().

◆ thePhysicalGain

std::vector<ossim_float64> ossimplugins::ossimSpot6DimapSupportData::thePhysicalGain
private

◆ theProcessingLevelString

ossimString ossimplugins::ossimSpot6DimapSupportData::theProcessingLevelString
private

◆ theProductionDate

ossimString ossimplugins::ossimSpot6DimapSupportData::theProductionDate
private

◆ theProductIsOk

bool ossimplugins::ossimSpot6DimapSupportData::theProductIsOk
private

Definition at line 160 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseXmlFile().

◆ theRefGroundPoint

ossimGpt ossimplugins::ossimSpot6DimapSupportData::theRefGroundPoint
private

Center of frame on ground, if sub image it's the center of that.

Definition at line 227 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), getRefGroundPoint(), loadState(), parseDatasetContent(), and saveState().

◆ theRefImagePoint

ossimDpt ossimplugins::ossimSpot6DimapSupportData::theRefImagePoint
private

Zero based center of frame.

Definition at line 230 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), getRefImagePoint(), loadState(), parseRasterData(), and saveState().

◆ theRpcIsOk

bool ossimplugins::ossimSpot6DimapSupportData::theRpcIsOk
private

Definition at line 161 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseXmlFile().

◆ theSampDenCoeff

std::vector<double> ossimplugins::ossimSpot6DimapSupportData::theSampDenCoeff
private

Definition at line 222 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theSampNumCoeff

std::vector<double> ossimplugins::ossimSpot6DimapSupportData::theSampNumCoeff
private

Definition at line 221 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theSampOffset

ossim_int32 ossimplugins::ossimSpot6DimapSupportData::theSampOffset
private

Definition at line 209 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theSampScale

double ossimplugins::ossimSpot6DimapSupportData::theSampScale
private

Definition at line 214 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theSensorID

ossimString ossimplugins::ossimSpot6DimapSupportData::theSensorID
private

◆ theSolarIrradiance

std::vector<ossim_float64> ossimplugins::ossimSpot6DimapSupportData::theSolarIrradiance
private

◆ theSpecId

ossimString ossimplugins::ossimSpot6DimapSupportData::theSpecId
private

Definition at line 203 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRPCMetadata().

◆ theSpectralProcessingString

ossimString ossimplugins::ossimSpot6DimapSupportData::theSpectralProcessingString
private

◆ theSunAzimuth

std::vector<ossim_float64> ossimplugins::ossimSpot6DimapSupportData::theSunAzimuth
private

◆ theSunElevation

std::vector<ossim_float64> ossimplugins::ossimSpot6DimapSupportData::theSunElevation
private

◆ theTileSize

ossimIpt ossimplugins::ossimSpot6DimapSupportData::theTileSize
private

Definition at line 180 of file ossimSpot6DimapSupportData.h.

Referenced by clearFields(), and parseRasterData().

◆ theUlCorner

ossimGpt ossimplugins::ossimSpot6DimapSupportData::theUlCorner
private

◆ theUrCorner

ossimGpt ossimplugins::ossimSpot6DimapSupportData::theUrCorner
private

◆ theViewingAngle

std::vector<ossim_float64> ossimplugins::ossimSpot6DimapSupportData::theViewingAngle
private

◆ theXmlDocumentRoot

ossimString ossimplugins::ossimSpot6DimapSupportData::theXmlDocumentRoot
private

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