OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimSpot6DimapSupportData.h
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2014 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 : Christophe Palmann (christophe.palmann@c-s.fr)
19 //
20 // Description:
21 //
22 // Contains declaration of class ossimSpot6DimapSupportData
23 //
24 //*****************************************************************************
25 #ifndef ossimSpot6DimapSupportData_HEADER
26 #define ossimSpot6DimapSupportData_HEADER 1
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  {
63  OSSIM_Spot6_DIMAPv2
64  };
65 
68  {
69  OSSIM_Spot6_METADATA_SUBPROFILE_UNKNOWN = 0,
70  OSSIM_Spot6_METADATA_SUBPROFILE_PRODUCT = 1,
71  OSSIM_Spot6_METADATA_SUBPROFILE_RPC = 2
72  };
73 
75 
76  virtual ~ossimSpot6DimapSupportData();
77 
78  void clearFields();
79 
80  bool parseXmlFile(const ossimFilename& file);
81 
82  //---
83  // Convenient method to print important image info:
84  //---
85  void printInfo (ostream& os) const;
86 
91  virtual bool saveState(ossimKeywordlist& kwl,
92  const char* prefix = 0)const;
97  virtual bool loadState(const ossimKeywordlist& kwl,
98  const char* prefix = 0);
99 
100  ossimString getSensorID() const;
101  ossimString getProcessingLevel() const;
102  ossimString getAcquisitionDate() const;
103  ossimString getProductionDate() const;
104  ossimString getImageID() const;
105  ossimString getInstrument() const;
106  ossimString getInstrumentIndex() const;
107 
108  ossim_uint32 getNumberOfBands() const;
109  void getSunAzimuth(std::vector<ossim_float64>& az) const;
110  void getSunElevation(std::vector<ossim_float64>& el) const;
111  void getImageSize(ossimIpt& sz) const;
112 
113  void getIncidenceAngle(std::vector<ossim_float64>& ia) const;
114  void getViewingAngle(std::vector<ossim_float64>& va) const;
115 
116  //---
117  // Corner points:
118  //---
119  void getUlCorner(ossimGpt& pt) const;
120  void getUrCorner(ossimGpt& pt) const;
121  void getLrCorner(ossimGpt& pt) const;
122  void getLlCorner(ossimGpt& pt) const;
123 
124  //---
125  // Image center point:
126  //---
127 
129  void getRefGroundPoint(ossimGpt& gp) const;
130 
132  void getRefImagePoint(ossimDpt& rp) const;
133 
135  void getImageRect(ossimDrect& rect)const;
136 
137  bool allMetadataRead(){return (theProductIsOk && theRpcIsOk);};
138 
139  std::vector<double> getLineNumCoeff() const {return theLineNumCoeff;};
140  std::vector<double> getLineDenCoeff() const {return theLineDenCoeff;};
141  std::vector<double> getSampNumCoeff() const {return theSampNumCoeff;};
142  std::vector<double> getSampDenCoeff() const {return theSampDenCoeff;};
143 
144  ossim_int32 getLineOffset() const {return theLineOffset;};
145  ossim_int32 getSampOffset() const {return theSampOffset;};
146  double getLatOffset() const {return theLatOffset;};
147  double getLonOffset() const {return theLonOffset;};
148  double getHeightOffset() const {return theHeightOffset;};
149  double getLineScale() const {return theLineScale;};
150  double getSampScale() const {return theSampScale;};
151  double getLatScale() const {return theLatScale;};
152  double getLonScale() const {return theLonScale;};
153  double getHeightScale() const {return theHeightScale;};
154 
155 
156 
157  private:
158  ossimSpot6DIMAPVersion theDIMAPVersion;
163 
172 
173  std::vector<ossim_float64> theSunAzimuth;
174  std::vector<ossim_float64> theSunElevation;
175  std::vector<ossim_float64> theIncidenceAngle;
176  std::vector<ossim_float64> theViewingAngle;
177  std::vector<ossim_float64> theAzimuthAngle;
178 
185 
187  std::vector<ossimString> theBandOrder;
188 
190  std::vector<ossim_float64> thePhysicalBias;
191  std::vector<ossim_float64> thePhysicalGain;
192  std::vector<ossim_float64> theSolarIrradiance;
193 
194  //---
195  // Corner points:
196  //---
201 
202  // RPC parameters
204  double theErrBias;
205  double theErrBiasX;
206  double theErrBiasY;
207  double theErrRand;
210  double theLatOffset;
211  double theLonOffset;
213  double theLineScale;
214  double theSampScale;
215  double theLatScale;
216  double theLonScale;
218 
219  std::vector<double> theLineNumCoeff;
220  std::vector<double> theLineDenCoeff;
221  std::vector<double> theSampNumCoeff;
222  std::vector<double> theSampDenCoeff;
223 
224 
225  //--- TODO MSD Check if it is necessary to keep that
228 
231 
232 
233  ossimGpt createGround(const ossimString& s)const;
234  ossimDpt createDpt(const ossimString& s)const;
235  ossimIpt createIpt(const ossimString& s)const;
236  //---
237 
238  bool parseRPCMetadata(ossimRefPtr<ossimXmlDocument> xmlDocument);
239 
240  bool parseMetadataIdentificationDIMAPv2(ossimRefPtr<ossimXmlDocument> xmlDocument);
241 
252  bool parseDatasetIdentification(ossimRefPtr<ossimXmlDocument> xmlDocument);
253 
272  bool parseDatasetContent(ossimRefPtr<ossimXmlDocument> xmlDocument);
273 
286  bool parseProductInformation(ossimRefPtr<ossimXmlDocument> xmlDocument);
287 
298  bool parseCoordinateReferenceSystem(ossimRefPtr<ossimXmlDocument> xmlDocument);
299 
310  bool parseGeoposition(ossimRefPtr<ossimXmlDocument> xmlDocument);
311 
324  bool parseProcessingInformation(ossimRefPtr<ossimXmlDocument> xmlDocument);
325 
326  bool parseRasterData(ossimRefPtr<ossimXmlDocument> xmlDocument);
327 
328  bool parseRadiometricData(ossimRefPtr<ossimXmlDocument> xmlDocument);
329 
330  bool parseGeometricData(ossimRefPtr<ossimXmlDocument> xmlDocument);
331 
342  bool parseQualityAssessment(ossimRefPtr<ossimXmlDocument> xmlDocument);
343 
344  bool parseDatasetSources(ossimRefPtr<ossimXmlDocument> xmlDocument);
345 
346  };
347 }
348 #endif /* #ifndef ossimSpot6DimapSupportData_HEADER */
ossimGpt theRefGroundPoint
Center of frame on ground, if sub image it&#39;s the center of that.
Represents serializable keyword/value map.
unsigned int ossim_uint32
#define OSSIM_PLUGINS_DLL
std::vector< ossim_float64 > thePhysicalBias
Calibration information for radiometric corrections.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32
ossimDpt theRefImagePoint
Zero based center of frame.