其他
Python | ArcPy批量更新图形面积
# -*- coding:utf8 -*-
import arcpy
import os
workspace = r'D:\...\xxx.mdb'
arcpy.env.workspace = workspace
featureclasses = arcpy.ListFeatureClasses()
for fc in featureclasses:
cur = arcpy.da.UpdateCursor(fc, ['SHAPE@AREA', 'ZDMJ', 'ZDDM'])
for row in cur:
try:
mjRes = round(row[0] / 666.667, 2)
row[1] = mjRes
cur.updateRow(row)
except:
print(str(row[2]) + '---Error!')
del cur
print(fc + '---layer successful!')
授权转载:GisSurvey
- END -