Selecting polygons in Modelbuilder

1305
2
12-18-2013 04:58 AM
VictoriaWyeth
New Contributor
Hello

I wonder if someone can help me please.

I have built a model in modelbuilder (please see attached) and I am now trying to select each polygon from the feature class for the first Select Layer by Attribute(4) and then select each polygon from the feature class of the Select Layer By Attribute(2).

What the model is doing, is selecting a polygon from a feature class and then selecting the lines which intersect that polygon. I then need to identify only the lines which intersect the selected polygon an another polygon from the same feature class, so I have added another Select Layer by Attribute action. I then need to do this for all polygons within the feature class so where polygon has ObjectID =1 this needs to be compared to where ObjectID=2 & 3 & 4 & 5 etc. So all pairs of polygons are selected together.

I hope this makes sense. I sure there must be some looping which is required.

Thanks in advance.
0 Kudos
2 Replies
DennisJarrard
Esri Contributor
As a start, I would look into using the Iterate Feature Selection iterator in your model. This will let you iterate through each polygon, and run the same series of processes based on each polygon and any unique selections/objects that are created in that process.
0 Kudos
DaleHoneycutt
Regular Contributor
Seems to me that you could do this using Intersect rather than a bunch of Select Layer By Location and iterators.  If you run Intersect with the lines and polygons as input you'll get a line feature class with the attribute of the polygon that overlays it.  Each line will be split by the polygon that overlays it, forming new lines, but you'll have the parent information (the original objectID).  This seems to be enough information to do what you want -- use  Summary Statistics to find lines that have more than one record.  Not sure what the final objective is, but it seems that this'll give you all the info you need.
0 Kudos