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;
92 char *pszProjection =
nullptr;
94 int bHaveGeoTransform =
false;
95 double adfGeoTransform[6]{0,0,0,0,0,0};
99 char *pszGCPProjection =
nullptr;
105 int bHasMetadata =
false;
119 int IsPamFilenameAPotentialSiblingFile();
126 GDALDatasetPamInfo *psPam =
nullptr;
128 virtual CPLXMLNode *SerializeToXML(
const char *);
131 virtual CPLErr TryLoadXML(
char **papszSiblingFiles =
nullptr);
132 virtual CPLErr TrySaveXML();
134 CPLErr TryLoadAux(
char **papszSiblingFiles =
nullptr);
137 virtual const char *BuildPamFilename();
139 void PamInitialize();
142 void SetPhysicalFilename(
const char * );
143 const char *GetPhysicalFilename();
144 void SetSubdatasetName(
const char *);
145 const char *GetSubdatasetName();
163 const char *pszGCPProjection )
override;
166 const char * pszDomain =
"" )
override;
168 const char * pszValue,
169 const char * pszDomain =
"" )
override;
170 char **
GetMetadata(
const char * pszDomain =
"" )
override;
172 const char * pszDomain =
"" )
override;
179 CPLErr IBuildOverviews(
const char *pszResampling,
180 int nOverviews,
int *panOverviewList,
181 int nListBands,
int *panBandList,
182 GDALProgressFunc pfnProgress,
183 void * pProgressData )
override;
186 void MarkPamDirty() { nPamFlags |= GPF_DIRTY; }
187 GDALDatasetPamInfo *GetPamInfo() {
return psPam; }
188 int GetPamFlags() {
return nPamFlags; }
189 void SetPamFlags(
int nValue ) { nPamFlags = nValue; }
209 double dfNoDataValue;
216 char **papszCategoryNames;
233 } GDALRasterBandPamInfo;
246 virtual CPLXMLNode *SerializeToXML(
const char *pszVRTPath );
249 void PamInitialize();
252 GDALRasterBandPamInfo *psPam =
nullptr;
280 double GetOffset(
int *pbSuccess =
nullptr )
override;
282 double GetScale(
int *pbSuccess =
nullptr )
override;
286 int nBuckets,
GUIntBig * panHistogram,
287 int bIncludeOutOfRange,
int bApproxOK,
288 GDALProgressFunc,
void *pProgressData )
override;
291 int *pnBuckets,
GUIntBig ** ppanHistogram,
293 GDALProgressFunc,
void *pProgressData)
override;
296 int nBuckets,
GUIntBig *panHistogram )
override;
299 const char * pszDomain =
"" )
override;
301 const char * pszValue,
302 const char * pszDomain =
"" )
override;
312 GDALRasterBandPamInfo *GetPamInfo() {
return psPam; }
320 int CPL_DLL PamParseHistogram(
CPLXMLNode *psHistItem,
321 double *pdfMin,
double *pdfMax,
322 int *pnBuckets,
GUIntBig **ppanHistogram,
323 int *pbIncludeOutOfRange,
int *pbApproxOK );
325 PamFindMatchingHistogram(
CPLXMLNode *psSavedHistograms,
326 double dfMin,
double dfMax,
int nBuckets,
327 int bIncludeOutOfRange,
int bApproxOK );
329 PamHistogramToXMLTree(
double dfMin,
double dfMax,
330 int nBuckets,
GUIntBig * panHistogram,
331 int bIncludeOutOfRange,
int bApprox );
334 const char CPL_DLL * PamGetProxy(
const char * );
335 const char CPL_DLL * PamAllocateProxy(
const char * );
336 const char CPL_DLL * PamDeallocateProxy(
const char * );
337 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
virtual CPLErr GetGeoTransform(double *padfTransform)
Fetch the affine transformation coefficients.
Definition: gdaldataset.cpp:922
virtual CPLErr SetCategoryNames(char **papszNames)
Set the category names for this band.
Definition: gdalrasterband.cpp:1552
Document node structure.
Definition: cpl_minixml.h:66
virtual char ** GetCategoryNames()
Fetch the list of category names for this raster.
Definition: gdalrasterband.cpp:1504
virtual void SetDescription(const char *)
Set object description.
Definition: gdalmajorobject.cpp:120
virtual void FlushCache(void)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:396
virtual CPLErr GetDefaultHistogram(double *pdfMin, double *pdfMax, int *pnBuckets, GUIntBig **ppanHistogram, int bForce, GDALProgressFunc, void *pProgressData)
Fetch default raster histogram.
Definition: gdalrasterband.cpp:3458
virtual GDALColorInterp GetColorInterpretation()
How should this band be interpreted as color?
Definition: gdalrasterband.cpp:1947
virtual const char * GetProjectionRef(void)
Fetch the projection definition string for this dataset.
Definition: gdaldataset.cpp:824
virtual CPLErr SetDefaultRAT(const GDALRasterAttributeTable *poRAT)
Set default Raster Attribute Table.
Definition: gdalrasterband.cpp:5861
virtual GDALRasterAttributeTable * GetDefaultRAT()
Fetch default Raster Attribute Table.
Definition: gdalrasterband.cpp:5813
virtual CPLErr GetHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram, int bIncludeOutOfRange, int bApproxOK, GDALProgressFunc, void *pProgressData)
Compute raster histogram.
Definition: gdalrasterband.cpp:2916
Convenient string class based on std::string.
Definition: cpl_string.h:329
virtual CPLErr SetGCPs(int nGCPCount, const GDAL_GCP *pasGCPList, const char *pszGCPProjection)
Assign GCPs.
Definition: gdaldataset.cpp:1382
virtual CPLErr SetOffset(double dfNewOffset)
Set scaling offset.
Definition: gdalrasterband.cpp:2463
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition: gdaldataset.cpp:3484
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
virtual CPLErr SetDefaultHistogram(double dfMin, double dfMax, int nBuckets, GUIntBig *panHistogram)
Set default histogram.
Definition: gdalrasterband.cpp:5714
virtual double GetScale(int *pbSuccess=nullptr)
Fetch the raster value scale.
Definition: gdalrasterband.cpp:2520
PAM raster band.
Definition: gdal_pam.h:240
virtual const GDAL_GCP * GetGCPs()
Fetch GCPs.
Definition: gdaldataset.cpp:1332
virtual CPLErr DeleteNoDataValue()
Remove the no data value for this band.
Definition: gdalrasterband.cpp:1717
virtual CPLErr SetGeoTransform(double *padfTransform)
Set the affine transformation coefficients.
Definition: gdaldataset.cpp:977
virtual double GetNoDataValue(int *pbSuccess=nullptr)
Fetch the no data value for this band.
Definition: gdalrasterband.cpp:1604
virtual int GetGCPCount()
Get number of GCPs.
Definition: gdaldataset.cpp:1264
virtual CPLErr SetColorInterpretation(GDALColorInterp eColorInterp)
Set color interpretation of a band.
Definition: gdalrasterband.cpp:1992
virtual const char * GetUnitType()
Return raster unit type.
Definition: gdalrasterband.cpp:2616
PAM dataset.
Definition: gdal_pam.h:114
virtual CPLErr SetColorTable(GDALColorTable *poCT)
Set the raster color table.
Definition: gdalrasterband.cpp:2088
virtual GDALColorTable * GetColorTable()
Fetch the color table associated with band.
Definition: gdalrasterband.cpp:2039
unsigned long long GUIntBig
Large unsigned integer type (generally 64-bit unsigned integer type).
Definition: cpl_port.h:251
virtual char ** GetFileList(void)
Fetch files forming dataset.
Definition: gdaldataset.cpp:2360
virtual CPLErr SetProjection(const char *pszProjection)
Set the projection reference string for this dataset.
Definition: gdaldataset.cpp:864
virtual const char * GetGCPProjection()
Get output projection for GCPs.
Definition: gdaldataset.cpp:1299
virtual CPLErr SetScale(double dfNewScale)
Set scaling ratio.
Definition: gdalrasterband.cpp:2569
virtual double GetOffset(int *pbSuccess=nullptr)
Fetch the raster value offset.
Definition: gdalrasterband.cpp:2414
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
virtual CPLErr SetUnitType(const char *pszNewValue)
Set unit type.
Definition: gdalrasterband.cpp:2664
A single raster band (or channel).
Definition: gdal_priv.h:1032
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:335
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
GDALColorInterp
Definition: gdal.h:190
virtual CPLErr SetNoDataValue(double dfNoData)
Set the no data value for this band.
Definition: gdalrasterband.cpp:1663
const char * GetMetadataItem(const char *pszName, const char *pszDomain) override
Fetch single metadata item.
A color table / palette.
Definition: gdal_priv.h:937
Ground Control Point.
Definition: gdal.h:560
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:989