Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using DDP pages in a large mapset with pages ranging from 1:7500 to 1:130,000 and the overview map is zoomed out to far to see some of the smaller zones. Is it possible to set the overview map to zoom to say 10 times the current DDP page extent? so a 50k main sheet would have the overview at 500k.

Map overview scale @ 1:3,000,000 - meaningless as it is to full of info. enter image description here

Map overview scale @ 1:500,000 enter image description here

So we can use the cartography-->ddp-->calculate adjacent fields to get the adjoining map sheets but this doesn't seem to help in changing the zoom levels of the map.

Till now my workaround has been to create multiple mxd's which have all the maps in an overview zone that makes sense but this causes issues when making edits to pages etc etc and it would be ideal to automate it into one mxd.

Also is it possible to get DDP to fill in the total number of maps -this should be map 14 of 38 but the 13 is carried over from a previous version as it's hard coded.

---- ONE SOLUTION I also found another workaround at 1am on a Monday morning... in the overview map data frame properties, go to Data Frame tab and choose options as per the screen capture below. enter image description here This seems to work fine as long as the extents don't change to much.

I am keeping this question "unanswered" to see what other options are available.

share|improve this question
    
That was going to be my answer yesterday, but thought I had missed something. –  Simon Apr 16 '12 at 3:18
    
it's ok but not ideal as you don't have to much control on it and ideally it should zoom out some more if town's are not visible. –  GeorgeC Apr 16 '12 at 5:36
add comment

2 Answers

This code may help.

It does not use Data Driven Pages, but more or less emulates their functionality, while enabling you to have the flexibility to use the extent of each feature in your index layer to set the extent of both the Main Map and the Overview, before zooming out the Overview by a factor of 10.

I think DDP is great for creating "no code" map books, but those thus created do not give you anywhere near the control that taking charge of generating each page yourself with ArcPy can.

import arcpy

mxd = arcpy.mapping.MapDocument("C:\\Temp\\test.mxd")
dfMainMap = arcpy.mapping.ListDataFrames(mxd,"Main Map")[0]
dfOverview = arcpy.mapping.ListDataFrames(mxd,"Overview")[0]
indexLayer = arcpy.mapping.ListLayers(mxd, "countries", dfMainMap)[0]
pageFeatures = arcpy.SearchCursor(indexLayer)
count = 1
#Set file name and remove if it already exists
pdfFinal = "C:\\Temp\\AllCountries.pdf"
if arcpy.Exists(pdfFinal):
    arcpy.Delete_management(pdfFinal)

#Create the file and append pages
pdfDoc = arcpy.mapping.PDFDocumentCreate(pdfFinal)

for pageFeature in pageFeatures:
    print pageFeature.CNTRY_NAME
    indexLayer.definitionQuery = "CNTRY_NAME = '" + pageFeature.CNTRY_NAME + "'"
    dfMainMap.extent = indexLayer.getSelectedExtent()
    dfOverview.extent = indexLayer.getSelectedExtent()
    dfOverview.scale = dfOverview.scale * 10
    arcpy.mapping.ExportToPDF(mxd, "C:\\Temp\\Page" + str(count) + ".pdf")
    pdfDoc.appendPages("C:\\Temp\\Page" + str(count) + ".pdf")
    count = count + 1

#Commit changes and delete variable reference
pdfDoc.saveAndClose()
del pdfDoc
del pageFeature,pageFeatures
del mxd
share|improve this answer
    
Thanks. I also found another workaround at 1am on a Monday morning... in the overview map data frame properties, go to Data Frame tab and choose options as per the screen capture I've added to my question. –  GeorgeC Apr 15 '12 at 22:54
    
I find the dfOverview.extent = indexLayer.getSelectedExtent(); dfOverview.scale = dfOverview.scale * 10 part useful for automating setting of display extents a little bigger than a set of features (even w/out DDP). If this is for an interactive session, one can use arcpy.RefreshActiveView() to update once you've changed this data frame property. –  Roland Apr 2 at 22:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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