# Name: Con_Ex_02.py
# Description: Performs a conditional if/else evaluation
#              on each cell of an input raster.
# Requirements: Spatial Analyst Extension
# Author: ESRI

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "F:/temp/data/9/dem3d/"

# Set local variables
inRaster = "tingrid"
inTrueRaster = "1"
inFalseConstant = 0
whereClause = "VALUE >= 2000"

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

# Execute Con
outCon = Con(inRaster, inTrueRaster, inFalseConstant, whereClause)

# Save the output
outCon.save("F:/temp/data/9/dem3d/yl.img")

相关文章:

  • 2022-12-23
  • 2021-09-04
  • 2021-10-16
  • 2022-12-23
  • 2021-11-03
  • 2021-05-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-15
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-08-13
相关资源
相似解决方案