fc = 'polygon.shp' arcpy.CreateFeatureclass_management(out_path=outpath,out_name=fc,geometry_type='POLYGON') cursor =arcpy.da.InsertCursor(fc,['SHAPE@']) array = arcpy.Array() point = arcpy.Point() for line in fileinput.input(infile): point.ID,point.X,point.Y = line.split(' ') array.append(point) polygon = arcpy.Polygon(array) cursor.insertRow([polygon]) fileinput.close() del cursor
参考1:https://blog.csdn.net/weixin_38415513/article/details/104827484(arcpy处理几何图形)