Friday, 24 May 2019

ArcGIS ModelBuilder iterator reports only last input shapefile?


Using Arc 10.3.1, if I manually enter the names of multiple shapefiles (all from the same folder) into the Check Geometry tool, the (single) output table lists the errors that exist in all of the shapefiles.


That is, only one output table is created, even if multiple input shapefiles have errors. For example, if two shapefiles have errors, both will be listed in the single output table. Here's a screen print of the input:


enter image description here


However, if I iterate those same shapefiles (using the Feature Classes option), the output table only lists the last shapefile that went through the iteration. Here's a screenshot of the model:


enter image description here


I suspect that the iterator is running Check Geometry not once, but three times, with a single input shapefile going through each iteration, overwriting the previous output.


How do I get the iterator to list all of the shapefiles with errors, either in separate output tables or aggregated in a single output table?



Answer



In you case, the best option would be to right click on the "check geometry" tool then choose "batch" in order to run 3 different instances of "check geometry".



That being said, you can go in model builder and use the name as an inline variable (double click on ouput and insert %Name% somewhere into your output variable name, e.g, C:/temp/mygdb.gdb/output_%Name%


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...