⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kriginginter.txt

📁 实现克里金插值算法的VC程序脚本
💻 TXT
字号:
克里金插值算法实现
private void Kriging(ILayer plyr, string FieldName, bool KriType, bool SearchType, string funcType, double SearchD, double SearchCount, double CellSize, out  IGeoDataset poutGeoDataset)
        {
            poutGeoDataset = new FeatureClassDescriptorClass();
            IRasterLayer pRasterLayer = new RasterLayerClass();
            IFeatureClass pFeatureClass;
            IFeatureLayer pfeaturelayer = (IFeatureLayer)plyr;
            pFeatureClass = pfeaturelayer.FeatureClass;
            IFeatureClassDescriptor pFeatureClassDescriptor = new FeatureClassDescriptorClass();
            pFeatureClassDescriptor.Create(pFeatureClass, null, FieldName);
            IInterpolationOp pInterpolationOp = new RasterInterpolationOpClass();
            IRasterAnalysisEnvironment pEnv = (IRasterAnalysisEnvironment)pInterpolationOp;
            object dCellSize = CellSize;
            pEnv.SetCellSize(esriRasterEnvSettingEnum.esriRasterEnvValue, ref  dCellSize);
            object missing = Type.Missing;
            IRasterRadius pRadius = new RasterRadius();
            object pSearchCount = SearchCount;
            object dSearchD = SearchD;
            if (SearchType == true)  //固定半径
            {
                pRadius.SetFixed(SearchD, ref pSearchCount);
            }
            else
            {
                pRadius.SetVariable((int)SearchCount, ref dSearchD);
            }
            if (KriType == true)
            {
                switch (funcType)
                {
                    case "三角函数":
                        poutGeoDataset = pInterpolationOp.Krige((IGeoDataset)pFeatureClassDescriptor, esriGeoAnalysisSemiVariogramEnum.esriGeoAnalysisCircularSemiVariogram, pRadius, false, ref missing);
                        break;
                    case "球面函数":
                        poutGeoDataset = pInterpolationOp.Krige((IGeoDataset)pFeatureClassDescriptor, esriGeoAnalysisSemiVariogramEnum.esriGeoAnalysisSphericalSemiVariogram, pRadius, false, ref missing);
                        break;
                    case "指数函数":
                        poutGeoDataset = pInterpolationOp.Krige((IGeoDataset)pFeatureClassDescriptor, esriGeoAnalysisSemiVariogramEnum.esriGeoAnalysisExponentialSemiVariogram, pRadius, false, ref missing);
                        break;
                    case "高斯函数":
                        poutGeoDataset = pInterpolationOp.Krige((IGeoDataset)pFeatureClassDescriptor, esriGeoAnalysisSemiVariogramEnum.esriGeoAnalysisGaussianSemiVariogram, pRadius, false, ref missing);
                        break;
                    case "线性函数":
                        poutGeoDataset = pInterpolationOp.Krige((IGeoDataset)pFeatureClassDescriptor, esriGeoAnalysisSemiVariogramEnum.esriGeoAnalysisLinearSemiVariogram, pRadius, false, ref missing);
                        break;
                }
            }
            else
            {
                switch (funcType)
                {
                    case "函数1":
                        poutGeoDataset = pInterpolationOp.Krige((IGeoDataset)pFeatureClassDescriptor, esriGeoAnalysisSemiVariogramEnum.esriGeoAnalysisUniversal1SemiVariogram, pRadius, false, ref missing);
                        break;
                    case "函数2":
                        poutGeoDataset = pInterpolationOp.Krige((IGeoDataset)pFeatureClassDescriptor, esriGeoAnalysisSemiVariogramEnum.esriGeoAnalysisUniversal2SemiVariogram, pRadius, false, ref missing);
                        break;
                }
            }

        }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -