# Import system modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Check out any necessary licenses
gp.CheckOutExtension("spatial")
# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
# Script arguments...
outRaster = sys.argv[1]
donut = sys.argv[2]
lc = sys.argv[3]
InExpression = "CON(ISNULL(%s), %s, %s * -1)"%(sys.argv[2],sys.argv[3],sys.argv[3])
# Check out Spatial Analyst extension license
gp.CheckOutExtension("Spatial")
# Process: MapAlgebra
gp.SingleOutputMapAlgebra_sa(InExpression, outRaster)
|