以下は、ポリラインとポリゴンで機能するはずです。
import arcpy
infc = r"D:\Projects\GDBs\slowbutter.gdb\fc"
desc = arcpy.Describe(infc)
shapefieldname = desc.ShapeFieldName
rows = arcpy.SearchCursor(infc)
for row in rows:
# Create the geometry object
feat = row.getValue(shapefieldname)
print "Feature %i: " % row.getValue(desc.OIDFieldName)
partnum = 0
# Step through each part of the feature
for part in feat:
print "Part %i: " % partnum
part_list = []
for pnt in feat.getPart(partnum):
if pnt:
# Add to list
part_list.append([pnt.X, pnt.Y])
else:
# If pnt is None, this represents an interior ring
print "Interior Ring:"
partnum += 1
print part_list
いくつかの英国の道路データについては、これを取得します。ポリラインを構成する各頂点のX、Yペアのネストされたリスト:
Feature 7:
Part 0:
[[-0.48053999999996222, 51.482510000000048], [-0.48032999999992398,
51.482609000000082], [-0.48026999999996178, 51.48273800000004],
[-0.48043999999993048, 51.482891000000052], [-0.48065999999994347, 51.482948000000079],
[-0.48123999999995704, 51.483009000000038]]