Howto: 使用Field Calculator把度分秒字段转为十进制度的数值型字段

文章编号: 353
软件: ArcInfo Desktop 8.3 9.0,ArcEditor 8.3 9.0,ArcView 8.3 9.0
操作系统: N/A
已邀请:

EsriSupport

赞同来自:

摘要: 描述了怎么样使用Field Calculator 来转换字符型的度 分 妙的字段到十进制度的数值型的字段。度 分 秒的存储方式按照下面的格式,如:120 35 20,其中120是度,35是分,20是秒。
内容:
1 把要转换的表或者数据添加到ArcMap中。 2 右击图层打开属性表。 3 确定不要在编辑模式下,单击选项,并选择添加字段。 4 添加一个double型的,名称比如为lat2的字段。 5 在lat2字段上右击,并选择计算。 6 选上高级选项。 7 粘贴下面的代码到表达式框中: Dim Degrees as Double
Dim Minutes as Double
Dim Seconds as Double
Dim DMS as Variant
Dim DD as Double

DMS = Split([Latitude])
Degrees = CDbl(DMS(0))
Minutes = CDbl(DMS(1))
Seconds = CDbl(DMS(2))
DD = (Seconds/3600) + (Minutes/60)+ Degrees
8 其中DMS开头的那一行中[]中的是存储度 分 秒的字段的名称。
9 粘贴下面的代码到'lat2='下面的框中。

CDbl(DD)
10 单击确定完成。





创建时间:2004-11-23
最近更新:2004-11-23


原文链接
http://support.esrichina.com.cn/2004/1123/353.html

要回复问题请先登录注册