1

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.

enter image description here

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.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Oct 25, 2020 at 2:41
4
  • What happens when you run that model? Commented 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? Commented Oct 25, 2020 at 4:47
  • 1
    Are 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? Commented 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? Commented Oct 25, 2020 at 15:16

1 Answer 1

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.

Suggested model

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
answered Oct 25, 2020 at 18:44
5
  • 1
    ArcGIS Pro has an Iterate Fields tool. Commented Oct 25, 2020 at 19:46
  • @PolyGeo can you please provide a link to this iterator? I can't find it. Commented Oct 25, 2020 at 21:11
  • 1
    It’s at pro.arcgis.com/en/pro-app/tool-reference/modelbuilder-toolbox/… Commented 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. Commented Oct 26, 2020 at 11:07
  • 1
    OK, good to know. Thanks everyone. I'll give these things a try. Commented Oct 26, 2020 at 13:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.