30 #ifndef GDAL_PAM_H_INCLUDED 31 #define GDAL_PAM_H_INCLUDED 41 #define GCIF_GEOTRANSFORM 0x01 42 #define GCIF_PROJECTION 0x02 43 #define GCIF_METADATA 0x04 44 #define GCIF_GCPS 0x08 46 #define GCIF_NODATA 0x001000 47 #define GCIF_CATEGORYNAMES 0x002000 48 #define GCIF_MINMAX 0x004000 49 #define GCIF_SCALEOFFSET 0x008000 50 #define GCIF_UNITTYPE 0x010000 51 #define GCIF_COLORTABLE 0x020000 52 #define GCIF_COLORINTERP 0x020000 53 #define GCIF_BAND_METADATA 0x040000 54 #define GCIF_RAT 0x080000 55 #define GCIF_MASK 0x100000 56 #define GCIF_BAND_DESCRIPTION 0x200000 58 #define GCIF_ONLY_IF_MISSING 0x10000000 59 #define GCIF_PROCESS_BANDS 0x20000000 61 #define GCIF_PAM_DEFAULT (GCIF_GEOTRANSFORM | GCIF_PROJECTION | \ 62 GCIF_METADATA | GCIF_GCPS | \ 63 GCIF_NODATA | GCIF_CATEGORYNAMES | \ 64 GCIF_MINMAX | GCIF_SCALEOFFSET | \ 65 GCIF_UNITTYPE | GCIF_COLORTABLE | \ 66 GCIF_COLORINTERP | GCIF_BAND_METADATA | \ 67 GCIF_RAT | GCIF_MASK | \ 68 GCIF_ONLY_IF_MISSING | GCIF_PROCESS_BANDS|\ 69 GCIF_BAND_DESCRIPTION) 73 #define GPF_DIRTY 0x01 // .pam file needs to be written on close 74 #define GPF_TRIED_READ_FAILED 0x02 // no need to keep trying to read .pam. 75 #define GPF_DISABLED 0x04 // do not try any PAM stuff. 76 #define GPF_AUXMODE 0x08 // store info in .aux (HFA) file. 77 #define GPF_NOSAVE 0x10 // do not try to save pam info. 87 class GDALDatasetPamInfo
90 char *pszPamFilename =
nullptr;
94 int bHaveGeoTransform =
false;
95 double adfGeoTransform[6]{0,0,0,0,0,0};
105 int bHasMetadata =
false;
119 int IsPamFilenameAPotentialSiblingFile();
126 GDALDatasetPamInfo *psPam =
nullptr;
128 virtual const char *_GetProjectionRef()
override;
129 virtual const char *_GetGCPProjection()
override;
130 virtual CPLErr _SetProjection(
const char * pszProjection )
override;
131 virtual CPLErr _SetGCPs(
int nGCPCount,
const GDAL_GCP *pasGCPList,
132 const char *pszGCPProjection )
override;
134 virtual CPLXMLNode *SerializeToXML(
const char *);
137 virtual CPLErr TryLoadXML(
char **papszSiblingFiles =
nullptr);
138 virtual CPLErr TrySaveXML();
140 CPLErr TryLoadAux(
char **papszSiblingFiles =
nullptr);
143 virtual const char *BuildPamFilename();
145 void PamInitialize();
148 void SetPhysicalFilename(
const char * );
149 const char *GetPhysicalFilename();
150 void SetSubdatasetName(
const char *);
151 const char *GetSubdatasetName();
162 CPLErr GetGeoTransform(
double * )
override;
163 CPLErr SetGeoTransform(
double * )
override;
165 int GetGCPCount()
override;
173 const char * pszDomain =
"" )
override;
175 const char * pszValue,
176 const char * pszDomain =
"" )
override;
177 char **
GetMetadata(
const char * pszDomain =
"" )
override;
179 const char * pszDomain =
"" )
override;
181 char **GetFileList(
void)
override;
186 CPLErr IBuildOverviews(
const char *pszResampling,
187 int nOverviews,
int *panOverviewList,
188 int nListBands,
int *panBandList,
189 GDALProgressFunc pfnProgress,
190 void * pProgressData )
override;
193 void MarkPamDirty() { nPamFlags |= GPF_DIRTY; }
194 GDALDatasetPamInfo *GetPamInfo() {
return psPam; }
195 int GetPamFlags() {
return nPamFlags; }
196 void SetPamFlags(
int nValue ) { nPamFlags = nValue; }
216 double dfNoDataValue;
223 char **papszCategoryNames;
240 } GDALRasterBandPamInfo;
253 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath );
256 void PamInitialize();
259 GDALRasterBandPamInfo *psPam =
nullptr;
271 CPLErr SetNoDataValue(
double )
override;
272 double GetNoDataValue(
int *pbSuccess =
nullptr )
override;
273 CPLErr DeleteNoDataValue()
override;
281 const char *GetUnitType()
override;
282 CPLErr SetUnitType(
const char * )
override;
284 char **GetCategoryNames()
override;
285 CPLErr SetCategoryNames(
char ** )
override;
287 double GetOffset(
int *pbSuccess =
nullptr )
override;
288 CPLErr SetOffset(
double )
override;
289 double GetScale(
int *pbSuccess =
nullptr )
override;
290 CPLErr SetScale(
double )
override;
292 CPLErr GetHistogram(
double dfMin,
double dfMax,
293 int nBuckets,
GUIntBig * panHistogram,
294 int bIncludeOutOfRange,
int bApproxOK,
295 GDALProgressFunc,
void *pProgressData )
override;
297 CPLErr GetDefaultHistogram(
double *pdfMin,
double *pdfMax,
298 int *pnBuckets,
GUIntBig ** ppanHistogram,
300 GDALProgressFunc,
void *pProgressData)
override;
302 CPLErr SetDefaultHistogram(
double dfMin,
double dfMax,
303 int nBuckets,
GUIntBig *panHistogram )
override;
306 const char * pszDomain =
"" )
override;
308 const char * pszValue,
309 const char * pszDomain =
"" )
override;
319 GDALRasterBandPamInfo *GetPamInfo() {
return psPam; }
327 int CPL_DLL PamParseHistogram(
CPLXMLNode *psHistItem,
328 double *pdfMin,
double *pdfMax,
329 int *pnBuckets,
GUIntBig **ppanHistogram,
330 int *pbIncludeOutOfRange,
int *pbApproxOK );
332 PamFindMatchingHistogram(
CPLXMLNode *psSavedHistograms,
333 double dfMin,
double dfMax,
int nBuckets,
334 int bIncludeOutOfRange,
int bApproxOK );
336 PamHistogramToXMLTree(
double dfMin,
double dfMax,
337 int nBuckets,
GUIntBig * panHistogram,
338 int bIncludeOutOfRange,
int bApprox );
341 const char CPL_DLL * PamGetProxy(
const char * );
342 const char CPL_DLL * PamAllocateProxy(
const char * );
343 const char CPL_DLL * PamDeallocateProxy(
const char * );
344 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:66
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
Convenient string class based on std::string.
Definition: cpl_string.h:329
virtual CPLErr FlushCache()
Flush raster data cache.
Definition: gdalrasterband.cpp:1014
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="") override
Set single metadata item.
Definition: gdalpamdataset.cpp:1308
const char * GetMetadataItem(const char *pszName, const char *pszDomain) override
Fetch single metadata item.
PAM raster band.
Definition: gdal_pam.h:247
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:114
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:251
char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:156
A single raster band (or channel).
Definition: gdal_priv.h:1068
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:335
GDALColorInterp
Definition: gdal.h:190
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="") override
Set metadata.
Definition: gdalpamdataset.cpp:1289
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:964
Ground Control Point.
Definition: gdal.h:563
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:997