I have the exact same problem as Iterate Through Fields in Model Builder [sic] at GeoNet but all the solutions proposed there involved ArcPy and I'm not familiar with that program. I would like to use ModelBuilder to do the exact same thing: iterate through fields in a polygon shapefile and, for each one, create a raster based on the value in the field.
Any suggestions?
I'm using ArcMap and here's what I have so far.
The error message reads:
ERROR 000728: Field 1 does not exist within table
Failed to execute (Polygon to Raster).
I am trying to iterate through fields, not values of a single field. The shapefile does have some ID fields that are string format though and which I don't want to convert. However, there are 26 Double fields that I do want to convert.
-
What happens when you run that model?PolyGeo– PolyGeo ♦2020年10月25日 04:20:06 +00:00Commented Oct 25, 2020 at 4:20
-
Please use the edit button beneath your question to revise it with any requested clarifications. Is that the entire message? What field are you iterating? What values are in that field?PolyGeo– PolyGeo ♦2020年10月25日 04:47:23 +00:00Commented Oct 25, 2020 at 4:47
-
1Are you trying to iterate through all the fields in your shapefile, or are you trying to iterate through all the values in a single field of your shapefile?PolyGeo– PolyGeo ♦2020年10月25日 04:50:47 +00:00Commented Oct 25, 2020 at 4:50
-
@PolyGeo Yes, sorry. I added the error message to the original question. I am trying to iterate through fields, not values of a single field. The shapefile does have some ID fields that are string format though and which I don't want to convert. However, there are 26 Double fields that I do want to convert. Should I drop the string fields? What about the OBJECTID field, which can't be deleted?Josh Colston– Josh Colston2020年10月25日 15:16:23 +00:00Commented Oct 25, 2020 at 15:16
1 Answer 1
With ArcMap there is no out of the box ModelBuilder tool that iterates over fields, they iterate over rows. As indicated in the comments the way to do this is through some simple Python code which you have dismissed in your question. This leaves you only one option, replicate the tool and set the field parameter to be each of your fields for each tool as shown below.
You give no indication of how many fields you want to convert by, if a few, then it literally takes seconds to set up the model below. If it is hundreds I would be questioning why you have a dataset structured so.
-
1ArcGIS Pro has an Iterate Fields tool.2020年10月25日 19:46:46 +00:00Commented Oct 25, 2020 at 19:46
-
@PolyGeo can you please provide a link to this iterator? I can't find it.Hornbydd– Hornbydd2020年10月25日 21:11:39 +00:00Commented Oct 25, 2020 at 21:11
-
1It’s at pro.arcgis.com/en/pro-app/tool-reference/modelbuilder-toolbox/…2020年10月26日 00:22:55 +00:00Commented Oct 26, 2020 at 0:22
-
1@PolyGeo, Interesting if one drills down into the help file (as I did) into the model builder section there is no mention of this useful iterator! Have left feedback on the ESRI site.Hornbydd– Hornbydd2020年10月26日 11:07:13 +00:00Commented Oct 26, 2020 at 11:07
-
1OK, good to know. Thanks everyone. I'll give these things a try.Josh Colston– Josh Colston2020年10月26日 13:43:30 +00:00Commented Oct 26, 2020 at 13:43
Explore related questions
See similar questions with these tags.