arcpy.UpdateCursor
####################### import arcpy from arcpy import env import os import sys fc= arcpy.GetParameterAsText(0) filename= arcpy.GetParameterAsText(1) rows = arcpy.UpdateCursor(fc) ######################################### ## for row in rows: shape=row.shape parea=shape.area row.setValue(filename,parea) rows.updateRow(row) del row del rows
arcpy.da.UpdateCursor
import arcpy from arcpy import env import os import sys fc= arcpy.GetParameterAsText(0) filename= arcpy.GetParameterAsText(1) fields = (filename,‘[email protected]‘) rows = arcpy.da.UpdateCursor(fc,fields) ######################################### ## for row in rows: parea=row[1] #parea=shape.area row[0]=parea rows.updateRow(row) del row del rows
比较如下:
上面是1.22s,下面是0.25s,差5倍 gisoracle测试
另一个数据,11.85s,下面是1.8,差6倍 gisoracle测试
原文地址:https://www.cnblogs.com/gisoracle/p/11216534.html
时间: 2024-10-18 00:00:54