arcgis python 获得坐标
# -*- coding: cp936 -*- import arcpy infc = arcpy.GetParameterAsText(0) # Identify the geometry field # desc = arcpy.Describe(infc) shapefieldname = desc.ShapeFieldName # Create search cursor # rows = arcpy.SearchCursor(infc) # Enter for loop for each feature/row # for row in rows: # Create the geometry object # feat = row.getValue(shapefieldname) # Print the current multipoint's ID # arcpy.AddMessage("Feature %i:" % row.getValue(desc.OIDFieldName)) print "Feature %i:" % row.getValue(desc.OIDFieldName) partnum = 0 # Step through each part of the feature # for part in feat: # Print the part number # print "Part %i:" % partnum arcpy.AddMessage("Part %i:" % partnum) # Step through each vertex in the feature # i=0 for pnt in feat.getPart(partnum): if pnt: # Print x,y coordinates of current point # print pnt.X, pnt.Y arcpy.AddMessage("i="+str(i)+",X="+str(pnt.X)+", Y="+str(pnt.Y)) else: # If pnt is None, this represents an interior ring # print "Interior Ring:" arcpy.AddMessage("Interior Ring:") i=i+1 partnum += 1