C#+AE 插值

 /// <summary>
        /// 要插值的要素类,插值的字段名,阈值,栅格大小,指数
        /// </summary>
        /// <param name="_pFeatureClass"></param>
        /// <param name="_pFieldName"></param>
        /// <param name="_pDistance"></param>
        /// <param name="_pCell"></param>
        /// <param name="_pPower"></param>
        /// <returns></returns>

       public IGeoDataset IDW(IFeatureClass _pFeatureClass, string _pFieldName, double _pDistance, double _pCell, int _pPower)
       {
           IGeoDataset Geo = _pFeatureClass as IGeoDataset;

           object pExtent = Geo.Extent;

           object o = Type.Missing;

           IFeatureClassDescriptor pFeatureClassDes = new FeatureClassDescriptorClass();

           pFeatureClassDes.Create(_pFeatureClass, null, _pFieldName);


           IInterpolationOp pInterOp = new RasterInterpolationOpClass();

           IRasterAnalysisEnvironment pRasterAEnv = pInterOp as IRasterAnalysisEnvironment;


          // pRasterAEnv.Mask = Geo;


           pRasterAEnv.SetExtent(esriRasterEnvSettingEnum.esriRasterEnvValue, ref pExtent, ref o);


           object pCellSize = _pCell;//可以根据不同的点图层进行设置


           pRasterAEnv.SetCellSize(esriRasterEnvSettingEnum.esriRasterEnvValue, ref pCellSize);


           IRasterRadius pRasterrad = new RasterRadiusClass();

           object obj = Type.Missing;

           pRasterrad.SetFixed(_pDistance, ref obj);

           object pBar = Type.Missing;

           IGeoDataset pGeoIDW = pInterOp.IDW(pFeatureClassDes as IGeoDataset, _pPower, pRasterrad, ref pBar);

           return pGeoIDW;

 

       }

你可能感兴趣的:(C#)