dukeyongwang
路人甲
路人甲
  • 注册日期2008-08-25
  • 发帖数8
  • QQ
  • 铜币132枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2162回复:2

[求助]用AE+c#开发一个应用程序

楼主#
更多 发布于:2008-09-26 01:35
请问一下,如何用ae+c#实现IDW插值。如果有程序就更好了。先谢谢了!<br>
喜欢0 评分0
wheroy
路人甲
路人甲
  • 注册日期2004-09-04
  • 发帖数159
  • QQ
  • 铜币251枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2008-10-11 05:57
<P>  public void Interpolation_IDW()<BR>        {<BR>            string sRelField;<BR>            object dCellSize;<BR>            //Change the following to run this sample<BR>            sRelField = "SPOT";<BR>            dCellSize = 2;<BR>            string sel = Aotoolcontrol1.sel;<BR>           <BR>            //Get the first layer from the current focus map<BR>            //IMxDocument pDoc = application.Document as IMxDocument;<BR>            //map = pDoc.Maps.get_Item(0);//一个文档包含若干地图</P>
<P>            ILayer pLayer = getLayerByName(m_hookHelper.FocusMap, sel);</P>
<P>            //Make a feature layer<BR>            IFeatureLayer pFLayer = pLayer as IFeatureLayer;<BR>            //Get the display table<BR>            IDisplayTable pDisplayTable = pFLayer as IDisplayTable;<BR>            ITable pTable = pDisplayTable.DisplayTable as ITable;<BR>            //Make a relationship query table from the display table<BR>            IRelQueryTable pRelQueryTable = pTable as IRelQueryTable;<BR>            //Get the feature class from the relationship query table<BR>            IFeatureClass pFeatClass = pFLayer.FeatureClass;<BR>            //Make a feature class descriptor from the feature class<BR>            IFeatureClassDescriptor pFDesc = new FeatureClassDescriptor() as IFeatureClassDescriptor;<BR>            pFDesc.Create(pFeatClass, null, sRelField);<BR>            //Make a new interpolator object</P>
<P>            IInterpolationOp pInterpolationOp = new RasterInterpolationOp() as IInterpolationOp;<BR>            //   the analysis environment<BR>            IRasterAnalysisEnvironment pRasterAnalysisEnv = pInterpolationOp as IRasterAnalysisEnvironment;<BR>            pRasterAnalysisEnv.SetCellSize(esriRasterEnvSettingEnum.esriRasterEnvValue, ref  dCellSize);<BR>            object snap = 0; object extendp = 0;<BR>            pRasterAnalysisEnv.SetExtent(esriRasterEnvSettingEnum.esriRasterEnvMaxOf, ref extendp, ref snap);<BR>            //   the search radius<BR>            IRasterRadius pRasterRadius = new RasterRadius() as IRasterRadius;<BR>            object minc = 10;<BR>            pRasterRadius.SetFixed((double)50, ref minc);<BR>            //Perform the IDW<BR>            object barrier = 0;<BR>            IRaster pRaster = pInterpolationOp.IDW((IGeoDataset)pFDesc, (double)2, pRasterRadius, ref barrier) as IRaster;<BR>            //Create a new raster layer<BR>            IRasterLayer pRasterLayer = new RasterLayer() as IRasterLayer;<BR>            pRasterLayer.CreateFromRaster(pRaster);</P>
<P>            //Add the layer to the current focus map<BR>            m_hookHelper.FocusMap.AddLayer((ILayer)pRasterLayer);<BR>            m_hookHelper.ActiveView.Refresh();<BR>        }<BR></P>
举报 回复(0) 喜欢(0)     评分
zhangsnoopy
路人甲
路人甲
  • 注册日期2006-11-25
  • 发帖数8
  • QQ
  • 铜币122枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2008-11-12 16:15
<P>真的有高人啊,不服不行的</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部