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.

What is the most efficient (fastest) way to calculate records in a layer in ArcGIS?

Is there anything faster than the Cursor in ArcGIS?

share|improve this question
1  
Not all cursors (there are several of them) are equal. Is this a python or arcobjects question? –  Ragi Yaser Burhum Dec 5 '12 at 15:20
2  
It is tagged python, so I assume its python :) –  sgrieve Dec 5 '12 at 15:48
add comment

3 Answers 3

up vote 7 down vote accepted

If you are using ArcGIS 10.1 you can use the data access module which speeds up performance and, in my opinion, has a simpler syntax than the traditional cursors. However this module is only available for 10.1 so only use it if you are sure you will not need to run your code in older environments.

share|improve this answer
1  
+1 data access module, sounds interesting! –  Aaron Dec 5 '12 at 16:02
3  
At the 2012 User Conference, they demonstrated up to a 10x improvement using arcpy_da cursors vs arcpy cursors. –  RyanDalton Dec 5 '12 at 16:15
add comment

I would recommend checking out the following very informative and related links:

Speeding up my Python calculated field

Performance of ArcGISScripting and large spatial data sets

In the first post, @OptimizePrime recommended utilizing "in_memory" workspace while performing field calculations.

share|improve this answer
    
Just make sure you have plenty of RAM on your machine if you are going to use "in_memory" workspace. –  Baltok Dec 5 '12 at 16:37
add comment

I would think that using CalculateField_management would be faster than using a cursor as well, as you are not iterating through each record like you are with a cursor. If you need to, you can use a Python expression in the call. Available at 10.0 (and 9.x for that matter).

share|improve this answer
add comment

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.