Lookup

Mit der Image Analyst-Lizenz verfügbar.

Zusammenfassung

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

Diskussion

For more information about how this function works, see the Lookup raster function.

The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.

Syntax

Lookup (raster, {field})
ParameterErläuterungDatentyp
raster

The input raster that contains a field from which to create a raster. It can be either integer or floating-point type.

Raster
field

Field containing the desired values for the new raster.

String
Rückgabewert
DatentypErläuterung
Raster

The output raster.

Codebeispiel

Lookup example 1

This example creates a raster by looking up values found in another field in the table of the input raster.

from arcpy.ia import *
out_lookup_raster = Lookup("itemgrd", "bin")
out_lookup_raster.save("C:/arcpyExamples/outputs/output.tif")
Lookup example 2

This example creates a raster by looking up values found in another field in the table of the input raster.

# Import system modules
import arcpy
from arcpy.ia import *

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("ImageAnalyst")

# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"

# Set the local variables
in_raster = "itemgrd"
in_field = "String"

# Execute Lookup function
out_lookup_raster = Lookup(in_raster, in_field)

# Save the output
out_lookup_raster.save("C:/arcpyExamples/outputs/output.tif")