DataSetStats.hpp
1 #pragma once
2 
3 #include "opals/config.hpp"
4 #include "opals/Vector.hpp"
5 #include "opals/Array.hpp"
6 #include "opals/Path.hpp"
7 #include "opals/DataSetType.hpp"
8 #include "opals/AttributeBandDescription.hpp"
9 #include "opals/IndexDescription.hpp"
10 
11 namespace opals
12 {
13  /// \brief DataSetStats provides generic information about a data file (use in opalsInfo).
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 DataSetStats
23  {
24  public:
25  typedef Array<double,6> ArrayD6;
29  typedef Array<double,2> ArrayD2;
30 
31  DataSetStats();
32  ~DataSetStats();
33 
34  void reset();
35 
36  // isSet functions ================================================
37  //common part
38  bool isSetFilename() const;
39  bool isSetType() const;
40  bool isSetVersion() const;
41  bool isSetCreator() const;
42  bool isSetBoundingBox() const;
43  bool isSetCoordRefSys() const;
44  // odm part
45  bool isSetPointCount() const;
46  bool isSetLineCount() const;
47  bool isSetPolygonCount() const;
48  bool isSetBoundaryPolygon() const;
49  bool isSetPointDensity() const;
50  bool isSetAttributes() const;
51  bool isSetIndices() const;
52  //Raster Part
53  bool isSetPixelCount() const;
54  bool isSetBands() const;
55  bool isSetPixelSize() const;
56  bool isSetCompression() const;
57  bool isSetInterleave() const;
58 
59  // Get functions ================================================
60  //common part
61  Path getFilename() const;
62  DataSetType getType() const;
63  String getVersion() const;
64  String getCreator() const;
65  ArrayD6 getBoundingBox() const;
66  int getBoundingBoxDim() const;
67  String getCoordRefSys() const;
68  // odm part
69  long long getPointCount() const;
70  long long getLineCount() const;
71  long long getPolygonCount() const;
72  StringVector getBoundaryPolygon() const;
73  double getPointDensity() const;
74  AttributeVector getAttributes() const;
75  IndexVector getIndices() const; ///< get info object about the spatial indices
76  //Raster Part
77  long long getPixelCount() const;
78  AttributeVector getBands() const;
79  ArrayD2 getPixelSize() const;
80  bool getPixelAreaOrPointFlag() const;
81  String getCompression() const;
82  String getInterleave() const;
83 
84 
85  // set functions ================================================
86  //common part
87  void setFilename(const Path& Filename);
88  void setType(const DataSetType &Type);
89  void setVersion(const String &Version);
90  void setCreator(const String& Creator);
91  void setBoundingBox(const ArrayD6& BoundingBox);
92  void setBoundingBoxDim(const int& BoundingBoxDim);
93  void setCoordRefSys(const String& crs);
94  // odm part
95  void setPointCount(const long long& PointCount);
96  void setLineCount(const long long& LineCount);
97  void setPolygonCount(const long long& PolygonCount);
98  void setBoundaryPolygon(const StringVector& BoundaryPolygon);
99  void setPointDensity(const double &PointDensity);
100  void setAttributes(const AttributeVector& Attributes);
101  void setIndices(const IndexVector& Indecs);
102  //Raster Part
103  void setPixelCount(const long long& PixelCount);
104  void setBands(const AttributeVector& Bands) ;
105  void setPixelSize(const ArrayD2& PixelSize);
106  void setPixelAreaOrPointFlag(const bool& PixelAreaOrPointFlag);
107  void setCompression(const String& Compression);
108  void setInterleave(const String& Interleave);
109 
110  String logDataSetStats() const; ///< for xml output
111  String printDataSetStats() const; ///< for log output (in more readable format)
112 
113  private:
114  Path filename;
115  DataSetType type;
116  String version;
117 
118  long long pointCount;
119  long long lineCount;
120  long long polygonCount;
121 
122  ArrayD6 boundingBox;
123  int boundingBoxDim;
124 
125  StringVector boundaryPolygon;
126  double pointDensity;
127 
128  String creator;
129  String coordRefSys;
130 
131  AttributeVector attributes;
132  IndexVector indices;
133 
134  long long pixelcount;
135  AttributeVector bands;
136 
137  ArrayD2 pixelsize;
138  bool pixelareaorpointflag;
139  String compression;
140  String interleave;
141 
142  };
143 }
DataSetType
Possible data set types as used in DataSetStats (see opalsInfo)
Definition: DataSetType.hpp:8
A file/directory path.
Definition: Path.hpp:26
Contains the public interface of OPALS.
Definition: ApplyTrafo.hpp:5
DataSetStats provides generic information about a data file (use in opalsInfo).
Definition: DataSetStats.hpp:22
A dynamic character string whose interface conforms to STL's std::string.
Definition: String.hpp:35