import arcpy mxd = arcpy.mapping.MapDocument(r"C:\Project\NameOfMXD.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Dataframe Name")[0] for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1): mxd.dataDrivenPages.currentPageID = pageNum print "Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount)) arcpy.mapping.ExportToTiff(mxd, r"C:\Project\OutPut\Page" + str(pageNum) + ".tif", df) del mxd
I'm not knowledgeable enough about arcpy to do that, and fortunately didn't need to be either. Here's a clumsy way you might get what you are looking for.The key additions that Drewsky made in the code involved the "ar". In his code these two lines were the key to producing a properly geoereferenced tif that wasn't skewed since it got the actual pixels being used:ar = df.extent.height / df.extent.widtharcpy.mapping.ExportToTIFF(mxd,r"C:\ImageTemp\" + str(pageNum) + ".tif",df,1024,1024*ar,48,True) I typically use 9036,9036*ar in my code and this produces pdfs that are 9036 x a number that depends on my window size. (Right click on the tif in Windows Explorer - Properties - Details.) If you run your code and look at a resulting tif you will see this second number. In a batch I'm currently running it is 10339 in all the tifs. If I didn't change the window size I could depend on that.
The easiest solution is to create a page layout the size of the desired data frame and export the layout, not the data frame. See response to related post.http://forums.arcgis.com/threads/93836-ExportToTif-width-height-calculationJeff
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.