OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimSrtmHandler.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: See tope level LICENSE.txt file.
4 //
5 // Author: David Burken
6 //
7 // Description:
8 //
9 // Shuttle Radar Topography Mission (SRTM) elevation source.
10 //
11 //----------------------------------------------------------------------------
12 // $Id: ossimSrtmHandler.h 23117 2015-01-29 22:33:13Z okramer $
13 #ifndef ossimSrtmHandler_HEADER
14 #define ossimSrtmHandler_HEADER
15 
17 //#include <fstream>
18 
19 #include <ossim/base/ossimString.h>
22 #include <mutex>
23 
24 class ossimEndian;
25 
30 {
31 public:
32 
36 
37 
38  enum
39  {
40  NULL_POST = -32768 // Fixed by SRTM specification.
41  };
42 
47  virtual double getHeightAboveMSL(const ossimGpt&);
48 
54  virtual ossimIpt getSizeOfElevCell() const;
55 
61  virtual double getPostValue(const ossimIpt& gridPt) const;
62 
63  virtual bool isOpen()const;
64 
70  virtual bool open(const ossimFilename& file, bool memoryMapFlag=false);
71 
75  virtual void close();
76 
77  virtual ossimObject* dup() const
78  {
80  obj->open(theFilename, (m_memoryMap.size() != 0));
81  return obj;
82  }
83 
84 protected:
86  virtual ~ossimSrtmHandler();
88  mutable std::mutex m_fileStrMutex;
90 
93 
97  double m_latSpacing; // degrees
98  double m_lonSpacing; // degrees
99  ossimDpt m_nwCornerPost; // cell origin;
102 
103  mutable std::vector<ossim_int8> m_memoryMap;
104 
105  template <class T>
106  double getHeightAboveMSLFileTemplate(T dummy, const ossimGpt& gpt);
107  template <class T>
108  double getHeightAboveMSLMemoryTemplate(T dummy, const ossimGpt& gpt);
109  TYPE_DATA
110 };
111 
112 #endif /* End of "#ifndef ossimSrtmHandler_HEADER" */
virtual double getHeightAboveMSL(const ossimGpt &)=0
Height access methods:
ossimSrtmSupportData m_supportData
virtual ossimObject * dup() const
ossim_int32 m_numberOfLines
std::vector< ossim_int8 > m_memoryMap
#define OSSIMDLLEXPORT
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
ossimScalarType m_scalarType
bool m_streamOpen
true if stream is open.
virtual bool open(const ossimFilename &file, bool memoryMapFlag=false)
Opens a stream to the srtm cell.
virtual bool open(const ossimFilename &, bool=false)
ossim_int32 m_srtmRecordSizeInBytes
#define TYPE_DATA
Definition: ossimRtti.h:339
virtual double getPostValue(const ossimIpt &gridPt) const =0
METHOD: getPostValue Returns the value at a given grid point as a double.
std::mutex m_fileStrMutex
ossimScalarType
ossim_int32 m_numberOfSamples
for an srtm file.
std::ifstream m_fileStr
ossimEndian * m_swapper
virtual ossimIpt getSizeOfElevCell() const =0
METHOD: getSizeOfElevCell Returns the number of post in the cell.
int ossim_int32