栅格统一赋值

       #region//栅格统一赋值
        public static void RasterUnified(string elementPath, string outPath)
        {
            Geoprocessor GP = new Geoprocessor();
            GP.OverwriteOutput = true;
            RasterCalculator rasterToInt = new RasterCalculator();
            //将栅格所有值设置为0
            rasterToInt.expression = "Con( ~IsNull(\"" + elementPath + "\"),0)";
            rasterToInt.output_raster = outPath;
            try
            {
                GP.Execute(rasterToInt, null);
                MessageBox.Show("转换成功!");
            }

            catch (Exception ex)
            {
                string str = "";
                for (int i = 0; i < GP.MessageCount; i++)
                {
                    str += GP.GetMessage(i);
                    str += "\n";
                }
                MessageBox.Show(str);
            }
        }
        #endregion

QQ交流群:607330463 GIS开发技术最强交流群 

上一篇:win10找不到gpedit.msc解决方法


下一篇:Delphi GDI+实现水印功能