Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

Thanks in advance.

share|improve this question

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.

share|improve this answer
    
I'll have to play with that at 10. I resorted to keeping track of the max(bldg_id) on paper. Thanks. –  gkh Apr 19 '11 at 12:21
    
Is there a way to accomplish that in 9.3? –  mlt Jun 10 '13 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. –  PolyGeo Jun 11 '13 at 11:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.