||
import arcpy
arcpy.AddField_management("DJTB","2C_GHDLMC","TEXT",field_length=20,field_is_nullable="NULLABLE")
codeb='''
... def fill(a):
... if a == u"一类住宅用地" or a == u"二类住宅用地" or a == u"三类住宅用地"or a == u"混合住宅用地":
... return "宅基地"
... elif a == u"行政办公用地" or a == u"文化用地" or a == u"教育科研用地" or a == u"体育用地" or a == u"医疗卫生用地" or a == u"社会福利用地" or a == u"其他公共服务设施用地":
... return "公共服务设施用地"
... elif a == u"商服用地" or a == u"商务办公用地"or a == u"批发市场用地"or a == u"村庄旅游设施用地"or a == u"村庄工业生产用地"or a == u"村庄物流仓储用地"or a == u"其他商业服务业设施用地":
... return "经营性建设用地"
... elif a == u"硬化道路" or a == u"非硬化道路"or a == u"交通站用地":
... return "道路与交通设施用地"
... elif a == u"供水用地" or a == u"供热用地"or a == u"排水用地"or a == u"供电用地"or a == u"供燃气用地"or a == u"通信用地"or a == u"广播电视用地"or a == u"环卫用地"or a == u"其他公用设施用地":
... return "公用设施用地"
... elif a == u"村庄绿地" or a == u"村庄公共空间用地":
... return "绿地与广场用地"
... else:
... return "待核实"
... '''
...
arcpy.CalculateField_management("DJTB","C2_GHDLMC","fill(!GHDLMC!)","PYTHON_9.3",codeb)
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2025-1-7 17:08
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社