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.

We have this large project in ArcGIS with 30 maps with different extents using Bookmarks to pan between these maps/pages.

Now we would like to use Data driven pages instead. The question is, is it possible to convert bookmarks to data driven pages or do we have to create a lot of polygons covering each map extent?

share|improve this question

3 Answers 3

Not directly, but you can do this with python and the arcpy.mapping module. Use arcpy.mapping.ListBookmarks to get the extent of each bookmark. Then create features for each extent. You will now be able to use this feature class as the index layer for Data Driven Pages.

share|improve this answer
    
Just for clarity, ListBookmarks is a new function in ArcGIS 10.1 –  RyanDalton Sep 11 '12 at 23:18
    
OK, still on 10.0 here... I guess we'll update soon. Also I don't know Python that well at all. –  Oskar Karlin Sep 20 '12 at 19:56
    
If you are still on 10.0 and are familiar with ArcObjects and Python - you can access the bookmarks using ArcObjects imported with comtypes. pierssen.com/arcgis/upload/misc/python_arcobjects.pdf –  dklassen Oct 22 '13 at 23:05

You seem to be far from alone in wanting this as Out-Of-The-Box functionality. There are at least three ArcGIS Ideas that I would recommend you add your name to:

In the meantime if someone is inspired to write a BookMarks To Feature Class tool, then I am sure its output would be well used as an Index Feature Class for Data Driven Pages.

I ended up doing this as a Training exercise based heavily on some Sample Code the ArcGIS Online Help for ListBookmarks (arcpy.mapping).

import arcpy

# The map with the bookmarks
mxd = arcpy.mapping.MapDocument(r"C:\polygeo\Maps\Bookmarks.mxd")

# Make sure that Training.gdb exists
fileGDBFolder = (r"C:\polygeo")
fileGDBName = ("Training.gdb")
fileGDB = fileGDBFolder + "\\" + fileGDBName
if not arcpy.Exists(fileGDB):
    arcpy.CreateFileGDB_management(fileGDBFolder, fileGDBName)

# The output feature class to be created -
# This feature class will store the bookmarks as features
fcName = "Bookmarks"
outFC = fileGDB + "\\" + fcName

# Create new feature class and add a "Name" field to store the
# bookmark name.  Provide it with the same Spatial reference as
# the data frame in which the bookmarks of the map are stored

if arcpy.Exists(outFC):
    arcpy.Delete_management(outFC)   
arcpy.CreateFeatureclass_management(fileGDB,
                                    fcName, 
                                    "POLYGON", 
                                    spatial_reference=arcpy.SpatialReference(
                                        "Geocentric Datum of Australia 1994"))
arcpy.AddField_management(outFC, "Name", "TEXT", "", "", 50)

# Use arcpy.mapping.ListBookmarks to read bookmark corners and names,
# then arcpy.da.InsertCursor to write arrays of Point geometries from
# that can be written as Polygon geometries to the Shape field of the
# new feature class (with their names).
cur = arcpy.da.InsertCursor(outFC, ["SHAPE@", "Name"])
array = arcpy.Array()
for bkmk in arcpy.mapping.ListBookmarks(mxd):
    array.add(arcpy.Point(bkmk.extent.XMin, bkmk.extent.YMin))
    array.add(arcpy.Point(bkmk.extent.XMin, bkmk.extent.YMax))
    array.add(arcpy.Point(bkmk.extent.XMax, bkmk.extent.YMax))
    array.add(arcpy.Point(bkmk.extent.XMax, bkmk.extent.YMin))
    # To close the polygon, add the first point again
    array.add(arcpy.Point(bkmk.extent.XMin, bkmk.extent.YMin))
    cur.insertRow([arcpy.Polygon(array), bkmk.name])
    array.removeAll()
del bkmk,array,cur,mxd

print "Bookmarks feature class has been created in " + fileGDB
share|improve this answer

ListBookmarks is broken at version 10.2.1. ESRI opened a case today:

[#NIM099667 ListBookmarks (arcpy.mapping) example 3 (like PolyGeo's answer) from the Help Documentation does not work correctly & creates an empty output at version ArcMap 10.2.1. ]

share|improve this answer

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.