30 #ifndef GDAL_PAM_H_INCLUDED 31 #define GDAL_PAM_H_INCLUDED 42 #define GCIF_GEOTRANSFORM 0x01 43 #define GCIF_PROJECTION 0x02 44 #define GCIF_METADATA 0x04 45 #define GCIF_GCPS 0x08 47 #define GCIF_NODATA 0x001000 48 #define GCIF_CATEGORYNAMES 0x002000 49 #define GCIF_MINMAX 0x004000 50 #define GCIF_SCALEOFFSET 0x008000 51 #define GCIF_UNITTYPE 0x010000 52 #define GCIF_COLORTABLE 0x020000 53 #define GCIF_COLORINTERP 0x020000 54 #define GCIF_BAND_METADATA 0x040000 55 #define GCIF_RAT 0x080000 56 #define GCIF_MASK 0x100000 57 #define GCIF_BAND_DESCRIPTION 0x200000 59 #define GCIF_ONLY_IF_MISSING 0x10000000 60 #define GCIF_PROCESS_BANDS 0x20000000 62 #define GCIF_PAM_DEFAULT (GCIF_GEOTRANSFORM | GCIF_PROJECTION | \ 63 GCIF_METADATA | GCIF_GCPS | \ 64 GCIF_NODATA | GCIF_CATEGORYNAMES | \ 65 GCIF_MINMAX | GCIF_SCALEOFFSET | \ 66 GCIF_UNITTYPE | GCIF_COLORTABLE | \ 67 GCIF_COLORINTERP | GCIF_BAND_METADATA | \ 68 GCIF_RAT | GCIF_MASK | \ 69 GCIF_ONLY_IF_MISSING | GCIF_PROCESS_BANDS|\ 70 GCIF_BAND_DESCRIPTION) 74 #define GPF_DIRTY 0x01 // .pam file needs to be written on close 75 #define GPF_TRIED_READ_FAILED 0x02 // no need to keep trying to read .pam. 76 #define GPF_DISABLED 0x04 // do not try any PAM stuff. 77 #define GPF_AUXMODE 0x08 // store info in .aux (HFA) file. 78 #define GPF_NOSAVE 0x10 // do not try to save pam info. 88 class GDALDatasetPamInfo
91 char *pszPamFilename =
nullptr;
95 int bHaveGeoTransform =
false;
96 double adfGeoTransform[6]{0,0,0,0,0,0};
106 int bHasMetadata =
false;
117 std::map<CPLString, Statistics> oMapMDArrayStatistics{};
131 int IsPamFilenameAPotentialSiblingFile();
138 GDALDatasetPamInfo *psPam =
nullptr;
140 virtual const char *_GetProjectionRef()
override;
141 virtual const char *_GetGCPProjection()
override;
142 virtual CPLErr _SetProjection(
const char * pszProjection )
override;
143 virtual CPLErr _SetGCPs(
int nGCPCount,
const GDAL_GCP *pasGCPList,
144 const char *pszGCPProjection )
override;
146 virtual CPLXMLNode *SerializeToXML(
const char *);
149 virtual CPLErr TryLoadXML(
char **papszSiblingFiles =
nullptr);
150 virtual CPLErr TrySaveXML();
152 CPLErr TryLoadAux(
char **papszSiblingFiles =
nullptr);
155 void SerializeMDArrayStatistics(
CPLXMLNode* psDSTree);
157 virtual const char *BuildPamFilename();
159 void PamInitialize();
162 void SetPhysicalFilename(
const char * );
163 const char *GetPhysicalFilename();
164 void SetSubdatasetName(
const char *);
165 const char *GetSubdatasetName();
176 CPLErr GetGeoTransform(
double * )
override;
177 CPLErr SetGeoTransform(
double * )
override;
179 int GetGCPCount()
override;
187 const char * pszDomain =
"" )
override;
189 const char * pszValue,
190 const char * pszDomain =
"" )
override;
191 char **
GetMetadata(
const char * pszDomain =
"" )
override;
193 const char * pszDomain =
"" )
override;
195 char **GetFileList(
void)
override;
197 void ClearStatistics()
override;
202 CPLErr IBuildOverviews(
const char *pszResampling,
203 int nOverviews,
int *panOverviewList,
204 int nListBands,
int *panBandList,
205 GDALProgressFunc pfnProgress,
206 void * pProgressData )
override;
208 bool GetMDArrayStatistics(
const char* pszMDArrayId,
210 double *pdfMin,
double *pdfMax,
211 double *pdfMean,
double *pdfStdDev,
214 void StoreMDArrayStatistics(
const char* pszMDArrayId,
216 double dfMin,
double dfMax,
217 double dfMean,
double dfStdDev,
221 void MarkPamDirty() { nPamFlags |= GPF_DIRTY; }
222 GDALDatasetPamInfo *GetPamInfo() {
return psPam; }
223 int GetPamFlags() {
return nPamFlags; }
224 void SetPamFlags(
int nValue ) { nPamFlags = nValue; }
244 double dfNoDataValue;
251 char **papszCategoryNames;
270 } GDALRasterBandPamInfo;
283 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath );
286 void PamInitialize();
289 GDALRasterBandPamInfo *psPam =
nullptr;
301 CPLErr SetNoDataValue(
double )
override;
302 double GetNoDataValue(
int *pbSuccess =
nullptr )
override;
303 CPLErr DeleteNoDataValue()
override;
311 const char *GetUnitType()
override;
312 CPLErr SetUnitType(
const char * )
override;
314 char **GetCategoryNames()
override;
315 CPLErr SetCategoryNames(
char ** )
override;
317 double GetOffset(
int *pbSuccess =
nullptr )
override;
318 CPLErr SetOffset(
double )
override;
319 double GetScale(
int *pbSuccess =
nullptr )
override;
320 CPLErr SetScale(
double )
override;
322 CPLErr GetHistogram(
double dfMin,
double dfMax,
323 int nBuckets,
GUIntBig * panHistogram,
324 int bIncludeOutOfRange,
int bApproxOK,
325 GDALProgressFunc,
void *pProgressData )
override;
327 CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
328 int *pnBuckets,
GUIntBig ** ppanHistogram,
330 GDALProgressFunc,
void *pProgressData)
override;
332 CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
333 int nBuckets,
GUIntBig *panHistogram )
override;
336 const char * pszDomain =
"" )
override;
338 const char * pszValue,
339 const char * pszDomain =
"" )
override;
349 GDALRasterBandPamInfo *GetPamInfo() {
return psPam; }
357 int CPL_DLL PamParseHistogram(
CPLXMLNode *psHistItem,
358 double *pdfMin,
double *pdfMax,
359 int *pnBuckets,
GUIntBig **ppanHistogram,
360 int *pbIncludeOutOfRange,
int *pbApproxOK );
362 PamFindMatchingHistogram(
CPLXMLNode *psSavedHistograms,
363 double dfMin,
double dfMax,
int nBuckets,
364 int bIncludeOutOfRange,
int bApproxOK );
366 PamHistogramToXMLTree(
double dfMin,
double dfMax,
367 int nBuckets,
GUIntBig * panHistogram,
368 int bIncludeOutOfRange,
int bApprox );
371 const char CPL_DLL * PamGetProxy(
const char * );
372 const char CPL_DLL * PamAllocateProxy(
const char * );
373 const char CPL_DLL * PamDeallocateProxy(
const char * );
374 void CPL_DLL PamCleanProxyDB(
void );
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:47
Document node structure.
Definition: cpl_minixml.h:69
virtual void SetDescription(const char *)
Set object description.
Definition: gdalmajorobject.cpp:120
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="") override
Set metadata.
Definition: gdalpamrasterband.cpp:688
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:249
Convenient string class based on std::string.
Definition: cpl_string.h:332
virtual CPLErr FlushCache()
Flush raster data cache.
Definition: gdalrasterband.cpp:1015
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="") override
Set single metadata item.
Definition: gdalpamdataset.cpp:1446
GUIntBig GUInt64
Unsigned 64 bit integer type.
Definition: cpl_port.h:269
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:344
PAM raster band.
Definition: gdal_pam.h:277
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const OGRSpatialReference *poGCP_SRS)
Assign GCPs.
Definition: gdaldataset.cpp:1783
PAM dataset.
Definition: gdal_pam.h:126
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:251
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:157
A single raster band (or channel).
Definition: gdal_priv.h:1111
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:339
GDALColorInterp
Definition: gdal.h:193
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="") override
Set metadata.
Definition: gdalpamdataset.cpp:1427
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="") override
Set single metadata item.
Definition: gdalpamrasterband.cpp:704
A color table / palette.
Definition: gdal_priv.h:1005
Ground Control Point.
Definition: gdal.h:668
CPLErr
Error category.
Definition: cpl_error.h:52
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1007