sde

ArcEngine 导出图层(shp)

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/Good_liu_simalb/archive/2010/07/21/5752967.aspx

private void shpToolStripMenuItem_Click(object sender, EventArgs e)         {             SaveFileDialog dlg = new SaveFileDialog();             if (DialogResult.OK == dlg.ShowDialog())             {                 string file = dlg.FileName.Substring(0, dlg.FileName.LastIndexOf(‘\\‘));                 if (!System.IO.Directory.Exists(file))                 {                     System.IO.Directory.CreateDirectory(file);                 }                 try                 {                     ILayer pLayer = axMapControl1.Map.get_Layer(0);                     if (pLayer != null)                     {                         IFeatureLayer pFeatureLayer = pLayer as IFeatureLayer;                         if (pFeatureLayer.Visible)                         {                             ExportFeature(pFeatureLayer.FeatureClass,dlg.FileName);                         }                     }                     MessageBox.Show("导出成功");                 }                 catch                 {                     MessageBox.Show("导出失败!");                 }             }         }

private void ExportShp()         {             SaveFileDialog dlg = new SaveFileDialog();             if (DialogResult.OK == dlg.ShowDialog())             {                 string file = dlg.FileName.Substring(0, dlg.FileName.LastIndexOf(‘\\‘));                 if (!System.IO.Directory.Exists(file))                 {                     System.IO.Directory.CreateDirectory(file);                 }                 try                 {                     ILayer pLayer = axMapControl1.Map.get_Layer(1);                     if (pLayer != null)                     {                         IFeatureLayer pFeatureLayer = pLayer as IFeatureLayer;                         if (pFeatureLayer.Visible)                         {                             ExportFeature(pFeatureLayer.FeatureClass, dlg.FileName);                         }                     }                     MessageBox.Show("导出成功");                 }                 catch                 {                     MessageBox.Show("导出失败!");                 }             }         }

public void ExportFeature(IFeatureClass pInFeatureClass,string pPath)         {             // create a new Access workspace factory                    IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactoryClass();             string parentPath=pPath.Substring(0, pPath.LastIndexOf(‘\\‘));             string fileName= pPath.Substring(pPath.LastIndexOf(‘\\‘) + 1, pPath.Length - pPath.LastIndexOf(‘\\‘) - 1);             IWorkspaceName pWorkspaceName = pWorkspaceFactory.Create(parentPath,fileName, null, 0);             // Cast for IName                    IName name = (IName)pWorkspaceName;             //Open a reference to the access workspace through the name object                    IWorkspace pOutWorkspace = (IWorkspace)name.Open();

IDataset pInDataset = pInFeatureClass as IDataset;             IFeatureClassName pInFCName = pInDataset.FullName as IFeatureClassName;             IWorkspace pInWorkspace = pInDataset.Workspace;             IDataset pOutDataset = pOutWorkspace as IDataset;             IWorkspaceName pOutWorkspaceName = pOutDataset.FullName as IWorkspaceName;             IFeatureClassName pOutFCName = new FeatureClassNameClass();             IDatasetName pDatasetName = pOutFCName as IDatasetName;             pDatasetName.WorkspaceName = pOutWorkspaceName;             pDatasetName.Name = pInFeatureClass.AliasName;             IFieldChecker pFieldChecker = new FieldCheckerClass();             pFieldChecker.InputWorkspace = pInWorkspace;             pFieldChecker.ValidateWorkspace = pOutWorkspace;             IFields pFields = pInFeatureClass.Fields;             IFields pOutFields;             IEnumFieldError pEnumFieldError;             pFieldChecker.Validate(pFields, out pEnumFieldError, out pOutFields);             IFeatureDataConverter pFeatureDataConverter = new FeatureDataConverterClass(); pFeatureDataConverter.ConvertFeatureClass(pInFCName, null, null, pOutFCName, null, pOutFields, "", 100, 0);         }

时间: 2024-08-30 16:13:45

sde的相关文章

微软职位内部推荐-SENIOR SDE

微软近期Open的职位: SENIOR DEVELOPMENT ENGINEER:The Enterprise Commerce (ECIT) Engineering Team holds the mission for delivering millions of transactions and one great experience for the core licensing areas of Microsoft. Our mission statement is to "Delive

使用SDE连接Postgre或者SqlServer数据库发布要素地图服务方法

使用SDE连接Postgre数据库或者SqlServer发布要素服务两种方式:1.直接创建一个Geographic DataBase,gdb里面建好图层和属性表,然后在ArcCatalog的数据库连接工具中打开创建好的Postgre或者sqlserver数据库,把gdb里面的表添加进去.2.先在数据库管理工具中创建好数据库和表结构,然后在ArcCatalog中用数据库连接工具打开,在里面再将需要创建图层的表字段导入到空的图形表里面.3.通过步骤1,2创建好数据库后,在ArcGIS中配置地图,发布

微软职位内部推荐-SDE

微软近期Open的职位: Organization Summary: Engineering, Community & Online (ECO) is looking for a great "Software Development Engineer" to join our team. Customersupport is a strategic differentiator for Microsoft and we are investing deeply to prov

向SDE图层中添加大量数据时,出现ORA-00604以及ORA-01000的解决办法

转自原文 向SDE图层中添加大量数据时,出现ORA-00604以及ORA-01000的解决办法 写了一个小程序,从一个列表中读取坐标串,每个坐标串生成一个IPolygon,然后将这些Polygon添加到一个SDE图层中, 向SDE中添加要素的初始代码类似下面: IWorkspaceEdit workspaceEdit = (IWorkspaceEdit)workspace; workspaceEdit.StartEditing(true); workspaceEdit.StartEditOper

创建SDE表空间

创建空间数据存储类型为ST_Geometry的要素类有2种方法:1)使用SDE创建要素类从9.3 开始,默认创建的要素类都使用ST_Geometry存储空间数据,9.3 版本之前,可以通过配置dbtune参数来完成.2)直接使用SQL语句创建要素类.1. 首先使用sqlplus连接到oracle服务器,确保登陆用户有如下权限:CREATE TYPEUNLIMITED TABLESPACECREATE LIBRARYCREATE OPERATORCREATE INDEXTYPECREATE PUB

Oracle以及SDE维护常用命令-查看表空间等

之前现场反馈一个数据更新的问题,查看感觉是因为表空间满了导致的(错误在之前的博客随笔中写过),因此远程对服务器进行查看.个人平常都是通过Oracle客户端的Entreprise Manager Console进行查看的,但是发现服务器上只安装了Oracle服务端并且不能正常进行网页登录查看. 因此到网上查了一下查看Oracle表空间使用情况的查询语句,通过PLSQL进行查询查看,在这里记录一下,另外附几个常用的Oracle以及SDE命令. 查看表空间的使用情况(解决此次问题使用) select

又来了,SDE非直连

现在sde都推荐直连了,没想到还是遇到了非直连. 用10.1默认是直连,但还支持非直连. 安装半天始终无法启动.系统差点崩了. 原来是sde用户密码过期锁定了,好烦. C:\Program Files\ArcGIS\ArcSDE\ora11gexe\etc\sde_esri_sde.log 报错如下: ------------------------------------------------------- ArcSDE 10.1 for Oracle11g Build 679 Thu Ap

解决ArcGIS中因SDE或数据库配置问题而导致服务荡掉的一种思路

1.背景 最近连续有两个项目现场出现了AGS服务荡掉的问题,一个是通州现场,一个是福州现场. 1.1通州现场的问题描述和解决思路 通州现场环境为ArcGIS9.2,使用IMS发布的地图服务,其问题表现为每隔两天左右,其地形图服务便会崩溃一次,重启地形图服务后地图可以正常显示. 因为IMS中地图的出图为动态出图,所以其出图时需要通过连接SDE,此问题的出现很可能是SDE中最大连接数的问题. 1.2福州现场的问题描述和解决思路 福州现场环境为ArcGIS10.0,使用的ArcGIS Server发布

微软职位内部推荐-Senior SDE for Win Shell Exp

微软近期Open的职位: Job posting title: Senior Software Development Engineer Location: China, Beijing Division: Operations System Group Engineering Group Overview OSG is delivering flagship products in Microsoft. China is a second largest economy in the worl

微软职位内部推荐-Senior SDE for Cloud Platform

微软近期Open的职位: Microsoft Launched the public cloud service-Azure in China on May 2013, Cosmos is the key component to Azure which support the platform of public cloud.Cosmos is a massively-parallel supercomputer comprised of tens of thousands of commod