OTB  9.0.0
Orfeo Toolbox
otbSoilDataBase.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 
22 #ifndef otbSoilDataBase_h
23 #define otbSoilDataBase_h
24 
25 #include "OTBSimulationExport.h"
26 #include "itkMacro.h"
27 #include <vector>
28 #include <unordered_map>
29 #include <string>
30 
31 namespace otb
32 {
33 
34 class ITK_ABI_EXPORT SoilDataBase
35 {
36 public:
37  // wavelength in nm
38  using WavelengthType = unsigned int;
39  using SoilData = std::unordered_map<WavelengthType, double>;
40  using SoilDataVector = std::vector<SoilData>;
41 
42  SoilDataBase(const std::string& SoilFileName, double wlfactor);
43  const SoilDataVector& GetDB() const;
44  double GetReflectance(size_t SoilIndex, WavelengthType wl) const;
45 
46 protected:
47  size_t CountColumns(std::string fileName) const;
48  void ParseSoilFile();
49 
50  std::string m_SoilFileName;
51  double m_WlFactor;
53  std::vector<WavelengthType> m_Wavelengths;
54 };
55 }
56 
57 #endif /* otbSoilDataBase_h */
otb::SoilDataBase::m_WlFactor
double m_WlFactor
Definition: otbSoilDataBase.h:51
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::SoilDataBase::WavelengthType
unsigned int WavelengthType
Definition: otbSoilDataBase.h:38
otb::SoilDataBase::m_SoilFileName
std::string m_SoilFileName
Definition: otbSoilDataBase.h:50
otb::SoilDataBase::SoilData
std::unordered_map< WavelengthType, double > SoilData
Definition: otbSoilDataBase.h:39
otb::SoilDataBase::m_SoilDataVector
SoilDataVector m_SoilDataVector
Definition: otbSoilDataBase.h:52
otb::SoilDataBase
Definition: otbSoilDataBase.h:34
otb::SoilDataBase::m_Wavelengths
std::vector< WavelengthType > m_Wavelengths
Definition: otbSoilDataBase.h:53
otb::SoilDataBase::SoilDataVector
std::vector< SoilData > SoilDataVector
Definition: otbSoilDataBase.h:40