[GIS] calculate value using maximum value from different feature class

arcgis-desktopfield-calculatormodelbuilderpython-parsersql

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?

Best Answer

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.

Related Question