Anda tampaknya jauh dari sendirian dalam menginginkan ini sebagai fungsionalitas Out-Of-The-Box. Setidaknya ada tiga Ide ArcGIS yang saya sarankan Anda tambahkan nama Anda ke:
Sementara itu jika seseorang terinspirasi untuk menulis alat BookMarks To Feature Class , maka saya yakin hasilnya akan digunakan dengan baik sebagai Kelas Fitur Indeks untuk Halaman Berbasis Data.
Saya akhirnya melakukan ini sebagai latihan Pelatihan banyak didasarkan pada beberapa Kode Sampel Bantuan Online ArcGIS untuk 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