如何添加irasteranalysisenvironment的引用
答案:2 悬赏:60 手机版
解决时间 2021-01-28 18:23
- 提问者网友:且恨且铭记
- 2021-01-28 04:22
如何添加irasteranalysisenvironment的引用
最佳答案
- 五星知识达人网友:持酒劝斜阳
- 2021-01-28 04:45
支持一下感觉挺不错的
全部回答
- 1楼网友:往事埋风中
- 2021-01-28 05:03
克里金插值一般不用gp写
给你一段代码
/// <summary>
/// 克里金插值
/// </summary>
/// <param name="pFeatureLayer">输入参数要素图层</param>
/// <param name="strHeightField">插值字段</param>
/// <param name="pCellSize">像元大小</param>
/// <param name="pStyle">插值模型</param>
/// <param name="pRadius">搜索半径</param>
/// <returns></returns>
private IRaster KrigeCreateRaster(IFeatureLayer pFeatureLayer, string strHeightField, double pCellSize, esriGeoAnalysisSemiVariogramEnum pStyle, int pRadius)
{
IRaster pRaster;
IInterpolationOp2 pInterpolation = new RasterInterpolationOpClass();
//设置搜索半径
IRasterRadius pRasterRadius = new RasterRadiusClass();
object oRadius = Type.Missing;
pRasterRadius.SetVariable(pRadius, ref oRadius);
//设置插值字段
IFeatureClassDescriptor pFeatureClassDescriptor = new FeatureClassDescriptorClass() as IFeatureClassDescriptor;
pFeatureClassDescriptor.Create(pFeatureLayer.FeatureClass, null, strHeightField);
//设置像元大小
object oCellSize = pCellSize;
IRasterAnalysisEnvironment pRasterAnalysisEnvironment = pInterpolation as IRasterAnalysisEnvironment;
pRasterAnalysisEnvironment.SetCellSize(esriRasterEnvSettingEnum.esriRasterEnvValue, ref oCellSize);
//克里金插值
object obarrier = Type.Missing;//
pRaster = pInterpolation.Krige(pFeatureClassDescriptor as IGeoDataset, pStyle, pRasterRadius, false, ref obarrier) as IRaster;
return pRaster;
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯