資源簡介
利用Python創建ArcGis批量輸出地圖影工具,實現地圖批量輸出JPEG

代碼片段和文件信息
import?arcpy
from?arcpy?import?env
import?os
import?sys
reload(sys)
sys.setdefaultencoding(?“utf-8“?)
in_file?=?arcpy.GetParameterAsText(0)
Map_document?=?[]
for?rootdirsfiles?in?os.walk(in_file):
????
????for?afile?in?files:
????????
????????if?afile[-4:].lower()?==?‘.mxd‘:
????????????
???????????a?=?root?+?os.sep?+?afile
??????????
???????????Map_document.append(a)
for?map_document?in?Map_document:
????my_document?=?arcpy.mapping.MapDocument(map_document)
????
????out_jpeg?=?map_document.replace(‘.mxd‘‘.jpg‘)
????arcpy.mapping.ExportToJPEG(my_documentout_jpeg)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????612??2017-11-24?22:11??批量輸出地圖\批量輸出地圖.py
?????文件????????6144??2017-11-24?22:31??批量輸出地圖\批量輸出地圖.tbx
?????目錄???????????0??2017-11-24?22:30??批量輸出地圖\
評論
共有 條評論