Select to view content in your preferred language

ArcGIS Pro - Calculate Fields tool

1923
6
01-17-2018 07:41 AM
DuncanHornby
MVP Notable Contributor

I have been reading with excitement the new functionality in ArcGIS Pro 2.1. My version of Pro is not offering to update yet so I have yet to explore some of the new tools.  I noticed there are 2 new tools: Add Fields and Calculate Fields.

What is the advantage of using these over the existing Add Field and Calculate Field tools? Is there some sort of performance improvement?  Running the new Add Fields tool will have the same outcome as chaining many Add Field tools together, so why use it if the end result is the same?

Curious to understand why these tools have appeared when there are so many other ideas that people are asking for?

0 Kudos
6 Replies
DanPatterson_Retired
MVP Emeritus

Calculate fields allows you to do multiple field calculations at one time, like calculate a polygon centroid and its partcount for example.  The fields need to exist, but this makes it much easier during scripting since it removes a necessary loop to perform multiple field calculations, enabling them to be done at one time especially if you also use Add Fields Performance-wise... does it really matter? the few seconds or stretch to a minute if need be isn't going to save that much work time, but it certainly cleans up code writing and I suspect modebuilding

curtvprice
MVP Esteemed Contributor

If Calculate Fields doesn't require a pass through the data for each field, I would expect it to be 2x faster to calcualte two fields and 3x to calculate three fields. Currently we use an update cursor when we need that performance, but that involves scripting (ha). Add Fields would be faster too, if it somehow does not require multiple passes, though probably not by as much.

DuncanHornby
MVP Notable Contributor

So you feel it is more about creating cleaner code or simpler models than anything to do with rocket fast performance? I get the Add Fields could improve readability of a model. Calculate Fields feels like it could be a bit of a black box as it could be doing lots of clever things. I guess I will have some sort of eureka moment with that when my ArcGIS Pro updates...

Also excited about all the new logical tools in model builder, seems like they were a long time coming, shame they are not in ArcMap 10.6.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Both are a nice addition and there are loads more tools in 2.1 that people will only stumble on over the next 6 months (beta user here)

0 Kudos
DavidWasserman
Frequent Contributor

I actually think these are really helpful tools. Beyond what others have been saying here, these tools helps clean up model builder calcs to two tools rather than 20. Sequential Add/Calc fields lead to general model elongation, and this can make models difficult to read at a glance. 

David Wasserman, AICP
0 Kudos
DanPatterson_Retired
MVP Emeritus

They could very easily have a 'KeepFields' tool as a counterpart, for when the number of fields to keep is less than the fields to delete.

0 Kudos