码迷,mamicode.com
首页 > 其他好文 > 详细

实现高程点到等高线的转换

时间:2016-09-18 21:09:13      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

 

一、在ArcMAP中操作实现

1、启动ArcCatalog,新建数据库data.mdb,在空白处右击,导入data.txt,四个字段分别为Code(设为主健)、X、Y、Z,保存为表Point。
2、启动ArcMap,Tools→Add XY Data,在“Choose a table”中添加数据库data.mdb 中点已被展绘
3、Tools→Extensions,把3D Analyst 打上勾,Close。右击工具栏,把3D Analyst 打上勾。
4、3D Analyst→Create→Modify TIN→Create TIN From Features,把图层Point Events 打上勾,在“Height Source”中选择字段Z,在“Output TIN”中输入TIN
5、3D Analyst→Surface Analyst→Contour,在“Contour Interval”中输入等高距10,在“OutputTIN”中输入Contour 值线。其中,生成了TIN后,可以利用3D Analyst模块下的convert-TIN to Raster将TIN转换为栅格图。再利用ArcMap中栅格分析功能对栅格图处理。
 

 

二、VB编程实现

内容摘要 从高程点到等高线不是一步实现的,而是先把高程点先插值生成TIN,然后再从TIN生成等高线。在从TIN到等高线的生成过程中8.3和9.0上还有点区别,请看代码注释。下面的是整个过程的代码实例。

技术分享
打开高程点数据

Dim pFeatureLayer As IFeatureLayer
Set pFeatureLayer = MapControl1.Map.Layer(0)
If pFeatureLayer Is Nothing Then Exit Sub
Dim pFeatureClass As IFeatureClass
Set pFeatureClass = pFeatureLayer.FeatureClass

生成TIN
Dim pTinEdit As ITinEdit
Dim pTinSurface As ISurface
Dim pTable As ITable
Set pTinEdit = New Tin
Set pTable = New FeatureLayer
pTinEdit.InitNew MapControl1.ActiveView.Extent
Dim pField As IField
Set pField = pFeatureClass.Fields.Field(pFeatureClass.Fields.FindField("Well_Dpth"))
pTinEdit.AddFromFeatureClass pFeatureClass, Nothing, pField, Nothing, 18

Set pTinSurface = pTinEdit

打开已经创建好的空的等高线数据(也可以在此时创建一个要素类9,如果是9.0版本的话,在空等高线数据中预先需要建一个字段来存储高程值,如果是8.3版本的话就不可以预先创建这样的一个高程字段,而是在生成等高线过程中根据你指定的字段名称实时创建
Dim pPropset As IPropertySet
Set pPropset = New PropertySet

Dim pFact As IWorkspaceFactory
Dim pWorkspace As IWorkspace

pPropset.SetProperty "DATABASE", App.Path + "\data\"

Set pFact = New ShapefileWorkspaceFactory
Set pWorkspace = pFact.Open(pPropset, Me.hWnd)

Dim pFeatureWorkspace As IFeatureWorkspace
Set pFeatureWorkspace = pWorkspace

Dim pFeatureClass1 As IFeatureClass
Set pFeatureClass1 = pFeatureWorkspace.OpenFeatureClass("MyShape33")

生成等高线
pTinSurface.Contour 0, 50, pFeatureClass1, "Well_Dpth", 1

Dim pFLayer As IFeatureLayer
Set pFLayer = New FeatureLayer
Set pFLayer.FeatureClass = pFeatureClass1

MapControl1.AddLayer pFLayer
MapControl1.ActiveView.Refresh
View Code

 

 

参考文章

1. ArcGIS点tin,DEM等高线生成问题。

 

实现高程点到等高线的转换

标签:

原文地址:http://www.cnblogs.com/arxive/p/5882918.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!