OTB  7.2.0
Orfeo Toolbox
otbDEMHandler.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2020 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 otbDEMHandler_h
22 #define otbDEMHandler_h
23 
24 #include <cstdio>
25 
26 #include "itkIndent.h"
27 #include "itkObject.h"
28 #include "itkObjectFactory.h"
29 #include "itkPoint.h"
30 
31 #include "OTBOSSIMAdaptersExport.h"
32 #include <string>
33 
34 class ossimElevManager;
35 
36 namespace otb
37 {
90 class OTBOSSIMAdapters_EXPORT DEMHandler : public itk::Object
91 {
92 public:
94  typedef DEMHandler Self;
95  typedef itk::Object Superclass;
96  typedef itk::SmartPointer<Self> Pointer;
97  typedef itk::SmartPointer<const Self> ConstPointer;
98 
99  typedef itk::Point<double, 2> PointType;
100 
102  static Pointer Instance();
103 
105  itkTypeMacro(DEMHandler, Object);
106 
108  virtual void OpenDEMDirectory(const char* DEMDirectory);
109  virtual void OpenDEMDirectory(const std::string& DEMDirectory);
111 
113  virtual bool IsValidDEMDirectory(const char* DEMDirectory);
114 
125  virtual bool OpenGeoidFile(const char* geoidFile);
126 
137  virtual bool OpenGeoidFile(const std::string& geoidFile);
138 
140  virtual double GetHeightAboveMSL(double lon, double lat) const;
141  virtual double GetHeightAboveMSL(const PointType& geoPoint) const;
143 
145  virtual double GetHeightAboveEllipsoid(double lon, double lat) const;
146  virtual double GetHeightAboveEllipsoid(const PointType& geoPoint) const;
148 
150  virtual void SetDefaultHeightAboveEllipsoid(double h);
151 
153  double GetDefaultHeightAboveEllipsoid() const;
154 
159  unsigned int GetDEMCount() const;
160 
162  std::string GetDEMDirectory(unsigned int idx = 0) const;
163 
165  std::string GetGeoidFile() const;
166 
171  void ClearDEMs();
172 
173 protected:
174  DEMHandler();
175  ~DEMHandler() override
176  {
177  }
178 
179  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
180 
181  // Ossim does not allow retrieving the geoid file path
182  // We therefore must keep it on our side
183  std::string m_GeoidFile;
184 
185  // Ossim does not allow retrieving the default height above
186  // ellipsoid We therefore must keep it on our side
188 
189  static Pointer m_Singleton;
190 };
191 
192 } // namespace otb
193 
194 #endif
itk::SmartPointer< Self > Pointer
Definition: otbDEMHandler.h:96
DEMHandler Self
Definition: otbDEMHandler.h:94
double m_DefaultHeightAboveEllipsoid
itk::Object Superclass
Definition: otbDEMHandler.h:95
itk::Point< double, 2 > PointType
Definition: otbDEMHandler.h:99
~DEMHandler() override
static Pointer m_Singleton
std::string m_GeoidFile
itk::SmartPointer< const Self > ConstPointer
Definition: otbDEMHandler.h:97
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Single access point for DEM data retrieval.
Definition: otbDEMHandler.h:90