1

I'm working on a project that involves 20+ map figures.

We currently are working with a .mxd in which we are using as a template for these figures.

It's most likely that our client will want some global edits made that will need to be reflected in the template (i.e. street layer color changed, or removed element).

Is there an easier way (other than to make 20+ individual global changes to each figure) to have template changes reflected in all of our figures?

  • When it the same area shown on multiple maps, I use data driven pages, that are the same (rectangles?) in terms of geometry. Map title and other things are stored in relevant fields of the pages layer. I also group layers by pages in table of content. I have a small script that hide/unhide groups by looking at group names and export all maps to pdf. No drama when asked to change e.g. status from DRAFT to FINAL – FelixIP Dec 7 '16 at 21:01
  • Thanks for the reply. It looks like data driven pages are good for showing the same data over varying geographic areas. What I'm looking for is showing different data/layers on the same extent. We are showing a project area, then having separate elements show on that project area for each figure (one figure for geology of the project area, one figure for the biological resources in the project area, etc). – brandonn Dec 7 '16 at 21:46
  • This IS 100% match of what I said in my comments – FelixIP Dec 7 '16 at 21:47
  • @FelixIP If you say your first comment in an answer then I think it would be enough. – PolyGeo Jan 11 '17 at 7:06
1

When it is the same area to be shown on multiple maps, I use data driven pages, that are identical (rectangles?) in terms of geometry. Map title and other things are stored in relevant fields of the pages layer.

The script hides/unhides groups by looking at group names. Thus there is no drama when asked to change tiny things common to set of maps, e.g. status from DRAFT to FINAL on any number of maps.

To make script work:

  • group layers by pages in the table of content. Group naming convention: PAGE_01 Geology, PAGE_02_Topography, PAGE_03 Any Thing etc.
  • Place vector layers common for all maps (if any) on the top of your table of content.
  • Place raster layers common for all maps (aerial imagery) at the bottom of your table of content.
  • Use option in legend to show visible layers only

Script has 1 parameter - output folder, where maps PAGE_01.pdf, PAGE_02.pdf etc will be saved.

Caution: after export of all maps, close active ArcMap with mxd and open again, if you want to do some changes and re-print maps. By some reason unknown to me (perhaps PC configuration), script might stuck on 2nd export at 1st page.

# EXPORTS MAPS BY SWITCHING GROUPS VISIBILITY ON/OFF
import arcpy, traceback, os, sys, time
outFolder=arcpy.GetParameterAsText(0)
# JUST IN CASE
from arcpy import env
env.overwriteOutput = True
env.workspace = outFolder
## ERROR HANDLING
def showPyMessage():
    arcpy.AddMessage(str(time.ctime()) + " - " + message)
try:
    mxd = arcpy.mapping.MapDocument("CURRENT")
    df = arcpy.mapping.ListDataFrames(mxd)[0]
    allLayers=arcpy.mapping.ListLayers(mxd,"PAGE*")
    groupLayers=[]
    for m in allLayers:
        if m.isGroupLayer: groupLayers.append(m)
#   SHUFFLE THROUGH PAGES
    ddp = mxd.dataDrivenPages
    thePagesLayer = arcpy.mapping.ListLayers(mxd,ddp.indexLayer.name)[0]
    for pageID in range(1, ddp.pageCount+1):
        ddp.currentPageID = pageID
        code='PAGE_%s' %str(pageID).zfill(2)
        for group in groupLayers:
            group.visible=(code in group.name)
        fName='%s%s%s.pdf' %(outFolder,os.sep,code)
        arcpy.RefreshActiveView()
        time.sleep(3)
        ddp.exportToPDF(fName,"CURRENT",resolution=144)
        arcpy.AddMessage('%s exported '%fName)
except:
    message = "\n*** PYTHON ERRORS *** "; showPyMessage()
    message = "Python Traceback Info: " + traceback.format_tb(sys.exc_info()[2])[0]; showPyMessage()
    message = "Python Error Info: " +  str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"; showPyMessage()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.