30 #ifndef GDAL_RAT_H_INCLUDED 31 #define GDAL_RAT_H_INCLUDED 38 #define RAT_MAX_ELEM_FOR_CLONE 1000000 72 virtual int GetColumnCount()
const = 0;
83 virtual const char *GetNameOfCol(
int iCol )
const = 0;
128 virtual int GetRowCount()
const = 0;
147 virtual const char *GetValueAsString(
int iRow,
int iField )
const = 0;
163 virtual int GetValueAsInt(
int iRow,
int iField )
const = 0;
179 virtual double GetValueAsDouble(
int iRow,
int iField )
const = 0;
194 virtual void SetValue(
int iRow,
int iField,
195 const char *pszValue ) = 0;
210 virtual void SetValue(
int iRow,
int iField,
int nValue ) = 0;
225 virtual void SetValue(
int iRow,
int iField,
double dfValue) = 0;
239 virtual int ChangesAreWrittenToFile() = 0;
242 int iStartRow,
int iLength,
245 int iStartRow,
int iLength,
int *pnData);
247 int iStartRow,
int iLength,
248 char **papszStrList);
250 virtual void SetRowCount(
int iCount );
251 virtual int GetRowOfValue(
double dfValue )
const;
252 virtual int GetRowOfValue(
int nValue )
const;
254 virtual CPLErr CreateColumn(
const char *pszFieldName,
257 virtual CPLErr SetLinearBinning(
double dfRow0Min,
259 virtual int GetLinearBinning(
double *pdfRow0Min,
260 double *pdfBinSize )
const;
269 virtual void *SerializeJSON()
const;
273 virtual GDALColorTable *TranslateToColorTable(
int nEntryCount = -1 );
275 virtual void DumpReadable( FILE * =
nullptr );
296 class GDALRasterAttributeField
305 std::vector<GInt32> anValues;
306 std::vector<double> adfValues;
307 std::vector<CPLString> aosValues;
321 std::vector<GDALRasterAttributeField> aoFields;
327 void AnalyseColumns();
328 int bColumnsAnalysed;
343 int GetColumnCount()
const override;
345 const char *GetNameOfCol(
int )
const override;
351 int GetRowCount()
const override;
353 const char *GetValueAsString(
int iRow,
int iField )
const override;
354 int GetValueAsInt(
int iRow,
int iField )
const override;
355 double GetValueAsDouble(
int iRow,
int iField )
const override;
357 void SetValue(
int iRow,
int iField,
358 const char *pszValue )
override;
359 void SetValue(
int iRow,
int iField,
double dfValue)
override;
360 void SetValue(
int iRow,
int iField,
int nValue )
override;
362 int ChangesAreWrittenToFile()
override;
363 void SetRowCount(
int iCount )
override;
365 int GetRowOfValue(
double dfValue )
const override;
366 int GetRowOfValue(
int nValue )
const override;
368 CPLErr CreateColumn(
const char *pszFieldName,
371 CPLErr SetLinearBinning(
double dfRow0Min,
372 double dfBinSize )
override;
373 int GetLinearBinning(
double *pdfRow0Min,
374 double *pdfBinSize )
const override;
static GDALRasterAttributeTableH ToHandle(GDALRasterAttributeTable *poRAT)
Convert a GDALRasterAttributeTable* to a GDALRasterAttributeTableH.
Definition: gdal_rat.h:280
The GDALRasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute ...
Definition: gdal_rat.h:47
Raster Attribute Table container.
Definition: gdal_rat.h:318
Document node structure.
Definition: cpl_minixml.h:66
Definitions for CPL mini XML Parser/Serializer.
GDALRATFieldType
Field type of raster attribute table.
Definition: gdal.h:1076
GDALRWFlag
Definition: gdal.h:119
Convenient string class based on std::string.
Definition: cpl_string.h:336
static GDALRasterAttributeTable * FromHandle(GDALRasterAttributeTableH hRAT)
Convert a GDALRasterAttributeTableH to a GDALRasterAttributeTable*.
Definition: gdal_rat.h:286
void * GDALRasterAttributeTableH
Opaque type used for the C bindings of the C++ GDALRasterAttributeTable class.
Definition: gdal.h:267
GDALRATFieldUsage
Field usage of raster attribute table.
Definition: gdal.h:1083
A color table / palette.
Definition: gdal_priv.h:949
CPLErr
Error category.
Definition: cpl_error.h:52