GDAL
|
Raster Attribute Table container. More...
#include <gdal_rat.h>
Public Member Functions | |
GDALDefaultRasterAttributeTable () | |
Construct empty table. | |
GDALDefaultRasterAttributeTable (const GDALDefaultRasterAttributeTable &) | |
Copy constructor. | |
GDALDefaultRasterAttributeTable * | Clone () const |
Copy Raster Attribute Table. More... | |
virtual int | GetColumnCount () const |
Fetch table column count. More... | |
virtual const char * | GetNameOfCol (int) const |
Fetch name of indicated column. More... | |
virtual GDALRATFieldUsage | GetUsageOfCol (int) const |
Fetch column usage value. More... | |
virtual GDALRATFieldType | GetTypeOfCol (int) const |
Fetch column type. More... | |
virtual int | GetColOfUsage (GDALRATFieldUsage) const |
Fetch column index for given usage. More... | |
virtual int | GetRowCount () const |
Fetch row count. More... | |
virtual const char * | GetValueAsString (int iRow, int iField) const |
Fetch field value as a string. More... | |
virtual int | GetValueAsInt (int iRow, int iField) const |
Fetch field value as a integer. More... | |
virtual double | GetValueAsDouble (int iRow, int iField) const |
Fetch field value as a double. More... | |
virtual void | SetValue (int iRow, int iField, const char *pszValue) |
Set field value from string. More... | |
virtual void | SetValue (int iRow, int iField, double dfValue) |
Set field value from double. More... | |
virtual void | SetValue (int iRow, int iField, int nValue) |
Set field value from integer. More... | |
virtual int | ChangesAreWrittenToFile () |
Determine whether changes made to this RAT are reflected directly in the dataset. More... | |
virtual void | SetRowCount (int iCount) |
Set row count. More... | |
virtual int | GetRowOfValue (double dfValue) const |
virtual int | GetRowOfValue (int nValue) const |
virtual CPLErr | CreateColumn (const char *pszFieldName, GDALRATFieldType eFieldType, GDALRATFieldUsage eFieldUsage) |
Create new column. More... | |
virtual CPLErr | SetLinearBinning (double dfRow0Min, double dfBinSize) |
Set linear binning information. More... | |
virtual int | GetLinearBinning (double *pdfRow0Min, double *pdfBinSize) const |
Get linear binning information. More... | |
![]() | |
virtual CPLErr | ValuesIO (GDALRWFlag eRWFlag, int iField, int iStartRow, int iLength, double *pdfData) |
Read or Write a block of doubles to/from the Attribute Table. More... | |
virtual CPLErr | ValuesIO (GDALRWFlag eRWFlag, int iField, int iStartRow, int iLength, int *pnData) |
Read or Write a block of integers to/from the Attribute Table. More... | |
virtual CPLErr | ValuesIO (GDALRWFlag eRWFlag, int iField, int iStartRow, int iLength, char **papszStrList) |
Read or Write a block of strings to/from the Attribute Table. More... | |
virtual CPLXMLNode * | Serialize () const |
Serialize. More... | |
virtual CPLErr | XMLInit (CPLXMLNode *, const char *) |
virtual CPLErr | InitializeFromColorTable (const GDALColorTable *) |
Initialize from color table. More... | |
virtual GDALColorTable * | TranslateToColorTable (int nEntryCount=-1) |
Translate to a color table. More... | |
virtual void | DumpReadable (FILE *=NULL) |
Dump RAT in readable form. More... | |
Raster Attribute Table container.
|
virtual |
Determine whether changes made to this RAT are reflected directly in the dataset.
If this returns FALSE then GDALRasterBand.SetDefaultRAT() should be called. Otherwise this is unnecessary since changes to this object are reflected in the dataset.
This method is the same as the C function GDALRATChangesAreWrittenToFile().
Implements GDALRasterAttributeTable.
|
virtual |
Copy Raster Attribute Table.
Creates a new copy of an existing raster attribute table. The new copy becomes the responsibility of the caller to destroy. May fail (return NULL) if the attribute table is too large to clone (GetRowCount() * GetColCount() > RAT_MAX_ELEM_FOR_CLONE)
This method is the same as the C function GDALRATClone().
Implements GDALRasterAttributeTable.
|
virtual |
Create new column.
If the table already has rows, all row values for the new column will be initialized to the default value ("", or zero). The new column is always created as the last column, can will be column (field) "GetColumnCount()-1" after CreateColumn() has completed successfully.
This method is the same as the C function GDALRATCreateColumn().
pszFieldName | the name of the field to create. |
eFieldType | the field type (integer, double or string). |
eFieldUsage | the field usage, GFU_Generic if not known. |
Reimplemented from GDALRasterAttributeTable.
|
virtual |
Fetch column index for given usage.
Returns the index of the first column of the requested usage type, or -1 if no match is found.
This method is the same as the C function GDALRATGetUsageOfCol().
eUsage | usage type to search for. |
Implements GDALRasterAttributeTable.
|
virtual |
Fetch table column count.
This method is the same as the C function GDALRATGetColumnCount().
Implements GDALRasterAttributeTable.
|
virtual |
Get linear binning information.
Returns linear binning information if any is associated with the RAT.
This method is the same as the C function GDALRATGetLinearBinning().
pdfRow0Min | (out) the lower bound (pixel value) of the first category. |
pdfBinSize | (out) the width of each category (in pixel value units). |
Reimplemented from GDALRasterAttributeTable.
|
virtual |
Fetch name of indicated column.
This method is the same as the C function GDALRATGetNameOfCol().
iCol | the column index (zero based). |
Implements GDALRasterAttributeTable.
|
virtual |
Fetch row count.
This method is the same as the C function GDALRATGetRowCount().
Implements GDALRasterAttributeTable.
|
virtual |
Fetch column type.
This method is the same as the C function GDALRATGetTypeOfCol().
iCol | the column index (zero based). |
Implements GDALRasterAttributeTable.
|
virtual |
Fetch column usage value.
This method is the same as the C function GDALRATGetUsageOfCol().
iCol | the column index (zero based). |
Implements GDALRasterAttributeTable.
|
virtual |
Fetch field value as a double.
The value of the requested column in the requested row is returned as a double. Non double fields will be converted to double with the possibility of data loss.
This method is the same as the C function GDALRATGetValueAsDouble().
iRow | row to fetch (zero based). |
iField | column to fetch (zero based). |
Implements GDALRasterAttributeTable.
|
virtual |
Fetch field value as a integer.
The value of the requested column in the requested row is returned as an integer. Non-integer fields will be converted to integer with the possibility of data loss.
This method is the same as the C function GDALRATGetValueAsInt().
iRow | row to fetch (zero based). |
iField | column to fetch (zero based). |
Implements GDALRasterAttributeTable.
|
virtual |
Fetch field value as a string.
The value of the requested column in the requested row is returned as a string. If the field is numeric, it is formatted as a string using default rules, so some precision may be lost.
The returned string is temporary and cannot be expected to be available after the next GDAL call.
This method is the same as the C function GDALRATGetValueAsString().
iRow | row to fetch (zero based). |
iField | column to fetch (zero based). |
Implements GDALRasterAttributeTable.
|
virtual |
Set linear binning information.
For RATs with equal sized categories (in pixel value space) that are evenly spaced, this method may be used to associate the linear binning information with the table.
This method is the same as the C function GDALRATSetLinearBinning().
dfRow0MinIn | the lower bound (pixel value) of the first category. |
dfBinSizeIn | the width of each category (in pixel value units). |
Reimplemented from GDALRasterAttributeTable.
|
virtual |
Set row count.
Resizes the table to include the indicated number of rows. Newly created rows will be initialized to their default values - "" for strings, and zero for numeric fields.
This method is the same as the C function GDALRATSetRowCount().
nNewCount | the new number of rows. |
Reimplemented from GDALRasterAttributeTable.
|
virtual |
Set field value from string.
The indicated field (column) on the indicated row is set from the passed value. The value will be automatically converted for other field types, with a possible loss of precision.
This method is the same as the C function GDALRATSetValueAsString().
iRow | row to fetch (zero based). |
iField | column to fetch (zero based). |
pszValue | the value to assign. |
Implements GDALRasterAttributeTable.
|
virtual |
Set field value from double.
The indicated field (column) on the indicated row is set from the passed value. The value will be automatically converted for other field types, with a possible loss of precision.
This method is the same as the C function GDALRATSetValueAsDouble().
iRow | row to fetch (zero based). |
iField | column to fetch (zero based). |
dfValue | the value to assign. |
Implements GDALRasterAttributeTable.
|
virtual |
Set field value from integer.
The indicated field (column) on the indicated row is set from the passed value. The value will be automatically converted for other field types, with a possible loss of precision.
This method is the same as the C function GDALRATSetValueAsInteger().
iRow | row to fetch (zero based). |
iField | column to fetch (zero based). |
nValue | the value to assign. |
Implements GDALRasterAttributeTable.