OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimPleiadesDimapSupportData.h
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2012 Centre National Etudes Spatiales
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 3 of the License, or (at your option) any later version.
8 //
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 //
18 // Author : Mickael Savinaud (mickael.savinaud@c-s.fr)
19 //
20 // Description:
21 //
22 // Contains declaration of class ossimPleiadesDimapSupportData
23 //
24 //*****************************************************************************
25 #ifndef ossimPleiadesDimapSupportData_HEADER
26 #define ossimPleiadesDimapSupportData_HEADER
27 
29 
31 #include <ossim/base/ossimIpt.h>
32 #include <ossim/base/ossimObject.h>
33 #include <ossim/base/ossimString.h>
34 
36 
39 
40 #include <ossim/base/ossimRefPtr.h>
41 #include <ossim/base/ossimDpt.h>
42 #include <ossim/base/ossimDpt3d.h>
43 #include <ossim/base/ossimDrect.h>
44 #include <ossim/base/ossimGpt.h>
45 
46 
47 #include <vector>
48 #include <iostream>
49 
50 
51 class ossimKeywordlist;
52 class ossimXmlDocument;
53 
54 namespace ossimplugins
55 {
58  {
59  public:
61  {
64  OSSIM_PLEIADES_DIMAPv2
65  };
66 
69  {
70  OSSIM_PLEIADES_METADATA_SUBPROFILE_UNKNOWN = 0,
71  OSSIM_PLEIADES_METADATA_SUBPROFILE_PRODUCT = 1,
72  OSSIM_PLEIADES_METADATA_SUBPROFILE_RPC = 2
73  };
74 
76 
78 
79  void clearFields();
80 
81  bool parseXmlFile(const ossimFilename& file);
82 
83  //---
84  // Convenient method to print important image info:
85  //---
86  void printInfo (ostream& os) const;
87 
92  virtual bool saveState(ossimKeywordlist& kwl,
93  const char* prefix = 0)const;
98  virtual bool loadState(const ossimKeywordlist& kwl,
99  const char* prefix = 0);
100 
101  ossimString getSensorID() const;
102  ossimString getProcessingLevel() const;
103  ossimString getAcquisitionDate() const;
104  ossimString getProductionDate() const;
105  ossimString getImageID() const;
106  ossimString getInstrument() const;
107  ossimString getInstrumentIndex() const;
108 
109  ossim_uint32 getNumberOfBands() const;
110  void getSunAzimuth(std::vector<ossim_float64>& az) const;
111  void getSunElevation(std::vector<ossim_float64>& el) const;
112  void getImageSize(ossimIpt& sz) const;
113 
114  void getIncidenceAngle(std::vector<ossim_float64>& ia) const;
115  void getViewingAngle(std::vector<ossim_float64>& va) const;
116 
117  //Along and across track incidence angle
118  void getAcrossTrackIncidenceAngle(std::vector<ossim_float64>& act) const;
119  void getAlongTrackIncidenceAngle(std::vector<ossim_float64>& alt) const;
120 
121  //---
122  // Corner points:
123  //---
124  void getUlCorner(ossimGpt& pt) const;
125  void getUrCorner(ossimGpt& pt) const;
126  void getLrCorner(ossimGpt& pt) const;
127  void getLlCorner(ossimGpt& pt) const;
128 
129  //---
130  // Image center point:
131  //---
132 
134  void getRefGroundPoint(ossimGpt& gp) const;
135 
137  void getRefImagePoint(ossimDpt& rp) const;
138 
140  void getImageRect(ossimDrect& rect)const;
141 
142  bool allMetadataRead(){return (theProductIsOk && theRpcIsOk);};
143 
144  std::vector<double> getLineNumCoeff() const {return theLineNumCoeff;};
145  std::vector<double> getLineDenCoeff() const {return theLineDenCoeff;};
146  std::vector<double> getSampNumCoeff() const {return theSampNumCoeff;};
147  std::vector<double> getSampDenCoeff() const {return theSampDenCoeff;};
148 
149  ossim_int32 getLineOffset() const {return theLineOffset;};
150  ossim_int32 getSampOffset() const {return theSampOffset;};
151  double getLatOffset() const {return theLatOffset;};
152  double getLonOffset() const {return theLonOffset;};
153  double getHeightOffset() const {return theHeightOffset;};
154  double getLineScale() const {return theLineScale;};
155  double getSampScale() const {return theSampScale;};
156  double getLatScale() const {return theLatScale;};
157  double getLonScale() const {return theLonScale;};
158  double getHeightScale() const {return theHeightScale;};
159 
160 
161  ossimString getTimeRangeStart() const {return theTimeRangeStart;};
162  ossimString getTimeRangeEnd() const {return theTimeRangeEnd;};
163  ossim_float64 getLinePeriod() const {return theLinePeriod;};
164  ossim_int32 getSwathFirstCol() const {return theSwathFirstCol;};
165  ossim_int32 getSwathLastCol() const {return theSwathLastCol;};
166 
167 
168  private:
169  ossimPleiadesDIMAPVersion theDIMAPVersion;
174 
183 
184  std::vector<ossim_float64> theSunAzimuth;
185  std::vector<ossim_float64> theSunElevation;
186  std::vector<ossim_float64> theIncidenceAngle;
187  std::vector<ossim_float64> theViewingAngle;
188  std::vector<ossim_float64> theAzimuthAngle;
189 
190  std::vector<ossim_float64> theAlongTrackIncidenceAngle;
191  std::vector<ossim_float64> theAcrossTrackIncidenceAngle;
192 
199 
201  std::vector<ossimString> theBandOrder;
202 
204  std::vector<ossim_float64> thePhysicalBias;
205  std::vector<ossim_float64> thePhysicalGain;
206  std::vector<ossim_float64> theSolarIrradiance;
207 
208  //---
209  // Corner points:
210  //---
215 
216  // RPC parameters
218  double theErrBias;
219  double theErrBiasX;
220  double theErrBiasY;
221  double theErrRand;
224  double theLatOffset;
225  double theLonOffset;
227  double theLineScale;
228  double theSampScale;
229  double theLatScale;
230  double theLonScale;
232 
233  std::vector<double> theLineNumCoeff;
234  std::vector<double> theLineDenCoeff;
235  std::vector<double> theSampNumCoeff;
236  std::vector<double> theSampDenCoeff;
237 
238  // Additional metadata used to enhance pansharpening
244 
245 
246 
247  //--- TODO MSD Check if it is necessary to keep that
250 
253 
254 
255  ossimGpt createGround(const ossimString& s)const;
256  ossimDpt createDpt(const ossimString& s)const;
257  ossimIpt createIpt(const ossimString& s)const;
258  //---
259 
260  bool parseRPCMetadata(ossimRefPtr<ossimXmlDocument> xmlDocument);
261 
262  bool parseMetadataIdentificationDIMAPv1(ossimRefPtr<ossimXmlDocument> xmlDocument);
263  bool parseMetadataIdentificationDIMAPv2(ossimRefPtr<ossimXmlDocument> xmlDocument);
264 
275  bool parseDatasetIdentification(ossimRefPtr<ossimXmlDocument> xmlDocument);
276 
295  bool parseDatasetContent(ossimRefPtr<ossimXmlDocument> xmlDocument);
296 
309  bool parseProductInformation(ossimRefPtr<ossimXmlDocument> xmlDocument);
310 
321  bool parseCoordinateReferenceSystem(ossimRefPtr<ossimXmlDocument> xmlDocument);
322 
333  bool parseGeoposition(ossimRefPtr<ossimXmlDocument> xmlDocument);
334 
347  bool parseProcessingInformation(ossimRefPtr<ossimXmlDocument> xmlDocument);
348 
349  bool parseRasterData(ossimRefPtr<ossimXmlDocument> xmlDocument);
350 
351  bool parseRadiometricData(ossimRefPtr<ossimXmlDocument> xmlDocument);
352 
353  bool parseGeometricData(ossimRefPtr<ossimXmlDocument> xmlDocument);
354 
365  bool parseQualityAssessment(ossimRefPtr<ossimXmlDocument> xmlDocument);
366 
367  bool parseDatasetSources(ossimRefPtr<ossimXmlDocument> xmlDocument);
368 
369 
370 
371  };
372 }
373 #endif /* #ifndef ossimPleiadesDimapSupportData_HEADER */
374 
std::vector< ossim_float64 > thePhysicalBias
Calibration information for radiometric corrections.
Represents serializable keyword/value map.
ossimDpt theRefImagePoint
Zero based center of frame.
double ossim_float64
unsigned int ossim_uint32
#define OSSIM_PLUGINS_DLL
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32