Reclassify

Reclassifies (or changes) the values in a raster.


Usage tips

Command line and Scripting

Syntax

Reclassify_sa (in_raster, reclass_field, remap, out_raster, missing_values)
Parameter Explanation Datatype
Input raster (Required)

Input raster to be reclassified.

Composite Geodataset
Reclass field (Required)

Field denoting the values that will be reclassified.

Field
Reclassification (Required)

A remap list that defines how the values will be reclassified.

The remap list is composed of three components: From, To, and New values. Each row in the remap list is separated by a semicolon, and the three components are separated by spaces. For example, "0 5 1;5.01 7.5 2;7.5 10 3".

Remap
Output raster (Required)

The raster to be created.

Raster Dataset
Change missing values to NoData (Optional)

Denotes whether missing values in the reclass table retain their value or get mapped to NoData.

  • DATA — A keyword signifying that if any cell location on the input raster contains a value that is not present or reclassed in a remap table, the value should remain intact and be written for that location to the output raster.

  • NODATA — A keyword signifying that if any cell location on the input raster contains a value that is not present or reclassed in a remap table, the value will be reclassed to NoData for that location on the output raster.

Boolean
Data types for geoprocessing tool parameters

Script Example

# Reclassify.py
# Description:
#   Reclassifies (or changes) the values in a raster on a 
#   cell-by-cell basis within the analysis window.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set the input files
    inRaster = "c:/data/ras_1"

    # Set the output raster name
    outRaster = "c:/data/final_1"

    # Check out ArcGIS Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Set the reclassify ranges
    reclassifyRanges = "0.000000 30.000000 1;31.000000 270.000000 2;271.000000 365.000000 3"

    # Process: Reclassify
    gp.Reclassify_sa(inRaster, "Value", reclassifyRanges, outRaster, "DATA")

except:
    # If an error occurred while running a tool, then print the messages
    print gp.GetMessages()

Map Algebra syntax

Not available


ArcObjects syntax

See ReclassByRemap


See Also

  • Reclass by ASCII File
  • Reclass by Table
  • Slice
  • Using the ArcGIS Spatial Analyst toolbar to reclassify data
  • An overview of the Reclass tools