||
# Name: Con_Ex_02.py
# Requirements: Spatial Analyst Extension
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")
####################################################
##我勒个擦,因为这个check,折腾了我大半天,真恶心
####################################################
# Set environment settings
env.workspace = "H:/"
# Set local variables
a="2015sum.tif"
inRaster = Raster(a)
# Execute Con using a map algebra expression instead of a where clause
outCon = Con(IsNull(inRaster),0,inRaster)
# Save the outputs
outCon.save("H:/t2t.tif")
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-27 08:05
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社