AttributeBandDescription.hpp
1 #ifndef OPALS_ATTRIBUTE_BAND_DESCRIPTION_HPP_INCLUDED
2 #define OPALS_ATTRIBUTE_BAND_DESCRIPTION_HPP_INCLUDED
3 
4 #pragma once
5 
6 #include "opals/config.hpp"
7 #include "opals/String.hpp"
8 
9 namespace opals
10 {
11  /// \brief AttributeBandDescription provides generic information about a single attribute (used by DataSetStats).
12  ///
13  /// Beside the name, type, storage size (in bytes) and a nodata indicator of the attribute the
14  /// class provides basic statistic information such as min, max, mean and the standard deviation.
15  /// If a specific information is really set, can be retrieved by the corresponding isSet function.
16  /// Depending on the data type a specific no data value is used to indicate unset values.
17  ///
18  /// \author JO
19  /// \date 24.05.2012
20  class OPALS_API AttributeBandDescription
21  {
22  public:
24  virtual ~AttributeBandDescription();
25 
26  bool isSetName() const;
27  bool isSetType() const;
28  bool isSetStorageSize() const;
29  bool isSetCount() const;
30  bool isSetMin() const;
31  bool isSetMax() const;
32  bool isSetMean() const;
33  bool isSetStd() const;
34  bool isSetNoDataIndicator() const;
35  bool isSetColorInterpretation() const;
36 
37  String getName() const; ///< get attribute name
38  String getType() const; ///< get attribute type
39  unsigned getStorageSize() const; ///< storage size of attribute in bytes
40  long long getCount() const; ///< number of elements
41  double getMin() const; ///< minimum attribute value
42  double getMax() const; ///< maximum attribute value
43  double getMean() const; ///< mean attribute value
44  double getStd() const; ///< standard deviation
45  double getNoDataIndicator() const; ///< no value indicator
46  String getColorInterpretation() const;
47 
48  void reset();
49  void setAttributeBandDescription(const String& Name,const String& Type,const unsigned& StorageSize,const long long& Count,
50  const double& Min,const double& Max,const double& Mean,const double& Std, const double& NoData,const String& ColorInterpretation);
51  void setName(const String& Name);
52  void setType(const String& Type);
53  void setStorageSize(const unsigned& StorageSize);
54  void setCount(const long long& Count);
55  void setMin(const double& Min);
56  void setMax(const double& Max);
57  void setMean(const double& Mean);
58  void setStd(const double& Std);
59  void setNoDataIndicator(const double& NoData);
60  void setColorInterpretation(const String& ColorInterpretation);
61 
62  // output functions
63  String logAttributeBandDescription() const; ///< for xml output
64  String printAttributeBandDescription() const; ///< for log output (in more readable format)
65  static String printAttributeBandHeader(); ///< for log the header line
66 
67  private:
68  String name;
69  String type;
70  unsigned storageSize;
71  long long count;
72  double min;
73  double max;
74  double mean;
75  double std;
76  double nodataIndicator;
77  String colorInterpretation;
78  };
79 }
80 
81 
82 
83 #endif //OPALS_ATTRIBUTE_DESCRIPTION_HPP_INCLUDED