003集—三调数据库添加三大类字段——arcgis

在国土管理日常统计工作中经常需要用到三大类数据(农用地、建设用地、未利用地),而三调数据库中无三大类字段,因此需要手工录入三大类字段,并根据二级地类代码录入相关三大类名称。本代码可一键录入海量三大类名称统计工作。方法如下:

打开数据库文件的属性表,添加三大类字段,打开字段计算器,如下图:

接下来是核心代码,采用了VB中的select case 语句 :

Dim density
''二级类转三大类:by qq:443440204
''说明:此代码按土地报批要求,043 和0404 荒草地归类为农用地,如依据三调工作分类,需手工更正到
select case  [DLBM] 
case "012"
density ="农用地"
case "013"
density= "农用地"
case "021"
density= "农用地"
case "023"
density= "农用地"
case "031"
density= "农用地"
case "033"
density= "农用地"
case "104"
density= "农用地"
case "114"
density= "农用地"
case "117"
density= "农用地"
case "122"
density= "农用地"
case "043"
density= "农用地"
case "201"
density= "建设用地"
case "202"
density= "建设用地"
case "203"
density= "建设用地"
case "204"
density= "建设用地"
case "205"
density= "建设用地"
case "101"
density= "建设用地"
case "102"
density= "建设用地"
case "113"
density= "建设用地"
case "118"
density= "建设用地"
case "111"
density= "未利用地"
case "116"
density= "未利用地"
case "125"
density= "未利用地"
case "0102"
density ="农用地"
case "0103"
density= "农用地"
case "0201"
density= "农用地"
case "0204"
density= "农用地"
case "0301"
density= "农用地"
case "0305"
density= "农用地"
case "0307"
density= "农用地"
case "1006"
density= "农用地"
case "1103"
density= "农用地"
case "1104"
density= "农用地"
case "1104A"
density= "农用地"
case "1107"
density= "农用地"
case "1107A"
density= "农用地"
case "1202"
density= "农用地"
case "05H1"
density= "建设用地"
case "0508"
density= "建设用地"
case "0601"
density= "建设用地"
case "0602"
density= "建设用地"
case "0701"
density= "建设用地"
case "0702"
density= "建设用地"
case "08H1"
density= "建设用地"
case "08H2"
density= "建设用地"
case "08H2A"
density= "建设用地"
case "0809"
density= "建设用地"
case "0810"
density= "建设用地"
case "0810A"
density= "建设用地"
case "09"
density= "建设用地"
case "1001"
density= "建设用地"
case "1002"
density= "建设用地"
case "1003"
density= "建设用地"
case "1004"
density= "建设用地"
case "1005"
density= "建设用地"
case "1109"
density= "建设用地"
case "1201"
density= "建设用地"
case "0404"
density= "农用地"
case "1101"
density= "未利用地"
case "1106"
density= "未利用地"
case "0302"
density= "农用地"
 case else
density= "1错误"
end select

确定即可生成三大类代码。

同理,生成一级类通用代码如下 :

selectcase 语句

Dim density
''二级类转一级类:by qq:443440204
select case left( [DLBM] ,2)
case "01"
density ="耕地"
case "02"
density ="园地"
case "03"
density ="林地"
case "04"
density ="草地"
case "05"
density ="商业服务业用地"
case "06"
density ="工矿用地"
case "07"
density ="住宅用地"
case "08"
density ="公共管理与公共服务用地"
case "09"
density ="特殊用地"
case "10"
density ="交通运输用地"
case "11"
density ="水域及水利设施用地"
case "12"
density ="其他土地"
case "00"
density ="湿地"
case "20"
density ="城镇村及工矿用地"
case  else
density ="1错误"
end select

if else 语句显得比较啰嗦,也一并附上:

Dim density
Dim fz
fz=left( [DLBM] ,2)

if fz ="01"Then
density ="耕地"
elseif fz ="02"Then
density ="园地"
elseif fz ="03"Then
density ="林地"
elseif fz ="04"Then
density ="草地"
elseif fz ="05"Then
density ="商业服务业用地"
elseif fz ="06"Then
density ="工矿用地"
elseif fz ="07"Then
density ="住宅用地"
elseif fz ="08"Then
density ="公共管理与公共服务用地"
elseif fz ="09"Then
density ="特殊用地"
elseif fz ="10"Then
density ="交通运输用地"
elseif fz ="11"Then
density ="水域及水利设施用地"
elseif fz ="12"Then
density ="其他土地"
elseif fz ="00"Then
density ="湿地"
elseif fz ="20"Then
density ="城镇村及工矿用地"
else
 density =null
end if
相关推荐
师太,答应老衲吧13 分钟前
SQL实战训练之,力扣:2020. 无流量的帐户数(递归)
数据库·sql·leetcode
Channing Lewis1 小时前
salesforce case可以新建一个roll up 字段,统计出这个case下的email数量吗
数据库·salesforce
毕业设计制作和分享3 小时前
ssm《数据库系统原理》课程平台的设计与实现+vue
前端·数据库·vue.js·oracle·mybatis
ketil273 小时前
Redis - String 字符串
数据库·redis·缓存
Hsu_kk4 小时前
MySQL 批量删除海量数据的几种方法
数据库·mysql
编程学无止境4 小时前
第02章 MySQL环境搭建
数据库·mysql
knight-n4 小时前
MYSQL库的操作
数据库·mysql
包饭厅咸鱼5 小时前
QML----复制指定下标的ListModel数据
开发语言·数据库
生命几十年3万天5 小时前
redis时间优化
数据库·redis·缓存
Elastic 中国社区官方博客5 小时前
释放专利力量:Patently 如何利用向量搜索和 NLP 简化协作
大数据·数据库·人工智能·elasticsearch·搜索引擎·自然语言处理