Reclass by ASCII File

Reclassifies or changes the values of the input cells of a raster using an ASCII remap file.

Learn more about how Reclass by ASCII File works


Usage tips

Command line and Scripting

ArcObjects

Syntax

ReclassByASCIIFile_sa (in_raster, in_remap_file, out_raster, missing_values)
Parameter Explanation Datatype
Input raster (Required)

An input Raster, RasterDataset, RasterBand, or RasterDescriptor.

Composite Geodataset
Input ASCII remap file (Required)

ASCII remap file defining the single values or ranges to be reclassified and the values they will become.

File
Output raster (Required)

The raster to be created.

Raster Dataset
Change missing values to NoData (Optional)

Denotes whether missing values in the reclass file 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 the remap file, 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 the remap file, the value will be reclassed to NODATA for that location on the output raster.

Boolean
Data types for geoprocessing tool parameters

Script Example

# ReclassByASCIIFile.py
# Description: 
#   Reclassifies (or changes) the value of the input cells of a 
#   raster by using an ASCII remap file.
# 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"
    inASCIIfile = "c:/data/inASCII.txt"

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

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

    # Process: ReclassByASCIIFile
    gp.ReclassByASCIIFile_sa(inRaster, inASCIIfile, outRaster, "DATA")

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

Map Algebra syntax

See Reclass


ArcObjects syntax

IReclassOp::ReclassByASCIIFile (inRaster As IGeoDataset, sRemapFile As String, retainMissingValues As Boolean) As IGeoDataset

Parameter Explanation
inRaster An input Raster, Raster Dataset, or Raster Descriptor. The values contained in this raster will be the values to be reclassified.
sRemapFile An input ASCII file string that constitutes a remap table.
retainMissingValues Defines the manner in which values not present in the remap will be handled. If True, and if any cell location on the input raster contains a value that is not present or reclassed in the remap table, the value should remain intact and be written for that location to the output raster. If False, and if any cell location on the input raster contains a value that is not present or reclassed in the remap table, the value will be reclassed to NoData for that location on the output raster.

ArcObjects example

'Reclassifies (or changes) the values of the input cells of _
'  a raster by using an ASCII remap file.
'
'Function ReclassByASCIIFile(ByVal inRaster As esriGeoDatabase.IGeoDataset, _
'  ByVal sRemapFile As String, ByVal retainMissingValues As Boolean) _
'  As esriGeoDatabase.IGeoDataset
'
'Member of esriGeoAnalyst.IReclassOp

Dim pReclassOp As IReclassOp
Set pReclassOp = New RasterReclassOp

'Get raster dataset
Dim pRas01 As IRaster 
Set pRas01 = readRasterFromDisk("c:\data\myRaster") 

'Create output raster dataset
Dim pRasOut As IRaster
Set pRasOut = pReclassOp.ReclassByASCIIFile(pRas01, "myASCIIfile.txt", True)

See Also

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