|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gdal.gdal.RasterAttributeTable
public class RasterAttributeTable
The RasterAttributeTable (or RAT) class is used to encapsulate a table used to provide attribute information about pixel values. Each row in the table applies to a range of pixel values (or a single value in some cases), and might have attributes such as the histogram count for that range, the color pixels of that range should be drawn names of classes or any other generic information.
The RasterAttributeTable class is a binding for the C++ GDALRasterAttributeTable class.
Raster attribute tables can be used to represent histograms, color tables, and classification information.
Each column in a raster attribute table has a name, a type (integer, floating point or string), and a GDALRATFieldUsage. The usage distinguishes columns with particular understood purposes (such as color, histogram count, name) and columns that have specific purposes not understood by the library (long label, suitability_for_growing_wheat, etc).
In the general case each row has a column indicating the minimum pixel values falling into that category, and a column indicating the maximum pixel value. These are indicated with usage values of GFU_Min, and GFU_Max. In other cases where each row is a discrete pixel value, one column of usage GFU_MinMax can be used.
In other cases all the categories are of equal size and regularly spaced and the categorization information can be determine just by knowing the value at which the categories start, and the size of a category. This is called "Linear Binning" and the information is kept specially on the raster attribute table as a whole.
RATs are normally associated with Bands and be be queried using the Band.GetDefaultRAT() method.
Constructor Summary | |
---|---|
RasterAttributeTable()
Construct empty table. |
Method Summary | |
---|---|
Object |
clone()
|
RasterAttributeTable |
Clone()
Copy Raster Attribute Table. |
int |
CreateColumn(String name,
int eFieldType,
int eFieldUsage)
Create new column. |
void |
delete()
|
int |
GetColOfUsage(int eUsage)
Fetch column index for given usage. |
int |
GetColumnCount()
Fetch table column count. |
boolean |
GetLinearBinning(double[] pdfRow0Min,
double[] pdfBinSize)
Get linear binning information. |
String |
GetNameOfCol(int iCol)
Fetch name of indicated column. |
int |
GetRowCount()
Fetch row count. |
int |
GetRowOfValue(double dfValue)
Get row for pixel value. |
int |
GetTypeOfCol(int iCol)
Fetch color type. |
int |
GetUsageOfCol(int iCol)
Fetch column usage value. |
double |
GetValueAsDouble(int iRow,
int iCol)
Fetch field value as a double. |
int |
GetValueAsInt(int iRow,
int iCol)
Fetch field value as a integer. |
String |
GetValueAsString(int iRow,
int iCol)
Fetch field value as a string. |
int |
SetLinearBinning(double dfRow0Min,
double dfBinSize)
Set linear binning information. |
void |
SetRowCount(int nCount)
Set row count. |
void |
SetValueAsDouble(int iRow,
int iCol,
double dfValue)
Set field value from double. |
void |
SetValueAsInt(int iRow,
int iCol,
int nValue)
Set field value from integer. |
void |
SetValueAsString(int iRow,
int iCol,
String pszValue)
Set field value from string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RasterAttributeTable()
Method Detail |
---|
public void delete()
public Object clone()
clone
in class Object
public RasterAttributeTable Clone()
public int GetColumnCount()
public String GetNameOfCol(int iCol)
iCol
- the column index (zero based).
public int GetUsageOfCol(int iCol)
iCol
- the column index (zero based).
public int GetTypeOfCol(int iCol)
iCol
- the column index (zero based).
public int GetColOfUsage(int eUsage)
eUsage
- usage type to search for.
public int GetRowCount()
public String GetValueAsString(int iRow, int iCol)
iRow
- row to fetch (zero based).iCol
- column to fetch (zero based).
public int GetValueAsInt(int iRow, int iCol)
iRow
- row to fetch (zero based).iCol
- column to fetch (zero based).
public double GetValueAsDouble(int iRow, int iCol)
iRow
- row to fetch (zero based).iCol
- column to fetch (zero based).
public void SetValueAsString(int iRow, int iCol, String pszValue)
iRow
- row to fetch (zero based).iCol
- column to fetch (zero based).pszValue
- the value to assign.public void SetValueAsInt(int iRow, int iCol, int nValue)
iRow
- row to fetch (zero based).iCol
- column to fetch (zero based).nValue
- the value to assign.public void SetValueAsDouble(int iRow, int iCol, double dfValue)
iRow
- row to fetch (zero based).iCol
- column to fetch (zero based).dfValue
- the value to assign.public void SetRowCount(int nCount)
nCount
- the new number of rows.public int CreateColumn(String name, int eFieldType, int eFieldUsage)
name
- the name of the field to create.eFieldType
- the field type (integer, double or string).eFieldUsage
- the field usage, GFU_Generic if not known.
public boolean GetLinearBinning(double[] pdfRow0Min, double[] pdfBinSize)
pdfRow0Min
- (out) array of 1 double that will contain the lower bound (pixel value) of the first category.pdfBinSize
- (out) array of 1 double that will contain the width of each category (in pixel value units).
public int SetLinearBinning(double dfRow0Min, double dfBinSize)
dfRow0Min
- the lower bound (pixel value) of the first category.dfBinSize
- the width of each category (in pixel value units).
public int GetRowOfValue(double dfValue)
dfValue
- the pixel value.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |