Delete Raster Attribute Table (Data Management)

Summary

Removes the raster attribute table associated with a raster dataset. Since raster attribute tables can only be built on single-band raster datasets, this tool is only valid for raster datasets with a single band.

Usage

Syntax

DeleteRasterAttributeTable_management (in_raster)
ParameterExplanationData Type
in_raster

The raster dataset containing the raster attribute table to be removed. The raster dataset must be a single-band raster dataset.

Raster layer

Code Sample

DeleteRasterAttributeTable Example (Python Window)

This is a Python sample for the DeleteRasterAttributeTable tool.

import arcpy
arcpy.DeleteRasterAttributeTable_management("c:/data/delrat.tif")
DeleteRasterAttributeTable Example 2 (Stand-alone script)

This is a Python script sample for the DeleteRasterAttributeTable tool.

##====================================
##Delete Raster Attribute Table
##Usage: DeleteRasterAttributeTable_management in_raster
    
try:
    import arcpy
    arcpy.env.workspace = r"C:/Workspace"
    
    ##Delete the attribute table of single band image if exist
    arcpy.DeleteRasterAttributeTable_management("image.tif")

except:
    print "Delete Raster Attribute Table example failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

10/27/2014