10

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.

Is it possible to convert bookmarks to data driven pages or do we have to create a lot of polygons covering each map extent?

3 Answers 3

8

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.

0
4

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

I should be noted that ArcGIS Pro (also part of ArcGIS Desktop) has Map Series which can be generated direct from Bookmarks. For more details see Introduction to a bookmark map series.

0
3

We were able to create a feature class by saving out the bookmarks as a .dat file then load that file into the My Places tool, then select them within the My Places dialog box, then click the Add To button and chose Map As Graphic Once you have a graphic then select all graphics within the map and use the Convert Graphics to Features then you can use the Feature Class for Data Driven Pages. Note: the Graphics came through as polygons. All credit goes to Seneca Francis.

Your Answer

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

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