12

In ArcMap a Map Book is best suited for a series of features that each get their own page. It allows you to pick a feature and generate a Map Book Page for each feature including any additional information you wish to add to each page via dynamic text, charts, etc.

Is there an alternative for say a series of pages showing the EXACT same area but with different layers turned on and off?

We have a Capital Improvements document that I have to create showing the City Boundaries on every page. One page has all police and fire stations listed, another shows proposed water systems, another shows expressways and highways and work being done near or on them... etc., ad nauseum.

Is there some way to set this up so that I DON'T have to created a separate MXD for each Map Page of this document?

2
  • what version of desktop? the tools have changed a bit in each version.
    – Brad Nesom
    Feb 25, 2014 at 20:30
  • ArcGIS for Desktop Advanced 10.2.2 Aug 5, 2014 at 15:58

2 Answers 2

11

I was able to do this when I had them for ArcGIS 9.3 and it works very good. I dont know if this will work with ArcGIS 10.0 or later as it stated on their website but I'd give it a try.

ArcMapBook

Edit:
This can be accomplished by simply creating a rectangular page for each set of layers stacked directly on top of each other. Name each page separately and assign a value to each layer to be shown in the frame.
You also need to assign attribute values to items that only appear on specific pages.
Then use the page definition to restrict objects to page names.
In the layer properties on the definition Query page> page definition.
pagedef

There is an option to enable match/don't match and a field name.
Enabled
There are quite endless possibilities for coding your data to work within the framework.
Also if you have items you want to show on all pages they just don't have that enabled.

2
  • 1
    This still works with 10.1, 10.2
    – Brad Nesom
    Aug 6, 2014 at 23:36
  • Works in ArcMap 10.8 and ArcGIS Pro 2.6 too.
    – user23715
    Jan 30, 2021 at 2:39
4

I think your requirements would be most easily and intuitively met by having a single map with all the layers included and then to write a simple Python script that uses layer.visible to toggle layers on/off before exporting each page using ExportToPDF.

PDFDocument can then be used to append the pages into a single PDF file.

The technique is described in an Esri blog called Combining Data Driven Pages with Python and arcpy.mapping which also includes the code below.

For example, you can create a thematic atlas with multiple pages specifying a different theme on each page. The following example zooms to a selected parcel, toggles on different layer visibility and exports the layout for multiple themes in order to create a parcel report with a soil map, a flood map and a zoning map:

import arcpy, os

#Specify output path and final output PDF
outPath = r”C:MyProjectoutput\”
finalPdf = arcpy.mapping.PDFDocumentCreate(outPath + “ParcelReport.pdf”)

#Specify the map document and the data frame
mxd = arcpy.mapping.MapDocument(r”C:MyProjectMyParcelMap.mxd”)
df = arcpy.mapping.ListDataFrames(mxd, “Layers”)[0]

#Select a parcel using the LocAddress attribute and zoom to selected
parcelLayer = arcpy.mapping.ListLayers(mxd, “Parcels”, df)[0]
arcpy.SelectLayerByAttribute_management(parcelLayer, “NEW_SELECTION”, “”LocAddress” = ’519 Main St’”)
df.zoomToSelectedFeatures()

#Turn on visibility for each theme and export the page
lyrList = ["Soils", "Floodplains", "Zones"]
for lyrName in lyrList:
     lyr = arcpy.mapping.ListLayers(mxd, lyrName, df)[0]
     lyr.visible = True

     #Export each theme to a temporary PDF and append to the final PDF
     tmpPdf = outPath + lyrName + “_temp.pdf”
     if os.path.exists(tmpPdf):
          os.remove(tmpPdf)
     arcpy.mapping.ExportToPDF(mxd, tmpPdf)
     finalPdf.appendPages(tmpPdf)

     #Turn off layer visibility and clean up for next pass through the loop
     lyr.visible = False
     del lyr, tmpPdf
del mxd, df, finalPdf
2
  • Would there be a way to do this for a large number of shapefiles? I've never really used Python, but I assume the lyrList has the layers that will be cycled through. I have 121 different layers, with names like DA_1, DA_2, DA_3 etc. Is there a way to load them without naming them individually? Mar 24, 2018 at 7:02
  • @TheSilentCartographer Your list of laters could be as long as you like. It will need to contain the names of those you wish to create a PDF for. There may be various ways those names get into the list.
    – PolyGeo
    Mar 24, 2018 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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