ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Build Raster Attribute Table

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Create or update a table with information about the classes in your raster datasets. This is used primarily with discrete data.

Usage

  • If you want to delete an existing table and create a new one, check Overwrite (set the overwrite parameter to OVERWRITE in Python). A new raster attribute table will be created, and the old one will be deleted.

  • If you have an existing table and you do not check Overwrite, the table will be updated. No fields will be deleted, but the values in the table will be up to date.

  • It is not possible to build a raster attribute table for a raster dataset that is a pixel type of 32-bit floating point.

Syntax

BuildRasterAttributeTable_management (in_raster, {overwrite})
ParameterExplanationData Type
in_raster

Select a single band raster dataset that you want to add a table to. This tool will not run if the pixel type is floating point or double precision.

Raster Layer
overwrite
(Optional)

This allows you to overwrite or append columns and rows to an existing raster attribute table.

  • NONE —Existing raster attribute tables will not be overwritten, and any edits will be appended to the current table. This is the default.
  • OVERWRITE —Delete the existing raster attribute tables and create a new raster attribute table.
Boolean

Code sample

BuildRasterAttributeTable example (Python window)

This is a Python sample for BuildRasterAttributeTable.

import arcpy
arcpy.BuildRasterAttributeTable_management("c:/data/image.tif", "Overwrite")
BuildRasterAttributeTable example 2 (stand-alone script)

This is a Python script sample for BuildRasterAttributeTable.

##====================================
##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")

Environments

  • Current Workspace

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Raster toolset
  • Environment settings for raster data
  • Creating and deleting raster attribute tables with geoprocessing tools
  • Viewing a raster attribute table

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal