AnsweredAssumed Answered

Is there a way to iterate through features in a feature class and perform a geoprocessing function on them feature-wise, one-by-one?

Question asked by tab5ay_uvalibrary on Jun 17, 2019
Latest reply on Jun 19, 2019 by bharold-esristaff

I am working on a project in which there is considerable geometric overlap in polyline data in the same feature class. These polylines are from old property records taken from land grants and were initially not closed polylines because of inexact surveying methods. I closed each individual feature by assigning each entry in the raw polyline data an ID, running the Feaures to Vertices tool, and then running the Points to Lines tool and selecting to close the line. Now I have a bunch of closed polylines corresponding to each lot in my dataset.

 

What I would like to do is turn each of these closed polylines into its own polygon (along with the data associated with it). The problem is, when I try to use the Feature to Polygon tool, it causes major problems at places where these lines overlap. It either causes slivers or does not recognize the fact that smaller polygons can exist within larger ones. I know it is doing exactly what it is expected to, but it isn't what I'm looking for. It works exactly as I want it to if I manually go through each feature in the attribute table and click Modify and then Construct Polygons. I imagine it would also work perfectly if I were to take each feature and turn it into its own layer, Construct Polygons, and then merge these layers back together.

 

What I would like to do, however, is write code to either:

1) Iterate through each row entry (feature) in the attribute table and perform the Modify and Construct Polygons under the Edit ribbon.

2) Under the Analysis ribbon and Geoprocessing Tools, use the Feature to Polygon tool to run through each row entry (feature) if that is possible. This would be the preferred method as it would allow me to transfer wanted information for the attribute table of the polylines to the attribute table of the new polygons. I'm not sure how to do that otherwise without exporting to Excel or something and reimporting it after editing.

 

In general I'm wondering if there is a way to perform geoprocessing functions on individual features (rows) at a time. I know I can edit attributes in the attribute table in that way using ArcCursor, but I'm hoping that I can isolate and iterate through each row and perform some sort of Geoprocess at each step.

Outcomes