Lookup |
|
Release 9.2
Last modified January 3, 2008 |
Print all topics in : "Reclass (Spatial Analyst)" |
Creates a new raster by looking up values found in another field in the table of the input raster.
Usage tips
Command line and Scripting
If the lookup field is a numeric type, the values of that field will be written to the output raster attribute table as Value. Other items in the input raster attribute table will not be transferred to the output raster attribute table.
For example, an attribute table of input raster with numeric field Attr1:
Value Count Attr1 1 294 1 2 345 8 3 654 3
Output attribute table from Lookup on Attr1 field:
Value Count 1 294 3 654 8 345
If the lookup field is a character type, the lookup field will appear in the output raster attribute table, and the value field will be the same as for input raster. Any other items in the input raster's attribute table will not be transferred to the output raster's attribute table.
For example, an attribute table of input raster with character field Text1:
Value Count Attr1 Text1 1 294 1 A 2 6218 8 B 3 28 3 4 3603 9 3
Output attribute table from Lookup on Text1 field:
Value Count Text1 1 294 A 2 6218 B 3 28 4 3603 3
The following environment settings affect this tool:
ArcObjects
If the fieldName is a numeric type, the values of that field will be written to the output raster attribute table as Value. Other items in the input raster's attribute table will not be transferred to the output raster's attribute table.
For example, an attribute table of input raster attr_ras:
Value Count Attr1 1 294 1 2 345 8 3 654 3
Output attribute table from Lookup on Attr1 field:
Value Count 1 294 3 654 8 345
If the lookup field name is a character type, fieldName will appear in the output raster attribute table, and the value field will be the same as for input raster. Any other items in the input raster's attribute table will not be transferred to the output raster's attribute table.
For example, an attribute table of input raster with character field Text1:
Value Count Attr1 Text1 1 294 1 A 2 6218 8 B 3 28 3 4 3603 9 3
Output attribute table from Lookup on Text1 field:
Value Count Text1 1 294 A 2 6218 B 3 28 4 3603 3
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 |
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 |
# 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. |
'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")