• 大小: 943KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-08-14
  • 语言: C#
  • 标签: arcgis  engine  空间分析  

资源简介

c#开发的基于arcgis engine 的空间分析全部C#代码(不包含网络分析部分)

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.esriSystem;

using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.DataSourcesRaster;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.GeoAnalyst;
using System.Collections;
using ESRI.ArcGIS.SpatialAnalyst;

namespace WindowsApplication1
{
    public partial class Allocation : Form
    {
        public Allocation()
        {
            InitializeComponent();
        }

        public IMap pMap;
        public int layerIndex1 layerIndex2;
        string Filename;
        public IRasterlayer pRasterlayer = new RasterlayerClass();
        private void Allocation_Load(object sender EventArgs e)
        {
            comboBox1.Items.Clear();
            comboBox2.Items.Clear();
            int i layCount;
            layCount = pMap.layerCount;
            for (i = 0; i < layCount; i++)
            {
                comboBox1.Items.Add(pMap.get_layer(i).Name);
                comboBox2.Items.Add(pMap.get_layer(i).Name);
            }       
        }

        private void comboBox1_SelectedIndexChanged(object sender EventArgs e)
        {
            layerIndex1 = comboBox1.SelectedIndex;
        }

        private void comboBox2_SelectedIndexChanged(object sender EventArgs e)
        {
            layerIndex2 = comboBox2.SelectedIndex;
        }

        private void button3_Click(object sender EventArgs e)
        {
            saveFileDialog1.Filter = “IMAGINE|*.img“;
            saveFileDialog1.RestoreDirectory = true;

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Filename = saveFileDialog1.FileName;
                textBox1.Text = Filename;
            }
        }
        public IRasterlayer Allocation1(IRasterlayer sourceRasterlayer string maxDistance IFeaturelayer extentlayer string outputFileName)
        {
            if (System.IO.File.Exists(outputFileName))
            {
                System.IO.File.Delete(outputFileName);
            }

            IGeoDataset sourceRaster = sourceRasterlayer.Raster as IGeoDataset;

            IGeoDataset costRaster = extentlayer.FeatureClass as IGeoDataset;

            IDistanceOp2 distanceOp = new RasterDistanceOpClass();
            IRasterAnalysisEnvironment rasAnaEnv = distanceOp as IRasterAnalysisEnvironment;

            //设置生成图层的工作空间
            IWorkspaceFactory wsf = new RasterWorkspaceFactoryClass();
            string outputPath = System.IO.Path.GetDirectoryName(outputFileName);
            string fileName = System.IO.Path.GetFileName(outputFileName);
            IWorkspace ws = wsf.OpenFromFile(outputPath 0);
            rasAnaEnv.

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        946  2010-05-14 14:33  空间分析\WindowsApplication1.sln

    ..A..H.     68096  2010-09-15 12:19  空间分析\WindowsApplication1.suo

     文件       4814  2010-09-15 10:08  空间分析\WindowsApplication1\Allocation.cs

     文件       9055  2010-09-15 10:08  空间分析\WindowsApplication1\Allocation.Designer.cs

     文件       6017  2010-09-15 10:08  空间分析\WindowsApplication1\Allocation.resx

     文件       1914  2010-09-14 21:11  空间分析\WindowsApplication1\Aspect.cs

     文件       7050  2010-09-14 21:11  空间分析\WindowsApplication1\Aspect.Designer.cs

     文件       6017  2010-09-14 21:11  空间分析\WindowsApplication1\Aspect.resx

     文件       2437  2010-09-14 22:00  空间分析\WindowsApplication1\Contour.cs

     文件       8453  2010-09-14 22:00  空间分析\WindowsApplication1\Contour.Designer.cs

     文件       5814  2010-09-14 22:00  空间分析\WindowsApplication1\Contour.resx

     文件       4826  2010-09-15 10:04  空间分析\WindowsApplication1\Cost_Weighted.cs

     文件       8089  2010-09-15 10:04  空间分析\WindowsApplication1\Cost_Weighted.Designer.cs

     文件       6017  2010-09-15 10:04  空间分析\WindowsApplication1\Cost_Weighted.resx

     文件       2064  2010-09-14 21:13  空间分析\WindowsApplication1\Cut_Fill.cs

     文件       7387  2010-09-14 21:13  空间分析\WindowsApplication1\Cut_Fill.Designer.cs

     文件       5814  2010-09-14 21:13  空间分析\WindowsApplication1\Cut_Fill.resx

     文件       2593  2010-06-11 14:08  空间分析\WindowsApplication1\DataView.cs

     文件       2366  2010-06-11 14:08  空间分析\WindowsApplication1\DataView.Designer.cs

     文件       5814  2010-06-11 14:08  空间分析\WindowsApplication1\DataView.resx

     文件       6202  2010-09-15 10:08  空间分析\WindowsApplication1\Feature To Raster.cs

     文件      17397  2010-09-14 15:48  空间分析\WindowsApplication1\IDW.cs

     文件       8321  2010-09-14 15:48  空间分析\WindowsApplication1\IDW.designer.cs

     文件       7432  2010-09-14 15:48  空间分析\WindowsApplication1\IDW.resx

     文件       5266  2010-09-14 11:29  空间分析\WindowsApplication1\Kernel Density.cs

     文件       9361  2010-09-14 09:59  空间分析\WindowsApplication1\Kernel Density.designer.cs

     文件       6023  2010-09-14 09:59  空间分析\WindowsApplication1\Kernel Density.resx

     文件       6671  2010-09-14 15:30  空间分析\WindowsApplication1\Kriging.cs

     文件      13358  2010-09-14 15:28  空间分析\WindowsApplication1\Kriging.designer.cs

     文件       7432  2010-09-14 15:28  空间分析\WindowsApplication1\Kriging.resx

............此处省略107个文件信息

评论

共有 条评论