python代码实现arcgis添加图层要素到当前数据框

python代码实现arcgis添加图层要素到当前数据框,第1张

arcpy.env.workplace =outPath#设置工作空间“outPath为目录”
mxd=arcpy.mapping.MapDocument("current")#设置地图文档为当前文档
df = arcpy.mapping.ListDataFrames(mxd)[0]#获取第一个数据框
insertLayer = arcpy.mapping.Layer(os.path.join(outPath,"Polygon.shp"))#所要添加的图层shp数据
arcpy.mapping.AddLayer(df, insertLayer, "TOP")#添加到数据框顶端
insertLayer = arcpy.mapping.Layer(os.path.join(outPath,"data.gdb/rexytopoint"))#所要添加的图层数据框中数据
arcpy.mapping.AddLayer(df, insertLayer, "TOP")

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/918200.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-16
下一篇2022-05-16

发表评论

登录后才能评论

评论列表(0条)

    保存