[GIS] Iterate ModelBuilder Select By Location

arcgis-desktopiterationmodelbuilder

I have two feature classes. Polyline and Point. Both feature classes have the field "NAME" with values populated.

I want to iterate (assuming by field value) with "NAME" field to select polyline and all corresponding points with same "NAME" value that are further than 3 feet from polyline.

I want to create a model in ModelBuilder that will iterate through the entire feature class so i can identify all points that are further than 3 feet away from their corresponding line.

I have successfully added the iterator and added the query in select tool to select both points and polyline by "NAME". However the select by feature tool will not allow the output from select tool to be used as the input feature layer for the select by location tool. It only allows either output to be used for the selection layer.

How do I get the output from the select tool to be used as input feature layer for the select by location tool?

Best Answer

To create a feature layer from the selection, add 'Make Feature Layer' after the iterator and before the select by location:

enter image description here

Then set the output name of the layer to YourTextHere_%Value%. This will create a feature layer with the name YourTextHere_< group-by attribute value of current selection > In my example, I'm using the 'LABEL' field to group by, so my %Value% will be the LABEL of the current selection - e.g. Pipeline_Pt_Layer_Crossing7.

Here's the output settings for the make feature layer tool: enter image description here

Related Question