Request: Have Data Driven Pages actually produce a thematic map book.
As discussed in the Esri Desktop help:
From the Ersi ArcGIS Help 10.2, 10.2.1, and 10.2.2
Thematic map book
A thematic map book is similar to a reference series, except that the detail pages show unique thematic maps of a single location.
The ability to display different unique themes (layers) covering a single location would be invaluable to display the results of a multi phase analysis. I have many clients that are tired of making a separate mxd for each theme.
Following is the clever solution supplied by Esri Support for my initial specific request:
import arcpy, os
mxd = arcpy.mapping.MapDocument(r"C; file location ")
mxdDDP = mxd.dataDrivenPages
for i in arcpy.mapping.ListLayers(mxd):
if i in ["geology_geochem","glaciation","Precipitation Regime","geology_sed"]:
i.visible = False
arcpy.RefreshActiveView()
for i in range(mxdDDP.pageCount + 1):
mxdDDP.currentPageID = i
name = mxdDDP.pageRow.getValue(mxdDDP.pageNameField.name)
print name
if name == 'GEO':
for i in arcpy.mapping.ListLayers(mxd):
if i.name == "geology_geochem":
i.visible = True
arcpy.RefreshActiveView()
mxdDDP.exportToPDF(r"C:\temp\GEO.pdf", "CURRENT")
i.visible = False
arcpy.RefreshActiveView()
if name == 'GEO_sed':
for i in arcpy.mapping.ListLayers(mxd):
if i.name == "geology_sed":
i.visible = True
arcpy.RefreshActiveView()
mxdDDP.exportToPDF(r"C:\temp\GEO_sed.pdf", "CURRENT")
i.visible = False
arcpy.RefreshActiveView()
if name == 'GLA':
for i in arcpy.mapping.ListLayers(mxd):
if i.name == "glaciation":
i.visible = True
arcpy.RefreshActiveView()
mxdDDP.exportToPDF(r"C:\temp\GLA.pdf", "CURRENT")
i.visible = False
arcpy.RefreshActiveView()
if name == 'PRE':
for i in arcpy.mapping.ListLayers(mxd):
if i.name == "Precipitation Regime":
i.visible = True
arcpy.RefreshActiveView()
mxdDDP.exportToPDF(r"C:\temp\PRE.pdf", "CURRENT")
i.visible = False
arcpy.RefreshActiveView()
This solution is just a go-by as my actual need is to display 40 different themes over the same extent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.