I’m building a code in Python to export in geotiff my imagery.
I need specific spots so I created a Data Driven Pages with polygons.
Everything works fine, except that my imagery layer takes a long time to be completely draw, and the output of my script shows just small parts of what I want. Please, see image below:
So, what I need is a way to insert time.sleep in my python script to wait until imagery layer is completely loaded.
This is my script:
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
ar = df.extent.height / df.extent.width
for page_number in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = page_number
print "Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount))
arcpy.mapping.ExportToTIFF(mxd, r"C:UsersIstusDocumentsXXXXXXXXImagerymapasGEOTIFFmap_" + str(page_number) + ".tiff", df, 9306,9306*ar, resolution=300, geoTIFF_tags=True)
del mxd
I’m using ArcMap 10.1 and Python 2.7.2.