Label | Explanation | Data Type |
Overwrite (Optional) | Specifies whether the existing table will be overwritten.
| Boolean |
Derived Output
Label | Explanation | Data Type |
Updated Input Raster | The output raster dataset. | Raster Layer |
Adds a raster attribute table to a raster dataset or updates an existing one. This is used primarily with discrete data.
To delete an existing table and create a new one, check the Overwrite parameter. A new raster attribute table will be created, and the existing one will be deleted.
If you have an existing table and you do not check the Overwrite parameter, the table will be updated. No fields will be deleted, but the values in the table will be updated.
You cannot build a raster attribute table for a raster dataset that is a pixel type of 32-bit floating point.
Label | Explanation | Data Type |
Overwrite (Optional) | Specifies whether the existing table will be overwritten.
| Boolean |
Label | Explanation | Data Type |
Updated Input Raster | The output raster dataset. | Raster Layer |
arcpy.management.BuildRasterAttributeTable({overwrite})
Name | Explanation | Data Type |
overwrite (Optional) | Specifies whether the existing table will be overwritten.
| Boolean |
Name | Explanation | Data Type |
out_raster | The output raster dataset. | Raster Layer |
This is a Python sample for the BuildRasterAttributeTable function.
import arcpy
arcpy.BuildRasterAttributeTable_management("c:/data/image.tif", "Overwrite")
This is a Python script sample for the BuildRasterAttributeTable function.
##====================================
##Build Raster Attribute Table
##Usage: BuildRasterAttributeTable_management in_raster {NONE | Overwrite}
import arcpy
arcpy.env.workspace = "C:/Workspace"
##Build attribute table for single band raster dataset
##Overwrite the existing attribute table file
arcpy.BuildRasterAttributeTable_management("image.tif", "Overwrite")