8,834
社区成员
发帖
与我相关
我的任务
分享
IFeatureLayer pFeatureLayer = mapp.get_Layer(0) as IFeatureLayer;
IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
IFeatureClassDescriptor pFCDdescriptor = new FeatureClassDescriptorClass();//描述符
pFCDdescriptor.Create(pFeatureClass, null, "Height");//输入要素数据集
IRasterRadius pRadius = new RasterRadius();//搜索半径
pRadius.SetVariable(12);//设定搜索半径为12
IInterpolationOp pInterpolationOp = new RasterInterpolationOpClass();//InterpoOP2插值接口
IRasterAnalysisEnvironment pEnv = pInterpolationOp as IRasterAnalysisEnvironment;//设置空间分析环境
pEnv.SetCellSize(esriRasterEnvSettingEnum.esriRasterEnvValue, 5000);//SetCellSize设置输出栅格数据的像元大小
IGeoDataset pInputDataset = pFCDdescriptor as IGeoDataset;//输入包含Z值的点要素集
IGeoDataset pOutputDataset = pInterpolationOp.IDW(pInputDataset,2, pRadius);
IRasterLayer pRasterLayer = new RasterLayer();
pRasterLayer.CreateFromRaster(pOutputDataset as IRaster);
mapp.AddLayer(pRasterLayer);
mapp.Refresh();