• 大小: 9.80M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-04-24
  • 语言: C#
  • 标签: 计算  

资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.DataSourcesGDB;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.esriSystem;
using System.Windows.Forms;
using ESRI.ArcGIS.DataSourcesRaster;

namespace 实习1
{
  public static  class Accessor
    {
        public static IFeaturelayer AddfileGDBfeatureclasstomapcontrol(string filePath string featureclassname)
        {
            try
            {
                IWorkspaceFactory pWorkspaceFactory = new FileGDBWorkspaceFactoryClass();
                IWorkspace pWorkspace = pWorkspaceFactory.OpenFromFile(filePath 0);
                IFeatureWorkspace pfws = pWorkspace as IFeatureWorkspace;
                IFeatureClass pFeatureclass = pfws.OpenFeatureClass(featureclassname);
                IFeaturelayer pFlayer = new FeaturelayerClass();
                pFlayer.FeatureClass = pFeatureclass;
                pFlayer.Name = featureclassname;
                return pFlayer;
            }
            catch (Exception es)
            {
                MessageBox.Show(es.ToString());
                return null;
            }
                
        }

        public static IRaster2 LoadRasterfromfileGDB(string workspacenamestring rastername)
        {
            try
            {
                 IWorkspaceFactory pWorkspaceFactory = new FileGDBWorkspaceFactoryClass();
                 IRasterWorkspaceEx prasterworkspaceEx = pWorkspaceFactory.OpenFromFile(workspacename 0) as IRasterWorkspaceEx;
                 IRasterDataset3 prasterDataset3 = prasterworkspaceEx.OpenRasterDataset(rastername) as IRasterDataset3;
                 IRaster2 praster = prasterDataset3.CreateFullRaster() as IRaster2;         
                 return praster;
            }
            catch (Exception es)
            {
                MessageBox.Show(es.ToString());//弹出错误信息
                return null;
            }
        }

    }
}


     



 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-12-21 11:04  .vs\
     目录           0  2020-12-21 11:04  .vs\实习1\
     目录           0  2020-12-21 11:04  .vs\实习1\v16\
     文件       68096  2020-12-28 09:28  .vs\实习1\v16\.suo
     文件        1127  2020-12-21 11:04  实习1.sln
     目录           0  2020-12-21 11:04  实习1\
     文件        2093  2020-12-23 09:50  实习1\Accessor.cs
     文件         189  2020-12-21 11:04  实习1\App.config
     目录           0  2020-12-21 11:04  实习1\bin\
     目录           0  2020-12-21 11:04  实习1\bin\Debug\
     文件      159744  2019-02-15 20:29  实习1\bin\Debug\ESRI.ArcGIS.ADF.Local.dll
     文件      661777  2019-02-15 17:59  实习1\bin\Debug\ESRI.ArcGIS.ADF.Local.xml
     文件      115200  2019-02-15 18:00  实习1\bin\Debug\ESRI.ArcGIS.AxControls.dll
     文件     2620416  2019-02-15 17:33  实习1\bin\Debug\ESRI.ArcGIS.Carto.dll
     文件     1671658  2019-02-15 13:53  实习1\bin\Debug\ESRI.ArcGIS.Carto.xml
     文件      591360  2019-02-15 18:00  实习1\bin\Debug\ESRI.ArcGIS.Controls.dll
     文件      302744  2019-02-15 13:53  实习1\bin\Debug\ESRI.ArcGIS.Controls.xml
     文件      150016  2019-02-15 17:22  实习1\bin\Debug\ESRI.ArcGIS.DataSourcesFile.dll
     文件       88626  2019-02-15 13:53  实习1\bin\Debug\ESRI.ArcGIS.DataSourcesFile.xml
     文件       69632  2019-02-15 17:22  实习1\bin\Debug\ESRI.ArcGIS.DataSourcesGDB.dll
     文件       88997  2019-02-15 13:53  实习1\bin\Debug\ESRI.ArcGIS.DataSourcesGDB.xml
     文件       19968  2019-02-15 17:25  实习1\bin\Debug\ESRI.ArcGIS.DataSourcesNetCDF.dll
     文件        9530  2019-02-15 13:53  实习1\bin\Debug\ESRI.ArcGIS.DataSourcesNetCDF.xml
     文件     1255424  2019-02-15 17:24  实习1\bin\Debug\ESRI.ArcGIS.DataSourcesRaster.dll
     文件     1006495  2019-02-15 13:53  实习1\bin\Debug\ESRI.ArcGIS.DataSourcesRaster.xml
     文件      397312  2019-02-15 17:17  实习1\bin\Debug\ESRI.ArcGIS.Display.dll
     文件      404308  2019-02-15 13:53  实习1\bin\Debug\ESRI.ArcGIS.Display.xml
     文件       72192  2019-02-15 17:41  实习1\bin\Debug\ESRI.ArcGIS.GeoAnalyst.dll
     文件       98798  2019-02-15 13:53  实习1\bin\Debug\ESRI.ArcGIS.GeoAnalyst.xml
     文件     1347072  2019-02-15 17:22  实习1\bin\Debug\ESRI.ArcGIS.Geodatabase.dll
     文件     1567584  2019-02-15 13:53  实习1\bin\Debug\ESRI.ArcGIS.Geodatabase.xml
............此处省略168个文件信息

评论

共有 条评论