ArcGIS Python更新顺序2种方法
# -*- coding: utf-8 -*- import arcpy import sys def updatebsm(inFeature,inField): i=1 cursor=arcpy.UpdateCursor(inFeature) for row in cursor: row.setValue(inField,i) i=i+1 cursor.updateRow(row) del cursor def updatebsm2(inFeature,inField): i=1 cursor=arcpy.da.UpdateCursor(inFeature,inField) for row in cursor: row[0]=i i=i+1 cursor.updateRow(row) del cursor inFeature = arcpy.GetParameterAsText(0) # inField = arcpy.GetParameterAsText(1) updatebsm2(inFeature,inField)
关注公众号,学习更多