0

I am trying to create a model that will iterate through all the files in a Database, return the counts of each feature class, then add them all together to get a final count and put the result in a table. I have created an iterator that goes through the database and summarizes each feature class, but now I want to get a total count of the features.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Feb 6, 2019 at 11:58
4
  • What does your model so far look like? Commented Feb 6, 2019 at 12:18
  • A very similar question was asked over on geonet for which I provide an answer. Commented Feb 6, 2019 at 13:03
  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Please check out our short tour to learn about our focussed Q&A format. Commented Feb 7, 2019 at 0:48
  • 1
    @Hornbydd At GeoNet you said "Modelbuilder and it's standard tools don't offer the ability to insert a row of information into a table which is what you are after." but I think it does by using Calculate Field to write a value into a one row table and then Append-ing that table onto the end of another table created to hold all the values. Commented Feb 7, 2019 at 0:51

1 Answer 1

1

About 10 years ago, before I learned ArcPy where iteration is much easier, which was also before iterators were available in ModelBuilder, I believe I was able to do tasks such as this using ModelBuilder.

I think the keys to doing it now would be:

  1. Prior to iterating have an empty table with a field to hold your counts for each feature class - let's call this ALL_COUNTS
  2. Prior to iterating have a one row table with a field to hold your count for one feature class - let's call this ONE_COUNT - there's no need to have a value in that row because we'll be writing and overwriting its value at each iteration
  3. The schema for All_COUNTS and ONE_COUNT should be identical because we'll be using them in the Append tool
  4. At each iteration use Get Count to count the features and inline substitution to write it into ONE_COUNT via Calculate Field, then Append the current contents of ONE_COUNT onto ALL_COUNTS
  5. Once all iterations are complete use Summary Statistics to SUM the values of ALL_COUNTS
answered Feb 7, 2019 at 0: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.