| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
#ifndef GDAL_RAT_H_INCLUDED |
|---|
| 37 |
#define GDAL_RAT_H_INCLUDED |
|---|
| 38 |
|
|---|
| 39 |
#include "cpl_minixml.h" |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
class GDALRasterAttributeField |
|---|
| 48 |
{ |
|---|
| 49 |
public: |
|---|
| 50 |
CPLString sName; |
|---|
| 51 |
|
|---|
| 52 |
GDALRATFieldType eType; |
|---|
| 53 |
|
|---|
| 54 |
GDALRATFieldUsage eUsage; |
|---|
| 55 |
|
|---|
| 56 |
std::vector<GInt32> anValues; |
|---|
| 57 |
std::vector<double> adfValues; |
|---|
| 58 |
std::vector<CPLString> aosValues; |
|---|
| 59 |
}; |
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
class CPL_DLL GDALRasterAttributeTable |
|---|
| 68 |
{ |
|---|
| 69 |
friend const char * CPL_STDCALL GDALRATGetNameOfCol( GDALRasterAttributeTableH, int ); |
|---|
| 70 |
friend const char * CPL_STDCALL GDALRATGetValueAsString( GDALRasterAttributeTableH, int, int ); |
|---|
| 71 |
|
|---|
| 72 |
private: |
|---|
| 73 |
std::vector<GDALRasterAttributeField> aoFields; |
|---|
| 74 |
|
|---|
| 75 |
int bLinearBinning; |
|---|
| 76 |
double dfRow0Min; |
|---|
| 77 |
double dfBinSize; |
|---|
| 78 |
|
|---|
| 79 |
int nMinCol; |
|---|
| 80 |
int nMaxCol; |
|---|
| 81 |
|
|---|
| 82 |
int nRowCount; |
|---|
| 83 |
|
|---|
| 84 |
CPLString osWorkingResult; |
|---|
| 85 |
|
|---|
| 86 |
public: |
|---|
| 87 |
GDALRasterAttributeTable(); |
|---|
| 88 |
GDALRasterAttributeTable(const GDALRasterAttributeTable&); |
|---|
| 89 |
~GDALRasterAttributeTable(); |
|---|
| 90 |
|
|---|
| 91 |
GDALRasterAttributeTable *Clone() const; |
|---|
| 92 |
|
|---|
| 93 |
int GetColumnCount() const; |
|---|
| 94 |
|
|---|
| 95 |
CPLString GetNameOfCol( int ) const; |
|---|
| 96 |
GDALRATFieldUsage GetUsageOfCol( int ) const; |
|---|
| 97 |
GDALRATFieldType GetTypeOfCol( int ) const; |
|---|
| 98 |
|
|---|
| 99 |
int GetColOfUsage( GDALRATFieldUsage ) const; |
|---|
| 100 |
|
|---|
| 101 |
int GetRowCount() const; |
|---|
| 102 |
|
|---|
| 103 |
CPLString GetValueAsString( int iRow, int iField ) const; |
|---|
| 104 |
int GetValueAsInt( int iRow, int iField ) const; |
|---|
| 105 |
double GetValueAsDouble( int iRow, int iField ) const; |
|---|
| 106 |
|
|---|
| 107 |
void SetValue( int iRow, int iField, const char *pszValue ); |
|---|
| 108 |
void SetValue( int iRow, int iField, double dfValue); |
|---|
| 109 |
void SetValue( int iRow, int iField, int nValue ); |
|---|
| 110 |
void SetRowCount( int iCount ); |
|---|
| 111 |
|
|---|
| 112 |
int GetRowOfValue( double dfValue ) const; |
|---|
| 113 |
int GetRowOfValue( int nValue ) const; |
|---|
| 114 |
int GetColorOfValue( double dfValue, GDALColorEntry *psEntry ) const; |
|---|
| 115 |
|
|---|
| 116 |
double GetRowMin( int iRow ) const; |
|---|
| 117 |
double GetRowMax( int iRow ) const; |
|---|
| 118 |
|
|---|
| 119 |
CPLErr CreateColumn( CPLString osFieldName, |
|---|
| 120 |
GDALRATFieldType eFieldType, |
|---|
| 121 |
GDALRATFieldUsage eFieldUsage ); |
|---|
| 122 |
CPLErr SetLinearBinning( double dfRow0Min, double dfBinSize ); |
|---|
| 123 |
int GetLinearBinning( double *pdfRow0Min, double *pdfBinSize ) const; |
|---|
| 124 |
|
|---|
| 125 |
CPLXMLNode *Serialize() const; |
|---|
| 126 |
CPLErr XMLInit( CPLXMLNode *, const char * ); |
|---|
| 127 |
|
|---|
| 128 |
CPLErr InitializeFromColorTable( const GDALColorTable * ); |
|---|
| 129 |
|
|---|
| 130 |
void DumpReadable( FILE * = NULL ); |
|---|
| 131 |
}; |
|---|
| 132 |
|
|---|
| 133 |
#endif |
|---|