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.
-
What does your model so far look like?PolyGeo– PolyGeo ♦2019年02月06日 12:18:30 +00:00Commented Feb 6, 2019 at 12:18
-
A very similar question was asked over on geonet for which I provide an answer.Hornbydd– Hornbydd2019年02月06日 13:03:53 +00:00Commented 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.PolyGeo– PolyGeo ♦2019年02月07日 00:48:57 +00:00Commented 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.PolyGeo– PolyGeo ♦2019年02月07日 00:51:39 +00:00Commented Feb 7, 2019 at 0:51
1 Answer 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:
- Prior to iterating have an empty table with a field to hold your counts for each feature class - let's call this ALL_COUNTS
- 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
- The schema for All_COUNTS and ONE_COUNT should be identical because we'll be using them in the Append tool
- 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
- Once all iterations are complete use Summary Statistics to SUM the values of ALL_COUNTS
Explore related questions
See similar questions with these tags.