📄 classgdalrasterattributetable.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>GDAL: GDALRasterAttributeTable Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.1 --><div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li id="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul></div><div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul></div><h1>GDALRasterAttributeTable Class Reference</h1><!-- doxytag: class="GDALRasterAttributeTable" -->Raster Attribute Table container. <a href="#_details">More...</a><p><code>#include <<a class="el" href="gdal__rat_8h-source.html">gdal_rat.h</a>></code><p><a href="classGDALRasterAttributeTable-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6363eab77ef5bb5a45f66a1d43e304f7"></a><!-- doxytag: member="GDALRasterAttributeTable::GDALRasterAttributeTable" ref="6363eab77ef5bb5a45f66a1d43e304f7" args="()" --> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#6363eab77ef5bb5a45f66a1d43e304f7">GDALRasterAttributeTable</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Construct empty table. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="66bf4b1ee784239e88ae7d7b9b906076"></a><!-- doxytag: member="GDALRasterAttributeTable::GDALRasterAttributeTable" ref="66bf4b1ee784239e88ae7d7b9b906076" args="(const GDALRasterAttributeTable &)" --> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#66bf4b1ee784239e88ae7d7b9b906076">GDALRasterAttributeTable</a> (const <a class="el" href="classGDALRasterAttributeTable.html">GDALRasterAttributeTable</a> &)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classGDALRasterAttributeTable.html">GDALRasterAttributeTable</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#32059d99dbb8197bd3ed6395721706b8">Clone</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Copy Raster Attribute Table. <a href="#32059d99dbb8197bd3ed6395721706b8"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#bda5604f899f1eb0dbe83b30bd4eb8ef">GetColumnCount</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Fetch table column count. <a href="#bda5604f899f1eb0dbe83b30bd4eb8ef"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#533ed0e87ba61d1c3d662c5fd1ee01e8">GetNameOfCol</a> (int) const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Fetch name of indicated column. <a href="#533ed0e87ba61d1c3d662c5fd1ee01e8"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="gdal_8h.html#27bf786b965d5227da1acc2a4cab69a1">GDALRATFieldUsage</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#53f36667aa01059844d980914e3ea09d">GetUsageOfCol</a> (int) const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Fetch column usage value. <a href="#53f36667aa01059844d980914e3ea09d"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="gdal_8h.html#810154ac91149d1a63c42717258fe16e">GDALRATFieldType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#69eb6893d98c915ef14293cd68713606">GetTypeOfCol</a> (int) const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Fetch color type. <a href="#69eb6893d98c915ef14293cd68713606"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#d14d4f36a9c10ffc3e63ed24f963bd5d">GetColOfUsage</a> (<a class="el" href="gdal_8h.html#27bf786b965d5227da1acc2a4cab69a1">GDALRATFieldUsage</a>) const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Fetch column index for given usage. <a href="#d14d4f36a9c10ffc3e63ed24f963bd5d"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#e2bd7c9326b711a8c4e149eff79bf941">GetRowCount</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Fetch row count. <a href="#e2bd7c9326b711a8c4e149eff79bf941"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#fa08088965c40b8dc91b00803adf9640">GetValueAsString</a> (int iRow, int iField) const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Fetch field value as a string. <a href="#fa08088965c40b8dc91b00803adf9640"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#3032beec5c0bac5b1d5aa3128fdb72a0">GetValueAsInt</a> (int iRow, int iField) const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Fetch field value as a integer. <a href="#3032beec5c0bac5b1d5aa3128fdb72a0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#707e6c53b84b03cc1979e2d277f4adc1">GetValueAsDouble</a> (int iRow, int iField) const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Fetch field value as a double. <a href="#707e6c53b84b03cc1979e2d277f4adc1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#71b0d63f1991f300a88e1b0b95024a44">SetValue</a> (int iRow, int iField, const char *pszValue)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Set field value from string. <a href="#71b0d63f1991f300a88e1b0b95024a44"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#b76d4a92ff58fd4dd4ce3ccc6006927f">SetValue</a> (int iRow, int iField, double dfValue)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Set field value from double. <a href="#b76d4a92ff58fd4dd4ce3ccc6006927f"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#e500398b7acd98a7630a51028387ba04">SetValue</a> (int iRow, int iField, int nValue)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Set field value from integer. <a href="#e500398b7acd98a7630a51028387ba04"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#5f108000de7f8ace1a4eb4f015ac3b5f">SetRowCount</a> (int iCount)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Set row count. <a href="#5f108000de7f8ace1a4eb4f015ac3b5f"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#a7c68ff1867e87fe5986f38655fa7d32">GetRowOfValue</a> (double dfValue) const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Get row for pixel value. <a href="#a7c68ff1867e87fe5986f38655fa7d32"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b9fbcbfd6cd8b6d70bda2ffda0f4e48d"></a><!-- doxytag: member="GDALRasterAttributeTable::GetRowOfValue" ref="b9fbcbfd6cd8b6d70bda2ffda0f4e48d" args="(int nValue) const " -->int </td><td class="memItemRight" valign="bottom"><b>GetRowOfValue</b> (int nValue) const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f8bed2cc18b18c6018a5d2ecd0545b0d"></a><!-- doxytag: member="GDALRasterAttributeTable::GetColorOfValue" ref="f8bed2cc18b18c6018a5d2ecd0545b0d" args="(double dfValue, GDALColorEntry *psEntry) const " -->int </td><td class="memItemRight" valign="bottom"><b>GetColorOfValue</b> (double dfValue, <a class="el" href="structGDALColorEntry.html">GDALColorEntry</a> *psEntry) const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ced757e4cad763dbe8630b013269f173"></a><!-- doxytag: member="GDALRasterAttributeTable::GetRowMin" ref="ced757e4cad763dbe8630b013269f173" args="(int iRow) const " -->double </td><td class="memItemRight" valign="bottom"><b>GetRowMin</b> (int iRow) const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ecb4061f6fadba8f36b053ce4e3c5d0a"></a><!-- doxytag: member="GDALRasterAttributeTable::GetRowMax" ref="ecb4061f6fadba8f36b053ce4e3c5d0a" args="(int iRow) const " -->double </td><td class="memItemRight" valign="bottom"><b>GetRowMax</b> (int iRow) const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CPLErr </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#2a4f7248c0e37e217b1d6423c538123e">CreateColumn</a> (const char *pszFieldName, <a class="el" href="gdal_8h.html#810154ac91149d1a63c42717258fe16e">GDALRATFieldType</a> eFieldType, <a class="el" href="gdal_8h.html#27bf786b965d5227da1acc2a4cab69a1">GDALRATFieldUsage</a> eFieldUsage)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Create new column. <a href="#2a4f7248c0e37e217b1d6423c538123e"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CPLErr </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#ca7ea5023d9820fd8611a388ca947887">SetLinearBinning</a> (double dfRow0Min, double dfBinSize)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Set linear binning information. <a href="#ca7ea5023d9820fd8611a388ca947887"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#256e0e90249b812048731c597f6f79f2">GetLinearBinning</a> (double *pdfRow0Min, double *pdfBinSize) const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Get linear binning information. <a href="#256e0e90249b812048731c597f6f79f2"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e03313304ccb08bfa042e4a0336a756b"></a><!-- doxytag: member="GDALRasterAttributeTable::Serialize" ref="e03313304ccb08bfa042e4a0336a756b" args="() const" --><a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a> * </td><td class="memItemRight" valign="bottom"><b>Serialize</b> () const</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1570b5a0b242d28cb435005bd7ac38bd"></a><!-- doxytag: member="GDALRasterAttributeTable::XMLInit" ref="1570b5a0b242d28cb435005bd7ac38bd" args="(CPLXMLNode *, const char *)" -->CPLErr </td><td class="memItemRight" valign="bottom"><b>XMLInit</b> (<a class="el" href="struct__CPLXMLNode.html">CPLXMLNode</a> *, const char *)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CPLErr </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#ce0bd498e5533d9f1585f801ca6ecf5e">InitializeFromColorTable</a> (const GDALColorTable *)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize from color table. <a href="#ce0bd498e5533d9f1585f801ca6ecf5e"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">GDALColorTable * </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#855180a5a68a73a6830d00ffd6ee655f">TranslateToColorTable</a> (int nEntryCount=-1)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Translate to a color table. <a href="#855180a5a68a73a6830d00ffd6ee655f"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALRasterAttributeTable.html#3dad1ef8c228f8a24c304b511e17c72f">DumpReadable</a> (FILE *=NULL)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Dump RAT in readable form. <a href="#3dad1ef8c228f8a24c304b511e17c72f"></a><br></td></tr><tr><td colspan="2"><br><h2>Friends</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="22bf88c32fd2ce88f597eac395cae99a"></a><!-- doxytag: member="GDALRasterAttributeTable::GDALRATGetNameOfCol" ref="22bf88c32fd2ce88f597eac395cae99a" args="(GDALRasterAttributeTableH, int)" -->const char * </td><td class="memItemRight" valign="bottom"><b>GDALRATGetNameOfCol</b> (GDALRasterAttributeTableH, int)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="da2251716cae4438fba8d4cf932c6506"></a><!-- doxytag: member="GDALRasterAttributeTable::GDALRATGetValueAsString" ref="da2251716cae4438fba8d4cf932c6506" args="(GDALRasterAttributeTableH, int, int)" -->const char * </td><td class="memItemRight" valign="bottom"><b>GDALRATGetValueAsString</b> (GDALRasterAttributeTableH, int, int)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Raster Attribute Table container. <p>The <a class="el" href="classGDALRasterAttributeTable.html">GDALRasterAttributeTable</a> (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.<p>Raster attribute tables can be used to represent histograms, color tables, and classification information.<p>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).<p>In the general case each row as 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.<p>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.<p>RATs are normally associated with GDALRasterBands and be be queried using the <a class="el" href="classGDALRasterBand.html#5239240c7d3f69342bcda45ff3bc62db">GDALRasterBand::GetDefaultRAT()</a> method. <p><hr><h2>Member Function Documentation</h2><a class="anchor" name="32059d99dbb8197bd3ed6395721706b8"></a><!-- doxytag: member="GDALRasterAttributeTable::Clone" ref="32059d99dbb8197bd3ed6395721706b8" args="() const" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classGDALRasterAttributeTable.html">GDALRasterAttributeTable</a> * GDALRasterAttributeTable::Clone </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table></div><div class="memdoc"><p>Copy Raster Attribute Table. <p>Creates a new copy of an existing raster attribute table. The new copy becomes the responsibility of the caller to destroy.<p>This method is the same as the C function GDALRATClone().<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>new copy of the RAT. </dd></dl></div></div><p><a class="anchor" name="bda5604f899f1eb0dbe83b30bd4eb8ef"></a><!-- doxytag: member="GDALRasterAttributeTable::GetColumnCount" ref="bda5604f899f1eb0dbe83b30bd4eb8ef" args="() const" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int GDALRasterAttributeTable::GetColumnCount </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table></div><div class="memdoc"><p>Fetch table column count. <p>This method is the same as the C function GDALRATGetColumnCount().<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>the number of columns. </dd></dl></div></div><p><a class="anchor" name="533ed0e87ba61d1c3d662c5fd1ee01e8"></a><!-- doxytag: member="GDALRasterAttributeTable::GetNameOfCol" ref="533ed0e87ba61d1c3d662c5fd1ee01e8" args="(int) const " --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">const char * GDALRasterAttributeTable::GetNameOfCol </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>iCol</em> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table></div><div class="memdoc"><p>Fetch name of indicated column. <p>This method is the same as the C function GDALRATGetNameOfCol(), except that the C function returns "const char *".<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>iCol</em> </td><td>the column index (zero based).</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the column name or an empty string for invalid column numbers. </dd></dl></div></div><p><a class="anchor" name="53f36667aa01059844d980914e3ea09d"></a><!-- doxytag: member="GDALRasterAttributeTable::GetUsageOfCol" ref="53f36667aa01059844d980914e3ea09d" args="(int) const " --><div class="memitem"><div class="memproto"> <table class="memname"> <tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -