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