OTB  9.0.0
Orfeo Toolbox
otbGeomMetadataSupplier.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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 otbGeomMetadataSupplier_h
22 #define otbGeomMetadataSupplier_h
23 
24 #include <boost/any.hpp>
25 #include <unordered_map>
26 
27 #include "OTBMetadataExport.h"
29 #include "otbImageMetadata.h"
30 
31 
32 namespace otb
33 {
34 
41 class OTBMetadata_EXPORT GeomMetadataSupplier
43 {
44 public:
45  using DictType = std::unordered_map<std::string, std::string>;
46 
47  GeomMetadataSupplier(const std::string & geomFile);
48  GeomMetadataSupplier(const std::string & geomFile, const std::string & imageFile);
50  GeomMetadataSupplier& operator=(const GeomMetadataSupplier&) = delete;
51  ~GeomMetadataSupplier() = default;
52 
61  std::string GetMetadataValue(std::string const& path, bool& hasValue, int band=1) const override;
62 
63  std::string GetResourceFile(std::string const& s="") const override;
64  std::vector<std::string> GetResourceFiles() const override;
65 
66  int GetNbBands() const override;
67 
73  bool FetchRPC(ImageMetadata & imd, const double lineOffset=0, const double sampleOffset=0);
74 
80  bool FetchGCP(ImageMetadata & imd);
81 
83  unsigned int GetNumberOf(std::string const&) const override;
84 
86  unsigned int GetAttributId(std::string const&, std::string const&) const override
87  {
88  otbLogMacro(Error, << "GetAttributId() not yet implemented in otbGeomMetadataSupplier");
89  return 0;
90  }
92 
98  std::string PrintSelf() const;
99 
100 protected:
104  void ReadGeomFile();
105 
106 private:
108  std::unordered_map<std::string, std::string> m_FileNames;
109 
112 
113 };
114 
115 } // end namespace otb
116 
117 #endif
otb::GeomMetadataSupplier::m_FileNames
std::unordered_map< std::string, std::string > m_FileNames
Definition: otbGeomMetadataSupplier.h:108
otbLogMacro
#define otbLogMacro(level, msg)
Definition: otbMacro.h:52
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::GeomMetadataSupplier::GetAttributId
unsigned int GetAttributId(std::string const &, std::string const &) const override
Definition: otbGeomMetadataSupplier.h:86
otb::MetadataSupplierInterface
Base class to access metadata information in files/images.
Definition: otbMetadataSupplierInterface.h:40
otbMetadataSupplierInterface.h
otb::GeomMetadataSupplier::DictType
std::unordered_map< std::string, std::string > DictType
Definition: otbGeomMetadataSupplier.h:45
otb::GeomMetadataSupplier
Class to access metadata information in a Geom file.
Definition: otbGeomMetadataSupplier.h:41
otb::GeomMetadataSupplier::m_MetadataDic
DictType m_MetadataDic
Definition: otbGeomMetadataSupplier.h:111
otb::ImageMetadata
Generic class containing image metadata used in OTB.
Definition: otbImageMetadata.h:270
otbImageMetadata.h