I need to export a series of maps along a predefined grid across a state. I'm trying to automate the process with arcpy. Right now I manually choose to export a TIFF file at 500 dpi resolution, 8-bit palette, no compression, and background color set to
“no color”. The built in
arcpy.mapping.ExportToTIFF code does not support
“no color" as a background option.
I'm trying to use
arcpy.mapping.ExportToPNG but I can't seem to get the arguments right. I think the problem is with my data frame, df_export_width, or df_export_height arguments. I tried to set up a code following this example, but the code to generate height and width always came back as 0, and didn't work.
My code is below, set up for the state of Colorado. I'm using ArcGIS 10.3.1. Any thoughts?
Import arcpy #build list of all gridsquares grid=list(range(64)) del grid #load predefined grid for Colorado CO_net="C:\Data\CO.GDB\CO_net" resolution=500 for g in grid: select="OID="+str(g) arcpy.SelectLayerByAttribute_management("CO_net","NEW_SELECTION",select) mxd = arcpy.mapping.MapDocument('CURRENT') export= "C:\Data\CO"+str(g)+".png" df = arcpy.mapping.ListDataFrames(mxd, "Layers")  df.zoomToSelectedFeatures() df.scale=250000 arcpy.RefreshActiveView() arcpy.mapping.ExportToPNG(mxd,export,df,,,resolution,"TRUE","8-BIT_PALETTE","255, 255, 255","255, 255, 255")