基于ArcGIS10.1,别有用处。
import arcpy lyr= file=r"C:\Users\dell\Desktop\dapo.txt" with open(file,'w') as txt: txt.write('Polygon\r\n') with arcpy.da.SearchCursor(lyr,["OID@","SHAPE@"]) as cur: for row in cur: part_num=0 for part in row[1]: txt.write('{} {}\r\n'.format(row[0],part_num)) part_num+=1 point_num=0 for point in part: if point: txt.write('{} {} {} nan nan\r\n'.format(point_num,point.X,point.Y)) point_num+=1 else: txt.write('InteriorRing\r\n') txt.write('END\r\n')
标签:point,write,num,Samples,part,txt,ArcPy,row From: https://www.cnblogs.com/yzhyingcool/p/17219472.html