zhousky
论坛版主
论坛版主
  • 注册日期2003-08-01
  • 发帖数281
  • QQ
  • 铜币1027枚
  • 威望3点
  • 贡献值0点
  • 银元0个
10楼#
发布于:2005-03-28 16:42
<P>已成功,谢谢</P><P>'--------------------生成等值线--------------------------
Public Sub Contour()</P><P>  Dim pInterpolationOp As IInterpolationOp
  Set pInterpolationOp = New RasterInterpolationOp
  
  ' Create the input point object
  Dim pInputDataset As IGeoDataset
  Dim pFeatLayer As IFeatureLayer
  ' Calls function to open the point dataset from disk
  Set pFeatLayer = basSub.FindLayerName(frmMain.MapControl1, "水准测量点")
  Set pInputDataset = pFeatLayer
  ' Define the search radius
  Dim pRadius As IRasterRadius
  Set pRadius = New RasterRadius
  pRadius.SetVariable 12
  
  'Create FeatureClassDescriptor using a value field
   Dim pFCDescriptor As IFeatureClassDescriptor
   Set pFCDescriptor = New FeatureClassDescriptor
   pFCDescriptor.Create pFeatLayer.FeatureClass, Nothing, "沉降量"
    
    'Set cellsize for output raster in the environment
    Dim dCellSize As Double
    dCellSize = 200
    
    Dim pEnv As IRasterAnalysisEnvironment
    Set pEnv = pInterpolationOp
    pEnv.SetCellSize esriRasterEnvValue, dCellSize
    
    'Perform the interpolation
    Dim pOutRaster As IRaster
    Set pOutRaster = pInterpolationOp.IDW(pFCDescriptor, 2, pRadius)
        
    'Add output into ArcMap as a raster layer
    Dim pOutRasLayer As IRasterLayer
    Set pOutRasLayer = New RasterLayer
    pOutRasLayer.CreateFromRaster pOutRaster
    frmMain.MapControl1.AddLayer pOutRasLayer
End Sub</P>
不要看我噢
举报 回复(0) 喜欢(0)     评分
上一页 下一页
游客

返回顶部