Tell me more ×
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 trying to create a dynamic map book based on user defined geometry. I can use Grid Index and calculate adjacent tool to create the grids in my Python script. How can I set this newly created grid as Index layer under 'Enable Data Driven Pages'?

 if MultiPages.lower()!='no' :
   ## create Grid based on added geometry (in_buffer)
   Gridlr = "gridlr.shp"
   Gridlrshp = os.path.join(scratch, Gridlr)
   arcpy.GridIndexFeatures_cartography(Gridlrshp, in_buffer, "", "", "", "200 Meters", "200 Meters")
   ## calculate adjacent fields
   arcpy.CalculateAdjacentFields_cartography(Gridlrshp, "PageNumber")

   ## add the new geometry and grid layer to MXD by replacing the datasources

   ##print the pdf
   outputLayoutPDFMM = os.path.join(scratch, 'multipage.pdf')
   ddMMDDP.exportToPDF(outputLayoutPDFMM, "ALL")
share|improve this question
1  
It would be helpful if you gave us some more information. For a start, what software are you talking about? – Kelso Nov 22 '12 at 3:15
I am using ArcGIS Desktop and arcpy – user8732 Nov 22 '12 at 16:14
What you can do is this. Set up a template .mxd with a dummy layer as the index layer, then change the data source to your new grid features later on and run the data driven pages output. – MLowry Nov 28 '12 at 19:40
actually, I did that but had no luck. When I printed map- it gave me the original dummy layer- I will check it again. had been busy in some other deadlines. – user8732 Dec 4 '12 at 15:46

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.