コード例 #1
0
        public Form1()
        {
            InitializeComponent();

            ToggleEndlessProgress.Execute();

            circularProgressItem11.IsRunning = true;
            circularProgress1.IsRunning      = true;
        }
コード例 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            ToggleEndlessProgress.Execute();
            circularProgress1.IsRunning = true;
            #region GP工具的使用
            //得到参数
            IFeatureLayer layer     = GetFeatureLayer((string)comboBox1.SelectedItem); //输入点要素
            string        Zfield    = (string)comboBox2.SelectedItem;                  //Z字段
            string        outRaster = textBox2.Text;                                   //输出栅格
            object        cellSize  = textBox3.Text;                                   //输出像元大小
            double        power     = double.Parse(textBox4.Text);                     //幂
            string        searchRadius;                                                //搜索半径
            if (radioButton1.Checked)
            {
                searchRadius = "RadiusVariable(" + textBox5.Text + "," + textBox6.Text + ")";
            }
            else
            {
                searchRadius = "RadiusFixed(" + textBox5.Text + "," + textBox6.Text + ")";
            }
            //实例化GP工具
            Geoprocessor gp = new Geoprocessor();
            gp.OverwriteOutput = true;
            //设置IDW参数
            Idw idw = new Idw();
            idw.in_point_features = layer;
            idw.z_field           = Zfield;
            idw.out_raster        = outRaster;
            idw.cell_size         = cellSize;
            idw.power             = power;
            idw.search_radius     = searchRadius;
            //执行GP工具
            IGeoProcessorResult results = (IGeoProcessorResult)gp.Execute(idw, null);
            #endregion
            circularProgress1.IsRunning = false;
            #region 运行完成之后的信息提示窗口
            balloonTipFocus.Enabled = true;

            DevComponents.DotNetBar.Balloon b = new DevComponents.DotNetBar.Balloon();
            b.Style = eBallonStyle.Alert;
            //b.CaptionImage = balloonTipFocus.CaptionImage.Clone() as Image;
            b.CaptionText    = "信息提示";
            b.Text           = "运行成功!";
            b.AlertAnimation = eAlertAnimation.TopToBottom;
            b.AutoResize();
            b.AutoClose        = true;
            b.AutoCloseTimeOut = 4;
            b.Owner            = this;
            b.Show(button3, false);
            #endregion
        }
コード例 #3
0
ファイル: Resample1.cs プロジェクト: dearLhz/MyDatapreMenu
        private void button2_Click(object sender, EventArgs e)
        {
            ToggleEndlessProgress.Execute();
            circularProgress1.IsRunning = true;
            #region GP工具的使用
            //得到参数
            string inRaster  = textBox4.Text; //输入栅格
            string outRaster = textBox1.Text; //输出栅格
            string cellSize;                  //输出栅格的像元大小
            if (radioButton1.Checked)
            {
                cellSize = textBox2.Text;
            }
            else
            {
                cellSize = textBox3.Text;
            }
            string resamplingType = (string)comboBox2.SelectedItem;//重采样技术

            //实例化GP工具
            Geoprocessor gp = new Geoprocessor();
            gp.OverwriteOutput = true;
            //设置重采样参数
            Resample resample = new Resample();
            resample.in_raster       = inRaster;
            resample.out_raster      = outRaster;
            resample.cell_size       = cellSize;
            resample.resampling_type = resamplingType;
            //执行GP工具
            IGeoProcessorResult results = (IGeoProcessorResult)gp.Execute(resample, null);
            #endregion
            circularProgress1.IsRunning = false;
            #region 运行完成之后的信息提示窗口
            balloonTipFocus.Enabled = true;

            DevComponents.DotNetBar.Balloon b = new DevComponents.DotNetBar.Balloon();
            b.Style = eBallonStyle.Alert;
            //b.CaptionImage = balloonTipFocus.CaptionImage.Clone() as Image;
            b.CaptionText    = "信息提示";
            b.Text           = "运行成功!";
            b.AlertAnimation = eAlertAnimation.TopToBottom;
            b.AutoResize();
            b.AutoClose        = true;
            b.AutoCloseTimeOut = 4;
            b.Owner            = this;
            b.Show(button2, false);
            #endregion
        }
コード例 #4
0
        private void button3_Click(object sender, EventArgs e)
        {
            ToggleEndlessProgress.Execute();
            circularProgress1.IsRunning = true;
            #region GP工具的使用
            //得到参数
            IRasterLayer layer       = GetRasterLayer((string)comboBox1.SelectedItem);
            string       field       = (string)comboBox2.SelectedItem;
            string       out_polygon = textBox1.Text;
            string       simplify;
            if (radioButton1.Checked)
            {
                simplify = radioButton1.Text;
            }
            else
            {
                simplify = radioButton2.Text;
            }
            //实例化GP工具
            Geoprocessor gp = new Geoprocessor();
            gp.OverwriteOutput = true;
            //设置矢量转栅格参数
            RasterToPolygon rastertopolygon = new RasterToPolygon();
            rastertopolygon.in_raster            = layer;
            rastertopolygon.out_polygon_features = out_polygon;
            rastertopolygon.raster_field         = field;
            rastertopolygon.simplify             = simplify;
            //执行GP工具
            IGeoProcessorResult results = (IGeoProcessorResult)gp.Execute(rastertopolygon, null);
            #endregion
            circularProgress1.IsRunning = false;
            #region 运行完成之后的信息提示窗口
            balloonTipFocus.Enabled = true;

            DevComponents.DotNetBar.Balloon b = new DevComponents.DotNetBar.Balloon();
            b.Style = eBallonStyle.Alert;
            //b.CaptionImage = balloonTipFocus.CaptionImage.Clone() as Image;
            b.CaptionText    = "信息提示";
            b.Text           = "运行成功!";
            b.AlertAnimation = eAlertAnimation.TopToBottom;
            b.AutoResize();
            b.AutoClose        = true;
            b.AutoCloseTimeOut = 4;
            b.Owner            = this;
            b.Show(button4, false);
            #endregion
        }
コード例 #5
0
ファイル: Spline1.cs プロジェクト: dearLhz/MyDatapreMenu
        private void button2_Click(object sender, EventArgs e)
        {
            ToggleEndlessProgress.Execute();
            circularProgress1.IsRunning = true;
            #region GP工具的使用
            //得到参数
            IFeatureLayer layer      = GetFeatureLayer((string)comboBox1.SelectedItem); //输入点要素
            string        Zfield     = (string)comboBox2.SelectedItem;                  //Z字段
            string        outRaster  = textBox1.Text;                                   //输出栅格
            object        cellSize   = textBox2.Text;                                   //输出像元大小
            string        splineType = (string)comboBox3.SelectedItem;                  //样条函数类型
            double        weight     = double.Parse(textBox3.Text);                     //权重
            int           numPoints  = int.Parse(textBox4.Text);                        //点数

            //实例化GP工具
            Geoprocessor gp = new Geoprocessor();
            gp.OverwriteOutput = true;
            //设置Spline参数
            Spline spline = new Spline();
            spline.in_point_features = layer;
            spline.z_field           = Zfield;
            spline.out_raster        = outRaster;
            spline.cell_size         = cellSize;
            spline.spline_type       = splineType;
            spline.weight            = weight;
            spline.number_points     = numPoints;
            //执行GP工具
            IGeoProcessorResult results = (IGeoProcessorResult)gp.Execute(spline, null);
            #endregion
            circularProgress1.IsRunning = false;
            #region 运行完成之后的信息提示窗口
            balloonTipFocus.Enabled = true;

            DevComponents.DotNetBar.Balloon b = new DevComponents.DotNetBar.Balloon();
            b.Style = eBallonStyle.Alert;
            //b.CaptionImage = balloonTipFocus.CaptionImage.Clone() as Image;
            b.CaptionText    = "信息提示";
            b.Text           = "运行成功!";
            b.AlertAnimation = eAlertAnimation.TopToBottom;
            b.AutoResize();
            b.AutoClose        = true;
            b.AutoCloseTimeOut = 4;
            b.Owner            = this;
            b.Show(button2, false);
            #endregion
        }
コード例 #6
0
        /// <summary>
        /// 确定BUTTON事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            ToggleEndlessProgress.Execute();
            circularProgress1.IsRunning = true;
            #region GP工具的使用
            //得到参数
            IFeatureLayer layer      = GetFeatureLayer((string)comboBox1.SelectedItem);
            string        field      = (string)comboBox2.SelectedItem;
            string        out_raster = textBox1.Text;
            object        cellSize   = textBox2.Text;
            //实例化GP工具
            Geoprocessor gp = new Geoprocessor();
            gp.OverwriteOutput = true;
            //设置矢量转栅格参数
            FeatureToRaster featuretoraster = new FeatureToRaster();
            featuretoraster.in_features = layer;
            featuretoraster.field       = field;
            featuretoraster.cell_size   = cellSize;
            featuretoraster.out_raster  = out_raster;
            //执行GP工具
            IGeoProcessorResult results = (IGeoProcessorResult)gp.Execute(featuretoraster, null);
            #endregion
            circularProgress1.IsRunning = false;
            #region 运行完成之后的信息提示窗口
            balloonTipFocus.Enabled = true;

            DevComponents.DotNetBar.Balloon b = new DevComponents.DotNetBar.Balloon();
            b.Style = eBallonStyle.Alert;
            //b.CaptionImage = balloonTipFocus.CaptionImage.Clone() as Image;
            b.CaptionText    = "信息提示";
            b.Text           = "运行成功!";
            b.AlertAnimation = eAlertAnimation.TopToBottom;
            b.AutoResize();
            b.AutoClose        = true;
            b.AutoCloseTimeOut = 4;
            b.Owner            = this;
            b.Show(button2, false);
            #endregion
        }
コード例 #7
0
ファイル: Project1.cs プロジェクト: dearLhz/MyDatapreMenu
        private void button3_Click(object sender, EventArgs e)
        {
            ToggleEndlessProgress.Execute();
            circularProgress1.IsRunning = true;
            #region GP工具的使用
            //得到参数
            IRasterLayer layer      = GetRasterLayer((string)comboBox1.SelectedItem);
            string       out_raster = textBox1.Text;
            //实例化GP工具
            Geoprocessor gp = new Geoprocessor();
            gp.OverwriteOutput = true;
            //设置栅格投影转换参数
            ProjectRaster PR = new ProjectRaster();
            PR.in_raster  = layer;
            PR.out_raster = out_raster;

            IEnvelope tempRaster = GetRasterLayer((string)comboBox2.SelectedItem).VisibleExtent;
            PR.out_coor_system = tempRaster.SpatialReference;

            //执行GP工具
            IGeoProcessorResult results = (IGeoProcessorResult)gp.Execute(PR, null);
            #endregion
            #region 运行完成之后的信息提示窗口
            balloonTipFocus.Enabled = true;

            DevComponents.DotNetBar.Balloon b = new DevComponents.DotNetBar.Balloon();
            b.Style = eBallonStyle.Alert;
            //b.CaptionImage = balloonTipFocus.CaptionImage.Clone() as Image;
            b.CaptionText    = "信息提示";
            b.Text           = "运行成功!";
            b.AlertAnimation = eAlertAnimation.TopToBottom;
            b.AutoResize();
            b.AutoClose        = true;
            b.AutoCloseTimeOut = 4;
            b.Owner            = this;
            b.Show(button3, false);
            #endregion
        }
コード例 #8
0
ファイル: Project1.cs プロジェクト: dearLhz/MyDatapreMenu
        private void button5_Click(object sender, EventArgs e)
        {
            ToggleEndlessProgress.Execute();
            circularProgress1.IsRunning = true;
            #region GP工具的使用
            //得到参数
            IFeatureLayer layer       = GetFeatureLayer((string)comboBox3.SelectedItem);
            string        out_feature = textBox2.Text;
            //实例化GP工具
            Geoprocessor gp = new Geoprocessor();
            gp.OverwriteOutput = true;
            //设置矢量投影转换参数
            Project pro = new Project();
            pro.in_dataset  = layer;
            pro.out_dataset = out_feature;
            IEnvelope tempfeature = GetFeatureLayer((string)comboBox4.SelectedItem).AreaOfInterest;
            pro.out_coor_system = tempfeature.SpatialReference;
            //执行GP工具
            IGeoProcessorResult results = (IGeoProcessorResult)gp.Execute(pro, null);
            #endregion
            #region 运行完成之后的信息提示窗口
            balloonTipFocus.Enabled = true;

            DevComponents.DotNetBar.Balloon b = new DevComponents.DotNetBar.Balloon();
            b.Style = eBallonStyle.Alert;
            //b.CaptionImage = balloonTipFocus.CaptionImage.Clone() as Image;
            b.CaptionText    = "信息提示";
            b.Text           = "运行成功!";
            b.AlertAnimation = eAlertAnimation.TopToBottom;
            b.AutoResize();
            b.AutoClose        = true;
            b.AutoCloseTimeOut = 4;
            b.Owner            = this;
            b.Show(button5, false);
            #endregion
        }