我这边是直接采用python来做的,话不多说 直接上代码:
sourcePath = “D:/tileTest/dataFile/mine.sde/hb_county”
outPutDir = “D:/tileTest/dataFile”
templetMxd = “D:/tileTest/dataFile/templet.mxd”
if not os.path.exists(outPutDir): os.makedirs(outPutDir)
mxd = arcpy.mapping.MapDocument(templetMxd)
df = arcpy.mapping.ListDataFrames(mxd, “Layers”)[0]
rasterLayer = “tempLry”
imagepath = unicode(sourcePath.decode(“gbk”))
arcpy.MakeFeatureLayer_management (imagepath,rasterLayer,"","","")
addLayer = arcpy.mapping.Layer(rasterLayer)
arcpy.mapping.AddLayer(df, addLayer, “BOTTOM”)
outPath = outPutDir+"\"+rasterLayer+".mxd"
mxd.saveACopy(outPath)