3

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

Is there anything faster than the Cursor in ArcGIS?

  • 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
8

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.

  • 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
6

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).

1

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.

  • 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
0

I found way more faster (dealing with 100 000+ records) to use pyodbc and update all columns with SQL querry. Unfortunatelly you cannot use pyodbc (free) in connection with ArcGIS 9.3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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