AttributeBandDescription.hpp
1 #pragma once
2 
3 #include "opals/config.hpp"
4 #include "opals/String.hpp"
5 #include "opals/RasterDataType.hpp"
6 #include "DM/ColumnTypes.hpp"
7 #include "DM/IHistogram.hpp"
8 #include "opals/NoDataType.hpp"
9 #include "opals/DataSetType.hpp"
10 
11 namespace opals
12 {
13  /// \brief AttributeBandDescription provides generic information about a single attribute (used by DataSetStats).
14  ///
15  /// Beside the name, type, storage size (in bytes) and a nodata indicator of the attribute the
16  /// class provides basic statistic information such as min, max, mean and the standard deviation.
17  /// If a specific information is really set, can be retrieved by the corresponding isSet function.
18  /// Depending on the data type a specific no data value is used to indicate unset values.
19  ///
20  /// \author JO
21  /// \date 24.05.2012
22  class OPALS_API AttributeBandDescription
23  {
24  public:
26  virtual ~AttributeBandDescription();
27 
28  bool isSetName() const;
29  bool isSetType() const;
30  bool isSetTypeCount() const;
31  bool isSetStorageSize() const;
32  bool isSetCount() const;
33  bool isSetMin() const;
34  bool isSetMax() const;
35  bool isSetMean() const;
36  bool isSetStd() const;
37  bool isSetNoDataIndicator() const;
38  bool isSetColorInterpretation() const;
39  bool isSetValueFrequency() const;
40 
41  String getName() const; ///< get attribute name
42  int getType() const; ///< get attribute type (RasterDataType for raster and DM::ColumnType for attributes)
43  unsigned getTypeCount() const;
44  unsigned getStorageSize() const; ///< storage size of attribute in bytes
45  long long getCount() const; ///< number of elements
46  double getMin() const; ///< minimum attribute value
47  double getMax() const; ///< maximum attribute value
48  double getMean() const; ///< mean attribute value
49  double getStd() const; ///< standard deviation
50  NoDataType getNoDataIndicator() const; ///< no value indicator
51  String getColorInterpretation() const;
52  DM::HistogramHandle getValueFrequency() const;
53 
54  void reset();
55  void setAttributeBandDescription(const String& Name,const int Type,const unsigned& StorageSize,const long long& Count,
56  const double& Min,const double& Max,const double& Mean,const double& Std, const NoDataType& NoData,const String& ColorInterpretation);
57  void setName(const String& Name);
58  void setType(const int Type); ///< use RasterDataType for raster and DM::ColumnType for attributes
59  void setTypeCount(const unsigned typeCount);
60  void setStorageSize(const unsigned& StorageSize);
61  void setCount(const long long& Count);
62  void setMin(const double& Min);
63  void setMax(const double& Max);
64  void setMean(const double& Mean);
65  void setStd(const double& Std);
66  void setNoDataIndicator(const NoDataType& NoData);
67  void setColorInterpretation(const String& ColorInterpretation);
68  void setValueFrequency(DM::HistogramHandle& freq);
69 
70  // output functions
71  String logAttributeBandDescription() const; ///< for xml output
72  String printAttributeBandDescription(opals::DataSetType mode) const; ///< for log output (in more readable format)
73  static String printAttributeBandHeader(opals::DataSetType mode); ///< for log the header line
74 
75  private:
76  String name;
77  int type;
78  unsigned typeCount;
79  unsigned storageSize;
80  long long count;
81  double min;
82  double max;
83  double mean;
84  double std;
85  NoDataType nodataIndicator;
86  String colorInterpretation;
87  DM::HistogramHandle valueFrequency;
88  };
89 }
AttributeBandDescription provides generic information about a single attribute (used by DataSetStats)...
Definition: AttributeBandDescription.hpp:22
DataSetType
Possible data set types as used in DataSetStats (see opalsInfo)
Definition: DataSetType.hpp:8
@ mean
Mean.
Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8
Smart pointer class using reference counting with support for DM objects (see ObjectBase)
Definition: Handle.hpp:75
A dynamic character string whose interface conforms to STL's std::string.
Definition: String.hpp:35
Class for storing a type independent a nodata value (nodata value can be deactivated as well)
Definition: NoDataType.hpp:11