• 大小: 76KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-01
  • 语言: C#
  • 标签: AE  加载  打开  矢量  栅格  

资源简介

C#+ArcEngine:加载打开Shp矢量和栅格数据

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.DataSourcesRaster;

namespace 加载打开Shp矢量和栅格数据
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void 打开矢量数据ToolStripMenuItem_Click(object sender EventArgs e)
        {
            //MapControl.Clearlayers();
            OpenFileDialog xjOpenShpFileDialog = new OpenFileDialog();
            xjOpenShpFileDialog.title = “打开矢量数据“;
            xjOpenShpFileDialog.Filter = “矢量文件(*.shp*.lyr)|*.shp;*.lyr“;

            if (xjOpenShpFileDialog.ShowDialog() == DialogResult.OK)
            {
                string ShpPath = xjOpenShpFileDialog.FileName;
                string ShpFolder = System.IO.Path.GetDirectoryName(ShpPath);
                string ShpFileName = System.IO.Path.GetFileName(ShpPath);
                //工作工厂+工作空间
                IWorkspaceFactory xjShpWsF = new ShapefileWorkspaceFactory();
                IFeatureWorkspace xjShpFWs = (IFeatureWorkspace)xjShpWsF.OpenFromFile(ShpFolder 0);
                //新建图层:要素+名称
                IWorkspace ShpWs = xjShpWsF.OpenFromFile(ShpFolder 0);
                //IFeatureWorkspace fws = ShpWs as IFeatureWorkspace;
                IFeatureClass xjShpFeatureClass = xjShpFWs.OpenFeatureClass(ShpFileName);
                IFeaturelayer xjShpFeaturelayer = new Featurelayer();
                xjShpFeaturelayer.FeatureClass = xjShpFeatureClass;
                xjShpFeaturelayer.Name = xjShpFeatureClass.AliasName;
                //加载刷新
                axMapControl1.Addlayer(xjShpFeaturelayer);
                axMapControl1.ActiveView.Refresh();
            }
        }

        private void 打开栅格数据ToolStripMenuItem_Click(object sender EventArgs e)
        {
            axMapControl1.ActiveView.Clear();
            OpenFileDialog RasterOpebFileDialog = new OpenFileDialog();
            RasterOpebFileDialog.title = “打开栅格数据“;
            RasterOpebFileDialog.Filter = “栅格数据(*.tiff;*.tif;*.jpep;*.jpg;*.png;*.bmp)|*.tiff;*.tif;*.jpep;*.jpg;*.png;*.bmp“;

            if (RasterOpebFileDialog.ShowDialog() == DialogResult.OK)
            {
                string RasterPath = RasterOpebFileDialog.FileName;
                string RasterFolder = System.IO.Path.GetDirectoryName(RasterPath);
                string RasterFileName = System.IO.Path.GetFileName(RasterPath);
                //工作空间(实例化)
                IWorkspaceFactory RasterWsF = new RasterWorkspaceFactory();
                IWorkspace RasterWs = RasterWsF.OpenFromFile(RasterFolder 0);
                IRasterWorkspace IRasterWs = RasterWs as IRasterWorkspace;//强制转换
                IRasterDataset IRasterDS = IRaster

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

     文件      26624  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\bin\Debug\加载打开Shp矢量数据.exe

     文件      28160  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\bin\Debug\加载打开Shp矢量数据.pdb

     文件      11600  2016-12-22 15:18  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\bin\Debug\加载打开Shp矢量数据.vshost.exe

     文件        490  2015-07-10 19:01  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\bin\Debug\加载打开Shp矢量数据.vshost.exe.manifest

     文件       3950  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\Form1.cs

     文件       8032  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\Form1.Designer.cs

     文件      10507  2016-12-22 15:16  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\Form1.resx

     文件     126628  2016-12-22 15:16  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7574  2016-12-22 15:18  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       4608  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       1560  2016-12-22 15:18  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\加载打开Shp矢量和栅格数据.csproj.FileListAbsolute.txt

     文件        975  2016-12-22 15:16  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\加载打开Shp矢量和栅格数据.csproj.GenerateResource.Cache

     文件       3191  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\加载打开Shp矢量和栅格数据.Form1.resources

     文件        180  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\加载打开Shp矢量和栅格数据.Properties.Resources.resources

     文件       1177  2016-12-22 15:16  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\加载打开Shp矢量数据.csproj.FileListAbsolute.txt

     文件        975  2016-12-22 15:14  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\加载打开Shp矢量数据.csproj.GenerateResource.Cache

     文件      26624  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\加载打开Shp矢量数据.exe

     文件      28160  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\加载打开Shp矢量数据.pdb

     文件        604  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\Program.cs

     文件       1386  2016-12-22 15:07  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\Properties\AssemblyInfo.cs

     文件       2912  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\Properties\Resources.Designer.cs

     文件       5612  2016-12-22 15:07  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\Properties\Resources.resx

     文件       1136  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\Properties\Settings.Designer.cs

     文件        249  2016-12-22 15:07  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\Properties\Settings.settings

     文件       6514  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\加载打开Shp矢量和栅格数据.csproj

     文件        941  2016-12-22 15:16  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据.sln

    ..A..H.     26624  2016-12-22 15:18  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据.suo

     目录          0  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug\TempPE

     目录          0  2016-12-22 15:17  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\obj\x86\Debug

     目录          0  2016-12-22 15:14  C#+ArcEngine:加载打开Shp矢量和栅格数据\加载打开Shp矢量和栅格数据\加载打开Shp矢量数据\bin\Debug

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

评论

共有 条评论