OTB  6.7.0
Orfeo Toolbox
otbImageMetadataInterfaceBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbImageMetadataInterfaceBase_h
22 #define otbImageMetadataInterfaceBase_h
23 
24 #include <string>
25 
26 #include "otbImageKeywordlist.h"
27 #include "itkMetaDataDictionary.h"
28 #include "otbMetaDataKey.h"
29 #include "itkImageBase.h"
30 
31 #include "OTBMetadataExport.h"
32 
33 namespace otb
34 {
35 
43 class OTBMetadata_EXPORT ImageMetadataInterfaceBase : public itk::Object
44 {
45 public:
46 
51 
54 
60  typedef unsigned int UnsignedIntType;
61  typedef std::vector<std::string> StringVectorType;
62  typedef std::vector<unsigned int> UIntVectorType;
63 
64 
66  void SetImage (ImageType* image)
67  {
68  this->SetMetaDataDictionary(image->GetMetaDataDictionary());
69  }
70 
73  {
74  m_MetaDataDictionary = dict;
75  }
76 
79  {
80  return m_MetaDataDictionary;
81  }
82 
84  std::string GetProjectionRef() const;
85 
87  std::string GetGCPProjection() const;
88 // otbMetadataGetMacro(GCPProjection, std::string);
90 
91  UnsignedIntType GetGCPCount() const;
92 // otbMetadataGetMacro(GCPCount, unsigned int);
93 
94  OTB_GCP& GetGCPs(unsigned int GCPnum);
95  //otbMetadataGetGCPnumMacro(GCPs, OTB_GCP&, GCPnum, unsigned int);
96 
97  std::string GetGCPId(unsigned int GCPnum) const;
98 // otbMetadataGetGCPnumMacro(GCPId, std::string, GCPnum, unsigned int);
99 
100  std::string GetGCPInfo(unsigned int GCPnum) const;
101 // otbMetadataGetGCPnumMacro(GCPInfo, std::string, GCPnum, unsigned int);
102 
103  double GetGCPRow(unsigned int GCPnum) const;
104 // otbMetadataGetGCPnumMacro(GCPRow, double, GCPnum, unsigned int);
105 
106  double GetGCPCol(unsigned int GCPnum) const;
107 // otbMetadataGetGCPnumMacro(GCPCol, double, GCPnum, unsigned int);
108 
109  double GetGCPX(unsigned int GCPnum) const;
110 // otbMetadataGetGCPnumMacro(GCPX, double, GCPnum, unsigned int);
111 
112  double GetGCPY(unsigned int GCPnum) const;
113 // otbMetadataGetGCPnumMacro(GCPY, double, GCPnum, unsigned int);
114 
115  double GetGCPZ(unsigned int GCPnum) const;
116 // otbMetadataGetGCPnumMacro(GCPZ, double, GCPnum, unsigned int);
117 
122  bool GetNoDataFlags(std::vector<bool> & flags, std::vector<double> & values) const;
123 
126  VectorType GetGeoTransform() const;
127 // otbMetadataGetMacro(GeoTransform, VectorType);
128 
131  VectorType GetUpperLeftCorner() const;
132 // otbMetadataGetMacro(UpperLeftCorner, VectorType);
133 
134  VectorType GetUpperRightCorner() const;
135 // otbMetadataGetMacro(UpperRightCorner, VectorType);
136 
137  VectorType GetLowerLeftCorner() const;
138 // otbMetadataGetMacro(LowerLeftCorner, VectorType);
139 
140  VectorType GetLowerRightCorner() const;
141 // otbMetadataGetMacro(LowerRightCorner, VectorType);
142 
144  ImageKeywordlistType GetImageKeywordlist();
145 
146  const ImageKeywordlistType GetImageKeywordlist() const;
147 
150  std::string const GetSensorID() const;
151 
153  bool GetSensorID(std::string & sensorId) const;
154 
155  //otbMetadataGetMacro(SensorID, std::string);
156 
158  UnsignedIntType GetNumberOfBands() const;
159  //otbMetadataGetMacro(NumberOfBands, unsigned int);
161 
163  StringVectorType GetBandName() const;
164  //otbMetadataGetMacro(BandName, std::vector<std::string>);
166 
168  double GetXPixelSpacing() const;
169  //otbMetadataGetMacro(XPixelSpacing, double);
171 
173  double GetYPixelSpacing() const;
174  //otbMetadataGetMacro(YPixelSpacing, double);
176 
178  virtual int GetDay() const = 0;
179 // otbMetadataGetMacro(Day, int);
181 
183  virtual int GetMonth() const = 0;
184  //otbMetadataGetMacro(Month, int);
186 
188  virtual int GetYear() const = 0;
189  //otbMetadataGetMacro(Year, int);
191 
193  virtual int GetHour() const = 0;
194  //otbMetadataGetMacro(Hour, int);
196 
198  virtual int GetMinute() const = 0;
199  //otbMetadataGetMacro(Minute, int);
201 
203  virtual int GetProductionDay() const = 0;
204  //otbMetadataGetMacro(ProductionDay, int);
206 
208  virtual int GetProductionMonth() const = 0;
209  //otbMetadataGetMacro(ProductionMonth, int);
211 
213  virtual int GetProductionYear() const = 0;
214  //otbMetadataGetMacro(ProductionYear, int);
216 
218  virtual StringVectorType GetEnhancedBandNames () const = 0;
219 
222  virtual UIntVectorType GetDefaultDisplay() const = 0;
223 
224  virtual bool CanRead() const = 0;
225 
226  static void PrintMetadata(std::ostream& os, itk::Indent indent, const MetaDataDictionaryType& dict);
227 
228 protected:
231 
232  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
233 
235 
236 private:
237  ImageMetadataInterfaceBase(const Self &) = delete;
238  void operator =(const Self&) = delete;
239 
241 };
242 
243 } // end namespace otb
244 
245 #endif
void SetMetaDataDictionary(const MetaDataDictionaryType &dict)
Base class for captor metadata reading.
Storage and conversion for OSSIM metadata.
std::vector< unsigned int > UIntVectorType
std::vector< double > VectorType
This OTB_GCP class is used to manage the GCP parameters in OTB.
MetaDataKey::VariableLengthVectorType VariableLengthVectorType
MetaDataDictionary & GetMetaDataDictionary()
const MetaDataDictionaryType & GetMetaDataDictionary() const
itk::SmartPointer< const Self > ConstPointer