Arcpy常用代码
作者:互联网
1.设置环境变量
# -*- coding: utf-8 -*-:
import arcpy
envfile = r"D:\Work\doing\CNN_RNN\data\beijing\inputdata\ALT.tif"
prjfile = r"D:\Work\doing\CNN_RNN\data\beijing\origindata\boundary.prj"
arcpy.env.overwriteOutput = 1 # 可覆盖
arcpy.env.workspace = r"D:\Work\doing\CNN_RNN\data\processdata" # 设置工作路径
arcpy.env.outputCoordinateSystem = prjfile
arcpy.env.extent = "MAXOF" # 设置范围
# arcpy.env.extent = arcpy.Extent(454871.698900, 4253992.158900, 624251.698900, 4437472.158900) # "XMin, YMin, XMax, YMax"
arcpy.env.extent = envfile
# arcpy.env.cellSize = 30 # 像元大小
arcpy.env.cellSize = envfile
arcpy.env.snapRaster = envfile
标签:extent,常用,env,doing,envfile,代码,Work,Arcpy,arcpy 来源: https://www.cnblogs.com/skypanxh/p/15368437.html