OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimHdf5.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * *
3  * O S S I M *
4  * Open Source, Geospatial Image Processing Project *
5  * License: MIT, see LICENSE at the top-level directory *
6  * *
7  ******************************************************************************/
8 
9 #ifndef ossimHdf5_HEADER
10 #define ossimHdf5_HEADER 1
11 
16 #include <ostream>
17 #include <iosfwd>
18 #include <string>
19 #include <vector>
20 #include <H5Cpp.h>
21 
28 {
29 public:
30  ossimHdf5();
31  ~ossimHdf5();
32 
34  bool open(const ossimFilename& hdf5File);
35 
36  bool isOpen() const { return (m_h5File != NULL); }
37 
40  bool close();
41 
44  bool getRoot(H5::Group& root) const;
45 
46 
50  static bool getChildGroups(H5::Group group,
51  std::vector<H5::Group>& groupList,
52  bool recursive=false);
53 
57  static bool getDatasets(H5::Group group,
58  std::vector<H5::DataSet>& datasetList,
59  bool recursive=false);
60 
64  static bool getNdimDatasets(H5::Group group,
65  std::vector<H5::DataSet>& datasetList,
66  bool recursive=false);
67 
71  static bool getAttributes(const H5::H5Object& obj, std::vector<H5::Attribute>& attrList);
72 
78  H5::Group* findGroupByName(const std::string& group_name,
79  const H5::Group* parent_group=0,
80  bool recursive=false)const;
81 
89  H5::DataSet* findDatasetByName(const std::string& dataset_name,
90  const H5::Group* group=0,
91  bool recursive=false)const ;
92 
93 
94  static ossimByteOrder getByteOrder( const H5::AbstractDs* obj );
95  static ossimByteOrder getByteOrder( const H5::AtomType& obj );
96  static std::string getDatatypeClassType( ossim_int32 type );
97 
98  static void getExtents( const H5::DataSet& dataset, std::vector<ossim_uint32>& extents );
99 
100  static ossimScalarType getScalarType( const H5::DataSet& dataset );
101  static ossimScalarType getScalarType( const H5::DataType& datatype );
102  static bool floatTypeToString(std::string& result,
103  const H5::FloatType& dataType,
104  const char* dataPtr);
105  static bool intTypeToString(std::string& result,
106  const H5::IntType& dataType,
107  const char* dataPtr);
108  static bool stringTypeToString(std::string& result,
109  const H5::StrType& dataType,
110  const char* dataPtr);
111 private:
113  H5::H5File* m_h5File;
114 };
115 
116 #endif /* #ifndef ossimHdf5_HEADER */
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less i...
ossimScalarType getScalarType(const H5::DataSet *dataset)
ossimFilename m_filename
Definition: ossimHdf5.h:112
bool isOpen() const
Definition: ossimHdf5.h:36
ossimByteOrder
ossimByteOrder getByteOrder(const H5::AbstractDs *dataset)
ossimScalarType
Low-level OSSIM interface to HDF5 libraries.
Definition: ossimHdf5.h:27
#define OSSIM_DLL
void getExtents(const H5::DataSet *dataset, std::vector< ossim_uint32 > &extents)
H5::H5File * m_h5File
Definition: ossimHdf5.h:113
std::string getDatatypeClassType(ossim_int32 type)
int ossim_int32