[GIS] Using ArcGIS model to batch export set of layout view as JPEGs

.jpgarcgis-10.0arcgis-desktoparcpydata-driven-pages

I have a large number of layout views I would like to export as JPEG maps using ArcMap 10.0. The layout view is based upon a user defined grid. Normally what I would do is manually select a grid, zoom to the selected grid and export the layout as a JPEG. But in this case there are over 1000 to do.

Is it possible to write an ArcMap model that will allow me to Select a Grid (table record) and then Zoom to the selected grid and then export the JPEG, which I can run as a batch?

Using ModelBuilder I imagine I would need to add the "Select" tool and then associate that with a "zoom to selected" script. This is the part I fall down at. While I have a script that does this, I cannot associate it with my selected record.

My grid is a polygon feature dataset (either shapefile or gdb) – basically a user defined grid for a layout at a particular scale. I really just need to zoom to each grid, which will have a numeric label 1 – 1000, in a field called ID, then export the layout of that map grid.

Best Answer

I've had to do something very similar using some cobbled together python script:

>>> field_name = "name"
>>> mxd = arcpy.mapping.MapDocument("CURRENT") 
... for i in range(1, mxd.dataDrivenPages.pageCount + 1):
...    mxd.dataDrivenPages.currentPageID = i
...    row = mxd.dataDrivenPages.pageRow
...    print row.getValue(field_name)
...    arcpy.mapping.ExportToJPEG(mxd, r"C:\temp\XXXX" + row.getValue(field_name) + ".jpg", resolution = 400) 
... del mxd

Each jpeg is given the name of the area which DDP iterates through