當(dāng)shp矢量標(biāo)識(shí)碼BSm字段需要從1或某個(gè)常數(shù)開(kāi)始連續(xù)自動(dòng)編號(hào)時(shí),可在字段計(jì)算器用以下python代碼實(shí)現(xiàn):
a=-1
def autoIncrement():
global a
pStart = 1 #起始值為1,可修改
pInterval = 1 #間隔值為1,可修改
if (a ==-1):
a = pStart
else:
a = a + pInterval
return a
調(diào)用方法:
autoIncrement()