Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Reclass (Spatial Analyst)

Lookup

Release 9.2
Last modified January 3, 2008
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Reclass (Spatial Analyst)"


Related Topics

Creates a new raster by looking up values found in another field in the table of the input raster.


Usage tips

Command line syntax
An overview of the Command Line window
Lookup_sa <in_raster> <lookup_field> <out_raster>

Parameter Explanation Data Type
<in_raster>

The input raster that contains a field from which to create a new raster.

Composite Geodataset
<lookup_field>

Field containing the values for the new raster.

Field
<out_raster>

The raster to be created.

Raster Dataset
Data types for geoprocessing tool parameters


Command line example

Lookup_sa c:/data/ras_1 Value c:/data/final_1

Scripting syntax
About getting started with writing geoprocessing scripts
Lookup_sa (in_raster, lookup_field, out_raster)

Parameter Explanation Data Type
in_raster (Required)

The input raster that contains a field from which to create a new raster.

Composite Geodataset
lookup_field (Required)

Field containing the values for the new raster.

Field
out_raster (Required)

The raster to be created.

Raster Dataset

Data types for geoprocessing tool parameters


Script example

# Lookup_sample.py
# Description: 
#   Creates a new raster by looking up values found in another 
#   field in the table of the input raster.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

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

try:
    # Set the input raster name
    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")

    # Process: Reclass Lookup
   gp.Lookup_sa(inRaster, "Value", outRaster)

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

Map Algebra syntax
Not Available

ArcObjects syntax
IReclassOp::Lookup (geoDataset As IGeoDataset, fieldName As String) As IGeoDataset

Parameter Explanation
geoDataset An input Raster, RasterDataset, RasterBand, or RasterDescriptor.
A field from the input raster will be used to give values to the output raster.
fieldName The field that contains the values that will be written to the output raster.

ArcObjects example

'Creates a new raster by looking up values found in
' another field in the table of the input raster.
'
'Function Lookup(ByVal GeoDataset As esriGeoDatabase.IGeoDataset, _
'  ByVal FieldName As String) 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\pras01")

'Create raster dataset
Dim pRasOut As IRaster  
Set pRasOut = pReclassOp.Lookup(pRas01, "pRas01_anotherField")

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.