GDAL
gdal_pam_multidim.h
1/******************************************************************************
2 *
3 * Project: GDAL Core
4 * Purpose: Declaration of GDALPamMDArray class
5 * Author: Even Rouault <even.rouault at spatialys.com>
6 *
7 ******************************************************************************
8 * Copyright (c) 2019, Even Rouault <even.rouault at spatialys.com>
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDAL_PAM_MULTIDIM_H_INCLUDED
14#define GDAL_PAM_MULTIDIM_H_INCLUDED
15
16#include "cpl_port.h"
17
18#include "gdal_multidim.h"
19
20#include <memory>
21#include <string>
22
24
25/* ******************************************************************** */
26/* GDALPamMultiDim */
27/* ******************************************************************** */
28
32class CPL_DLL GDALPamMultiDim final
33{
34 struct Private;
35 std::unique_ptr<Private> d;
36
37 void Load();
38 void Save();
39
40 public:
41 explicit GDALPamMultiDim(const std::string &osFilename);
42 ~GDALPamMultiDim();
43
44 std::shared_ptr<OGRSpatialReference>
45 GetSpatialRef(const std::string &osArrayFullName,
46 const std::string &osContext);
47
48 void SetSpatialRef(const std::string &osArrayFullName,
49 const std::string &osContext,
50 const OGRSpatialReference *poSRS);
51
52 CPLErr GetStatistics(const std::string &osArrayFullName,
53 const std::string &osContext, bool bApproxOK,
54 double *pdfMin, double *pdfMax, double *pdfMean,
55 double *pdfStdDev, GUInt64 *pnValidCount);
56
57 void SetStatistics(const std::string &osArrayFullName,
58 const std::string &osContext, bool bApproxStats,
59 double dfMin, double dfMax, double dfMean,
60 double dfStdDev, GUInt64 nValidCount);
61
62 void ClearStatistics();
63
64 void ClearStatistics(const std::string &osArrayFullName,
65 const std::string &osContext);
66
67 std::string GetOverviewFilename(const std::string &osArrayFullName,
68 const std::string &osContext);
69 std::string GenerateOverviewFilename(const std::string &osArrayFullName,
70 const std::string &osContext);
71
72 static std::shared_ptr<GDALPamMultiDim>
73 GetPAM(const std::shared_ptr<GDALMDArray> &poParent);
74};
75
76/* ******************************************************************** */
77/* GDALPamMDArray */
78/* ******************************************************************** */
79
81class CPL_DLL GDALPamMDArray : public GDALMDArray
82{
83 std::shared_ptr<GDALPamMultiDim> m_poPam;
84
85 protected:
86 GDALPamMDArray(const std::string &osParentName, const std::string &osName,
87 const std::shared_ptr<GDALPamMultiDim> &poPam,
88 const std::string &osContext = std::string());
89
90 bool SetStatistics(bool bApproxStats, double dfMin, double dfMax,
91 double dfMean, double dfStdDev, GUInt64 nValidCount,
92 CSLConstList papszOptions) override;
93
94 public:
95 const std::shared_ptr<GDALPamMultiDim> &GetPAM() const
96 {
97 return m_poPam;
98 }
99
100 CPLErr GetStatistics(bool bApproxOK, bool bForce, double *pdfMin,
101 double *pdfMax, double *pdfMean, double *padfStdDev,
102 GUInt64 *pnValidCount, GDALProgressFunc pfnProgress,
103 void *pProgressData) override;
104
105 void ClearStatistics() override;
106
107 bool SetSpatialRef(const OGRSpatialReference *poSRS) override;
108
109 std::shared_ptr<OGRSpatialReference> GetSpatialRef() const override;
110};
111
113
114#endif
Class modeling a multi-dimensional array.
Definition gdal_multidim.h:852
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition ogr_spatialref.h:152
CPLErr
Error category / error level.
Definition cpl_error.h:45
Core portability definitions for CPL.
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1252
GUIntBig GUInt64
Unsigned 64 bit integer type.
Definition cpl_port.h:218