DataSetStats.hpp
1 #ifndef OPALS_DATA_SET_STATS_HPP_INCLUDED
2 #define OPALS_DATA_SET_STATS_HPP_INCLUDED
3 
4 #pragma once
5 
6 #include "opals/config.hpp"
7 #include "opals/Vector.hpp"
8 #include "opals/Array.hpp"
9 #include "opals/Path.hpp"
10 #include "opals/DataSetType.hpp"
11 #include "opals/AttributeBandDescription.hpp"
12 #include "opals/IndexDescription.hpp"
13 
14 namespace opals
15 {
16  /// \brief DataSetStats provides generic information about a data file (use in opalsInfo).
17  ///
18  /// Beside the name, type, storage size (in bytes) and a nodata indicator of the attribute the
19  /// class provides basic statistic information such as min, max, mean and the standard deviation.
20  /// If a specific information is really set, can be retrieved by the corresponding isSet function.
21  /// Depending on the data type a specific no data value is used to indicate unset values.
22  ///
23  /// \author JO
24  /// \date 24.05.2012
25  class OPALS_API DataSetStats
26  {
27  public:
28  typedef Array<double,6> ArrayD6;
32  typedef Array<double,2> ArrayD2;
33 
34  DataSetStats();
35  ~DataSetStats();
36 
37  void reset();
38 
39  // isSet functions ================================================
40  //common part
41  bool isSetFilename() const;
42  bool isSetType() const;
43  bool isSetVersion() const;
44  bool isSetCreator() const;
45  bool isSetBoundingBox() const;
46  bool isSetCoordRefSys() const;
47  // odm part
48  bool isSetPointCount() const;
49  bool isSetLineCount() const;
50  bool isSetPolygonCount() const;
51  bool isSetBoundaryPolygon() const;
52  bool isSetPointDensity() const;
53  bool isSetAttributes() const;
54  bool isSetIndices() const;
55  //Raster Part
56  bool isSetPixelCount() const;
57  bool isSetBands() const;
58  bool isSetPixelSize() const;
59  bool isSetCompression() const;
60  bool isSetInterleave() const;
61 
62  // Get functions ================================================
63  //common part
64  Path getFilename() const;
65  DataSetType::Type getType() const;
66  String getVersion() const;
67  String getCreator() const;
68  ArrayD6 getBoundingBox() const;
69  int getBoundingBoxDim() const;
70  String getCoordRefSys() const;
71  // odm part
72  long long getPointCount() const;
73  long long getLineCount() const;
74  long long getPolygonCount() const;
75  StringVector getBoundaryPolygon() const;
76  double getPointDensity() const;
77  AttributeVector getAttributes() const;
78  IndexVector getIndices() const; ///< get info object about the spatial indices
79  //Raster Part
80  long long getPixelCount() const;
81  AttributeVector getBands() const;
82  ArrayD2 getPixelSize() const;
83  bool getPixelAreaOrPointFlag() const;
84  String getCompression() const;
85  String getInterleave() const;
86 
87 
88  // set functions ================================================
89  //common part
90  void setFilename(const Path& Filename);
91  void setType(const DataSetType::Type &Type);
92  void setVersion(const String &Version);
93  void setCreator(const String& Creator);
94  void setBoundingBox(const ArrayD6& BoundingBox);
95  void setBoundingBoxDim(const int& BoundingBoxDim);
96  void setCoordRefSys(const String& crs);
97  // odm part
98  void setPointCount(const long long& PointCount);
99  void setLineCount(const long long& LineCount);
100  void setPolygonCount(const long long& PolygonCount);
101  void setBoundaryPolygon(const StringVector& BoundaryPolygon);
102  void setPointDensity(const double &PointDensity);
103  void setAttributes(const AttributeVector& Attributes);
104  void setIndices(const IndexVector& Indecs);
105  //Raster Part
106  void setPixelCount(const long long& PixelCount);
107  void setBands(const AttributeVector& Bands) ;
108  void setPixelSize(const ArrayD2& PixelSize);
109  void setPixelAreaOrPointFlag(const bool& PixelAreaOrPointFlag);
110  void setCompression(const String& Compression);
111  void setInterleave(const String& Interleave);
112 
113  String logDataSetStats() const; ///< for xml output
114  String printDataSetStats() const; ///< for log output (in more readable format)
115 
116  private:
117  Path filename;
118  DataSetType::Type type;
119  String version;
120 
121  long long pointCount;
122  long long lineCount;
123  long long polygonCount;
124 
125  ArrayD6 boundingBox;
126  int boundingBoxDim;
127 
128  StringVector boundaryPolygon;
129  double pointDensity;
130 
131  String creator;
132  String coordRefSys;
133 
134  AttributeVector attributes;
135  IndexVector indices;
136 
137  long long pixelcount;
138  AttributeVector bands;
139 
140  ArrayD2 pixelsize;
141  bool pixelareaorpointflag;
142  String compression;
143  String interleave;
144 
145  };
146 }
147 
148 #endif //OPALS_DATA_SET_STATS_HPP_INCLUDED