I ́m currently working in this project where we are creating a time wise analysis of a certain region with many areas of interest.
We are using the data driven pages tool to address the many AOIs but we are still missing the automation part of exporting each different map (each map is from a different date).
asked Aug 6, 2015 at 2:20
-
2Can you include a screen capture of the layer table to aid your question?artwork21– artwork212015年08月06日 02:56:15 +00:00Commented Aug 6, 2015 at 2:56
-
Here the Table of Contents: imgur.com/5pqxuRWJulio A. López– Julio A. López2015年08月06日 17:57:56 +00:00Commented Aug 6, 2015 at 17:57
-
1You will have to use arcpy/python to iterate through the ddp, associate the ddp page name to the image name loaded in the map, if ddp name == image name then turn on the image, and finally export the page. You can try this out in python and post another question if you get stumped.artwork21– artwork212015年08月06日 21:24:05 +00:00Commented Aug 6, 2015 at 21:24
-
Do you know any example that I could start with. Kind of a newbie here. Thanks a lot!Julio A. López– Julio A. López2015年08月06日 23:28:36 +00:00Commented Aug 6, 2015 at 23:28
1 Answer 1
I just did this. Here is my code:
import arcpy
import os
for dirpath, dirnames, filenames in os.walk(u'R:\Projects\ERI\MXDs\DataDriven'): #Walks through folder containing many different Data Driven MXDs
for filename in filenames:
print filename
basePath = "R:\Projects\ERI\MXDs\DataDriven"
mxd = basePath + "\\" + filename
field_name = "SSN"
mxdFile = arcpy.mapping.MapDocument(mxd)
for i in range(1, mxdFile.dataDrivenPages.pageCount + 1):
mxdFile.dataDrivenPages.currentPageID = i
row = mxdFile.dataDrivenPages.pageRow
outpath = filename.replace(".mxd", "_" + row.getValue(field_name) + ".pdf") #Saves the file based on an attribute within the index layer.
arcpy.mapping.ExportToPDF(mxdFile,r"R:\Projects\ERI\DataDriven_March2016\IndividualPDFs" + "\\" + outpath)
Explore related questions
See similar questions with these tags.