0

I am using ArcGIS Pro 2.01 for this task.

I have 114 shapefiles (each represents a session of the US Congress) which include every congressional district since 1790. I have added a short integer field to each feature class called "Congress". This field is intended to signify which session of Congress that feature was used for. For example, all 435 features in the shapefile representing the 114th Congress should have a value of 114 for that field.

I am trying to automate the entire process using ModelBuilder. I do understand that this could be done in Python but I would prefer to use the ModelBuilder so that I can teach my high school GIS class how to do this before showing them the code.

Each shapefile contains the Congressional session number at the end of the filename.

Should I try to use the For tool or should I use something like the Iterate Field Value tool?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Feb 18, 2018 at 3:52

2 Answers 2

1

To do this I would create a model which iterates field values in one feature class, and then make that model a submodel of another model that iterates feature classes.

The help for this is at:

It is much easier to do in ArcPy.

answered Feb 18, 2018 at 4:03
4
  • I will definitely look into the scripting option but I would like to be able to associate the visual nature of ModelBuilder with my students. At first glance it appears that it is not possible to run two iterators at the same time in the same model as one is greyed out as soon as the other is set up. Commented Feb 19, 2018 at 2:36
  • 1
    Exactly, that is why I think you need one iterator in your submodel, and the other in your model (that contains the submodel). Commented Feb 19, 2018 at 3:13
  • Looks like I need to spend some more time learning ArcPy. Commented Feb 19, 2018 at 3:25
  • We've had lots of ModelBuilder questions on incorporating submodels if you are looking for help doing that. Commented Feb 19, 2018 at 3:37
1

I was able to work through this using ArcPy:

  1. Created an array called "CD_List" containting filepath names for all 114 feature classes. This was simple enough to create in Excel with the CONCATENATE formula.
  2. Used a for loop to iterate the process with the Calculate Field Tool:

for x in range (0, 113): arcpy.CalculateField_management(CD_List[x],"Congress",(x+1),"","")

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered Feb 19, 2018 at 20:55

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.