import arcgisscripting gp = arcgisscripting.create(9.3) fc = "c:/test.mdb/test/Test" rows = gp.SearchCursor(fc) row = rows.Next() RowIdx = 0 while row: feat = row.shape parts = feat.GetPart() part = parts.Next() PartIdx = 0 while part: PointIdx = 0 pointTemp = part.Next() while(pointTemp): pointTemp = part.Next() if(not pointTemp): pointTemp = part.Next() PointIdx = PointIdx + 1 if(pointTemp): print ("Found inner ring:" + fc + " ObjectID: " + str(row.GetValue("ObjectId")) + " RowIdx: " + str(RowIdx) + " PartIdx: " + str(PartIdx) + " PointIdx: " + str(PointIdx) + " Point Count: " + str(part.Count) + " Part Count: " + str(feat.PartCount)) PointIdx = PointIdx + 1 part=parts.Next() PartIdx = PartIdx + 1 row = rows.Next() RowIdx = RowIdx + 1
And even further information...If I start editing, move a vertex of the problem feature, and save, "Part 0" becomes the outer ring, "Part 1" become the inner ring, and my script detects the feature as a polygon having a hole! Now I just need to find a way of making that reordering happen without modifying any vertices. Any ideas?
Line 44 was: arrayOuter.add(pt) should be arrayOuter.add(ptNum) Line 45 was: if len(arrayOuter) < part.count : should be: if arrayOuter.Count < part.count :
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.