Howto: 使用Python脚本来拷贝数据

文章编号: 209
软件: ArcInfo Desktop 9.1,ArcEditor 9.1,ArcView 9.1
操作系统: PC-Intel Windows2000
已邀请:

易智瑞技术支持

赞同来自:

摘要: 使用Python脚本把shapeFile数据拷到MDB的PGDB中。
内容:
#引入类库
import win32com.client, os.path
#创建对象
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")
#设置路径
inFC = gp.GetParameterAsText(0) ##"E:\UsingPython\USA\STATES.shp"
outFC =gp.GetParameterAsText(1) ## "E:\UsingPython\SanDiego.mdb\STATES"
expression = ""
fieldInfo = ""
dscFC = gp.Describe(inFC)
#创建图层
gp.CreateFeatureClass_management(os.path.dirname(outFC), os.path.basename(outFC),
dscFC.ShapeType, inFC, "", "", inFC)
gp.MakeFeatureLayer_management(inFC, os.path.basename(outFC), expression,
os.path.dirname(outFC), fieldInfo)
#追加要素
gp.Append_management(os.path.basename(outFC), outFC)




创建时间:2006-01-07
最近更新:2006-01-07


原文链接
http://support.esrichina.com.cn/2006/0107/209.html

要回复问题请先登录注册