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?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
user7172
  • 1,529
  • 2
  • 24
  • 45

4 Answers4

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.

sgrieve
  • 3,726
  • 1
  • 19
  • 36
  • 3
    At the 2012 User Conference, they demonstrated up to a 10x improvement using arcpy_da cursors vs arcpy cursors. – RyanKDalton Dec 05 '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).

Chad Cooper
  • 12,714
  • 4
  • 46
  • 87
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.

Aaron
  • 51,658
  • 28
  • 154
  • 317
  • Just make sure you have plenty of RAM on your machine if you are going to use "in_memory" workspace. – Baltok Dec 05 '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.

AndreJ
  • 76,698
  • 5
  • 86
  • 162
Kube Kubow
  • 101
  • 3