I'm trying to get the maximum numeric value from one feature class and use that value in an expression to calculate values of a different feature class.
fc2.bldg_id = max(fc1.bldg_id)+1
Can this be done using the advanced field calculator? If so, what would my syntax look like? Do the feature classes need to be in the same fgdb and feature dataset?
1 Answer 1
I would do this one using ModelBuilder.
The model would first use the Summary Statistics tool to create a table with a single row for the Maximum of your bldg_id from fc1.
To read that value into a variable called Value use the Get Field Value tool (new at ArcGIS 10).
You can then use a Calculate Field tool on the bldg_id field of fc2 with its Expression set to %Value% + 1. Make the Value variable a precondition to running the Calculate Field tool.
-
I'll have to play with that at 10. I resorted to keeping track of the max(bldg_id) on paper. Thanks.Greg– Greg2011年04月19日 12:21:21 +00:00Commented Apr 19, 2011 at 12:21
-
Is there a way to accomplish that in 9.3?mlt– mlt2013年06月10日 16:22:09 +00:00Commented Jun 10, 2013 at 16:22
-
Yes - the Get Field Value tool was not available until 10.0 but at 9.3.1 (presumably 9.3 too) it was possible to write a fairly succinct Python Script Tool that opens a SearchCursor to read the row value you are interested in. This tool could be used in ModelBuilder too.2013年06月11日 11:08:23 +00:00Commented Jun 11, 2013 at 11:08
Explore related questions
See similar questions with these tags.