Answers:
不是直接的,但是您可以使用python和arcpy.mapping模块执行此操作。使用arcpy.mapping.ListBookmarks获取每个书签的范围。然后为每个范围创建特征。现在,您将可以使用此要素类作为“数据驱动页面”的索引层。
您似乎并不孤单地希望将其作为现成的功能使用。我建议至少将三个ArcGIS Ideas添加到以下名称:
同时,如果有人被启发编写“将书签标记为要素类”工具,那么我相信它的输出将很好地用作数据驱动页面的索引要素类。
最后,我作为培训活动最终基于一些示例代码(ArcGIS Online帮助中的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
我们可以通过保存了书签,创建要素类的.dat文件,然后加载该文件到我的位置的工具,那么我的位置对话框中选中它们,然后点击加入按钮,并选择地图为图形一旦您有一个图形,然后选择地图中的所有图形,并使用将图形转换为要素,然后可以将要素类用于数据驱动页面。注意:图形以多边形的形式出现。所有功劳归塞内卡·弗朗西斯(Seneca Francis)所有。