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;
261 int iStartRow,
int iLength,
264 int iStartRow,
int iLength,
int *pnData);
266 int iStartRow,
int iLength,
267 char **papszStrList);
269 virtual void SetRowCount(
int iCount );
270 virtual int GetRowOfValue(
double dfValue )
const;
271 virtual int GetRowOfValue(
int nValue )
const;
273 virtual CPLErr CreateColumn(
const char *pszFieldName,
276 virtual CPLErr SetLinearBinning(
double dfRow0Min,
278 virtual int GetLinearBinning(
double *pdfRow0Min,
279 double *pdfBinSize )
const;
288 virtual void *SerializeJSON()
const;
292 virtual GDALColorTable *TranslateToColorTable(
int nEntryCount = -1 );
294 virtual void DumpReadable( FILE * =
nullptr );
313 virtual void RemoveStatistics() = 0;
322 class GDALRasterAttributeField
331 std::vector<GInt32> anValues{};
332 std::vector<double> adfValues{};
333 std::vector<CPLString> aosValues{};
346 std::vector<GDALRasterAttributeField> aoFields{};
348 int bLinearBinning =
false;
349 double dfRow0Min = -0.5;
350 double dfBinSize = 1.0;
354 void AnalyseColumns();
355 int bColumnsAnalysed =
false;
369 int GetColumnCount()
const override;
371 const char *GetNameOfCol(
int )
const override;
377 int GetRowCount()
const override;
379 const char *GetValueAsString(
int iRow,
int iField )
const override;
380 int GetValueAsInt(
int iRow,
int iField )
const override;
381 double GetValueAsDouble(
int iRow,
int iField )
const override;
383 void SetValue(
int iRow,
int iField,
384 const char *pszValue )
override;
385 void SetValue(
int iRow,
int iField,
double dfValue)
override;
386 void SetValue(
int iRow,
int iField,
int nValue )
override;
388 int ChangesAreWrittenToFile()
override;
389 void SetRowCount(
int iCount )
override;
391 int GetRowOfValue(
double dfValue )
const override;
392 int GetRowOfValue(
int nValue )
const override;
394 CPLErr CreateColumn(
const char *pszFieldName,
397 CPLErr SetLinearBinning(
double dfRow0Min,
398 double dfBinSize )
override;
399 int GetLinearBinning(
double *pdfRow0Min,
400 double *pdfBinSize )
const override;
405 void RemoveStatistics()
override;
static GDALRasterAttributeTableH ToHandle(GDALRasterAttributeTable *poRAT)
Convert a GDALRasterAttributeTable* to a GDALRasterAttributeTableH.
Definition: gdal_rat.h:299
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:343
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:329
GDALRATTableType
RAT table type (thematic or athematic)
Definition: gdal.h:1108
static GDALRasterAttributeTable * FromHandle(GDALRasterAttributeTableH hRAT)
Convert a GDALRasterAttributeTableH to a GDALRasterAttributeTable*.
Definition: gdal_rat.h:305
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:937
CPLErr
Error category.
Definition: cpl_error.h:52