arcpy.UpdateCursor和arcpy.da.UpdateCursor计算面积时间的比较
发布时间:2021-01-11 20:41:38 所属栏目:站长百科 来源:网络整理
导读:arcpy.UpdateCursor # ###################### import arcpy from arcpy import env import os import sysfc = arcpy.GetParameterAsText(0)filename = arcpy.GetParameterAsText(1 )rows = arcpy.UpdateCursor(fc) # #####################################
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测试 (编辑:上饶站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |