Model Builder: Iterate Feature Classes

1217
3
01-08-2021 01:03 AM
OliverCowan
New Contributor II

Model1Model1

 Good day,

I've created a model that uses species occurrence points to select specific polygons from a multipolygon shapefile. This works perfectly using the Select Layer By Location tool.  I want to then join the information contained within the species occurrence points to the selected polygons to provide a final output of polygons which contain species occurrence points AND the information from the original species occurrence points. I believe that the Spatial Join tool is the most suitable for this.

As I have to do this for multiple species I have set up the Iterate Feature Classes command. The process runs fine but my problem is that the final output does not contain the information from the species occurrence points. When I open the Field Map of the Spatial Join tool, the only fields present are those from the multipolygon shapefile. My instinct tells me the problem lies with the Iterate Feature Classes command...

Any advice is highly appreciated. 

3 Replies
DanPatterson
MVP Esteemed Contributor

If you run through it manually once do you get the desired output? 

If you run it again manually, do you get the desired output?  (this will simulate your iterator)


... sort of retired...
OliverCowan
New Contributor II

Yes, if I remove the Iterate Feature Classes from the model and replace the resultant feature class with the species occurrence record shapefile I get the desired output. If I then replace that species occurrence record shapefile with the shapefile of the species directly beneath it and rerun the model I get the desired outcome...  

DanPatterson
MVP Esteemed Contributor

It looks like you only have one "name" as an output file. looking at your model I expect each iterated shapefile to have the results of the select by location portion


... sort of retired...