赞
踩
import arcpy
mxd =arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
for pagenum in range(1,mxd.dataDrivenPages.pageCount+1):
mxd.dataDrivenPages.currentPageID = pagenum #设置当前打印的行数
row = mxd.dataDrivenPages.pageRow #获取当前行信息
file_name= row.getValue("FID") #根据字段获取当前行的字段值的信息
file_name = str(file_name)
print(file_name)
arcpy.mapping.ExportToJPEG(mxd,"C:\Users\lining\Desktop\文件夹\\"+file_name.encode('utf-8')+".jpg",df_export_width=300, df_export_height=300,jpeg_quality=30,data_frame=df)
pass
del mxd
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。