AE创建TIN


Private Sub CreateTinFromFeature()

Dim pGeoDataset As IGeoDataset
pGeoDataset = pFeatureClass

Dim pExtent As IEnvelope
pExtent = pGeoDataset.Extent()
'TIN将使用通过pExtent设置的空间引用
pExtent.SpatialReference = pGeoDataset.SpatialReference

'获得高程字段
Dim pfields As IFields
pfields = pFeatureClass.Fields
Dim pHeightField As IField
pHeightField = pfields.Field(m_selHIndex)

'创建TIN对象并且得到ITinEdit接口
Dim pTinEdit As ITinEdit = New Tin
'初始化TIN
pTinEdit.InitNew(pExtent)


'调用相应的函数将shape文件(含高程信息)增加到TIN中
If m_selTIndex = 0 Then
pTinEdit.AddFromFeatureClass(pFeatureClass, Nothing, pHeightField, Nothing, esriTinSurfaceType.esriTinMassPoint)
ElseIf m_selTIndex = 1 Then
pTinEdit.AddFromFeatureClass(pFeatureClass, Nothing, pHeightField, Nothing, esriTinSurfaceType.esriTinHardLine)
ElseIf m_selTIndex = 2 Then
pTinEdit.AddFromFeatureClass(pFeatureClass, Nothing, pHeightField, Nothing, esriTinSurfaceType.esriTinSoftLine)
Else
MessageBox.Show("创建TIN失败!")
Me.Close()
End If

'保存TIN
pTinEdit.SaveAs(SaveFileDialog1.FileName)
pTinEdit.StopEditing(False)

Me.Close()

End Sub
来自:http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=35372&extra=page%3D1%26amp%3Bfilter%3Dtype%26amp%3Btypeid%3D6

你可能感兴趣的:(创建)