OTB  10.0.0
Orfeo Toolbox
otbSoilDataBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 */
vcl_size_t CountColumns(std::string fileName) const
std::string m_SoilFileName
double GetReflectance(vcl_size_t SoilIndex, WavelengthType wl) const
std::vector< WavelengthType > m_Wavelengths
std::vector< SoilData > SoilDataVector
unsigned int WavelengthType
const SoilDataVector & GetDB() const
std::unordered_map< WavelengthType, double > SoilData
SoilDataBase(const std::string &SoilFileName, double wlfactor)
SoilDataVector m_SoilDataVector
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.