Creating multi-part polygon with ArcPy?

المشرف العام

Administrator
طاقم الإدارة
I got a problem to create a multipart polygon, the code is like this:

infile="result.txt"arcpy.CreateFeatureclass_management(base,"test","POLYGON","#","DISABLED","DISABLED","#","#","0","0","0")fc="test.shp"In_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.add(point)polygon=arcpy.Polygon(array)In_cursor.insertRow([polygon])fileinput.close()del In_cursorbut the polygon come to a single one, not separated. Inside the result.txt is like this(an example):

ID X Y1 -52000.0 -62400.01 -52000.0 -63000.01 -52800.0 -63000.01 -52800.0 -62400.02 -48000.0 -60000.02 -48000.0 -60600.02 -48800.0 -60600.02 -48800.0 -60000.0The image of my problem just like the pic shown in below,

How should i revise my python program?



أكثر...
 
أعلى