Public Member Functions

GDALDefaultRasterAttributeTable Class Reference

Raster Attribute Table container. More...

#include <gdal_rat.h>

Inheritance diagram for GDALDefaultRasterAttributeTable:
GDALRasterAttributeTable

List of all members.

Public Member Functions

 GDALDefaultRasterAttributeTable ()
 Construct empty table.
 GDALDefaultRasterAttributeTable (const GDALDefaultRasterAttributeTable &)
 Copy constructor.
GDALDefaultRasterAttributeTableClone () const
 Copy Raster Attribute Table.
virtual int GetColumnCount () const
 Fetch table column count.
virtual const char * GetNameOfCol (int) const
 Fetch name of indicated column.
virtual GDALRATFieldUsage GetUsageOfCol (int) const
 Fetch column usage value.
virtual GDALRATFieldType GetTypeOfCol (int) const
 Fetch column type.
virtual int GetColOfUsage (GDALRATFieldUsage) const
 Fetch column index for given usage.
virtual int GetRowCount () const
 Fetch row count.
virtual const char * GetValueAsString (int iRow, int iField) const
 Fetch field value as a string.
virtual int GetValueAsInt (int iRow, int iField) const
 Fetch field value as a integer.
virtual double GetValueAsDouble (int iRow, int iField) const
 Fetch field value as a double.
virtual void SetValue (int iRow, int iField, const char *pszValue)
 Set field value from string.
virtual void SetValue (int iRow, int iField, double dfValue)
 Set field value from double.
virtual void SetValue (int iRow, int iField, int nValue)
 Set field value from integer.
virtual int ChangesAreWrittenToFile ()
 Determine whether changes made to this RAT are reflected directly in the dataset.
virtual void SetRowCount (int iCount)
virtual int GetRowOfValue (double dfValue) const
virtual int GetRowOfValue (int nValue) const
virtual CPLErr CreateColumn (const char *pszFieldName, GDALRATFieldType eFieldType, GDALRATFieldUsage eFieldUsage)
virtual CPLErr SetLinearBinning (double dfRow0Min, double dfBinSize)
virtual int GetLinearBinning (double *pdfRow0Min, double *pdfBinSize) const

Detailed Description

Raster Attribute Table container.


Member Function Documentation

int GDALDefaultRasterAttributeTable::ChangesAreWrittenToFile (  )  [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.

GDALDefaultRasterAttributeTable * GDALDefaultRasterAttributeTable::Clone (  )  const [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().

Returns:
new copy of the RAT as an in-memory implementation.

Implements GDALRasterAttributeTable.

int GDALDefaultRasterAttributeTable::GetColOfUsage ( GDALRATFieldUsage   )  const [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().

Parameters:
eUsage usage type to search for.
Returns:
column index, or -1 on failure.

Implements GDALRasterAttributeTable.

int GDALDefaultRasterAttributeTable::GetColumnCount (  )  const [virtual]

Fetch table column count.

This method is the same as the C function GDALRATGetColumnCount().

Returns:
the number of columns.

Implements GDALRasterAttributeTable.

const char * GDALDefaultRasterAttributeTable::GetNameOfCol ( int   )  const [virtual]

Fetch name of indicated column.

This method is the same as the C function GDALRATGetNameOfCol().

Parameters:
iCol the column index (zero based).
Returns:
the column name or an empty string for invalid column numbers.

Implements GDALRasterAttributeTable.

int GDALDefaultRasterAttributeTable::GetRowCount (  )  const [virtual]

Fetch row count.

This method is the same as the C function GDALRATGetRowCount().

Returns:
the number of rows.

Implements GDALRasterAttributeTable.

GDALRATFieldType GDALDefaultRasterAttributeTable::GetTypeOfCol ( int   )  const [virtual]

Fetch column type.

This method is the same as the C function GDALRATGetTypeOfCol().

Parameters:
iCol the column index (zero based).
Returns:
column type or GFT_Integer if the column index is illegal.

Implements GDALRasterAttributeTable.

GDALRATFieldUsage GDALDefaultRasterAttributeTable::GetUsageOfCol ( int   )  const [virtual]

Fetch column usage value.

This method is the same as the C function GDALRATGetUsageOfCol().

Parameters:
iCol the column index (zero based).
Returns:
the column usage, or GFU_Generic for improper column numbers.

Implements GDALRasterAttributeTable.

double GDALDefaultRasterAttributeTable::GetValueAsDouble ( int  iRow,
int  iField 
) const [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().

Parameters:
iRow row to fetch (zero based).
iField column to fetch (zero based).
Returns:
field value

Implements GDALRasterAttributeTable.

int GDALDefaultRasterAttributeTable::GetValueAsInt ( int  iRow,
int  iField 
) const [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().

Parameters:
iRow row to fetch (zero based).
iField column to fetch (zero based).
Returns:
field value

Implements GDALRasterAttributeTable.

const char * GDALDefaultRasterAttributeTable::GetValueAsString ( int  iRow,
int  iField 
) const [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().

Parameters:
iRow row to fetch (zero based).
iField column to fetch (zero based).
Returns:
field value.

Implements GDALRasterAttributeTable.

void GDALDefaultRasterAttributeTable::SetValue ( int  iRow,
int  iField,
double  dfValue 
) [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().

Parameters:
iRow row to fetch (zero based).
iField column to fetch (zero based).
dfValue the value to assign.

Implements GDALRasterAttributeTable.

void GDALDefaultRasterAttributeTable::SetValue ( int  iRow,
int  iField,
int  nValue 
) [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().

Parameters:
iRow row to fetch (zero based).
iField column to fetch (zero based).
nValue the value to assign.

Implements GDALRasterAttributeTable.

void GDALDefaultRasterAttributeTable::SetValue ( int  iRow,
int  iField,
const char *  pszValue 
) [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().

Parameters:
iRow row to fetch (zero based).
iField column to fetch (zero based).
pszValue the value to assign.

Implements GDALRasterAttributeTable.


The documentation for this class was generated from the following files:

Generated for GDAL by doxygen 1.7.1.