1. 程式人生 > >arcpy插入圖層到mxd中

arcpy插入圖層到mxd中

import arcpy.mapping as mapping
mxd = mapping.MapDocument("CURRENT")
df = mapping.ListDataFrames(mxd, "Crime")[0]
refLayer = mapping.ListLayers(mxd, "Burglaries*", df)[0]
insertLayer = mapping.Layer(r"C:\ArcpyBook\data\CityOfSanAntonio.gdb\Crimes2009")
mapping.InsertLayer(df,refLayer,insertLayer,"BEFORE")