上传我的文档
下载
收藏
该文档贡献者很忙,什么也没留下。
下载此文档
正在努力加载中...
Cura详解使用教程
下载积分:3000
内容提示:Cura详解使用教程
文档格式:DOCX|
浏览次数:579|
上传日期: 03:20:07|
文档星级:
全文阅读已结束,如果下载本文需要使用
3000 积分
下载此文档
该用户还上传了这些文档
Cura详解使用教程
官方公共微信ArcEngine开发总结-(1)打开各种格式文件
来源:博客园
常用到的Arcengine加载数据的方法,包括shapefile、 raster、PersonalGeodatabase、FileGeodatabase、TIN、CAD、access数据表 ///
/// 打开ShapeFile文件
/// 文件路径
/// 文件名
/// IFeatureClass
public IFeatureClass GetShpFile(string filePath, string fileName)
IFeatureWorkspace featureW
IFeatureClass featureC
featureWorkspace = GetShapeWorkspace(filePath) as IFeatureW
featureClass = featureWorkspace.OpenFeatureClass(fileName);
featureClass =
ReleaseAE.ReleaseAEObject(featureWorkspace);
return featureC
/// 打开Raster文件(如果数据格式为是ESRI GRID,fileName不带后缀,若为tiff则带后缀.tif)
/// 文件路径
/// 文件名
/// IRaster
public IRaster GetRasterFile(string filePath, string fileName)
IRasterWorkspace2 rasterW
IRasterDataset rasterDataS
IRasterLayer rasterL
rasterWorkspace = GetRasterWorkspace(filePath) as IRasterWorkspace2;
rasterDataSet = rasterWorkspace.OpenRasterDataset(fileName);
rasterLayer = new RasterLayerClass();
rasterLayer.CreateFromDataset(rasterDataSet);
raster = rasterLayer.R
//ReleaseAE.ReleaseAEObject(rasterDataSet);
//ReleaseAE.ReleaseAEObject(rasterLayer);
ReleaseAE.ReleaseAEObject(rasterWorkspace);
/// 打开PersonalGeodatabase里的数据要素
/// mdb文件(带后缀.mdb)
/// 要素名
public IFeatureClass GetPersonalGeodatabase(string mdbFile, string featureName)
IFeatureWorkspace featureW
IFeatureClass featureC
workspaceFactory = new AccessWorkspaceFactoryClass();
featureWorkspace = workspaceFactory.OpenFromFile(mdbFile, 0) as IFeatureW
featureClass = featureWorkspace.OpenFeatureClass(featureName);
ReleaseAE.ReleaseAEObject(featureWorkspace);
ReleaseAE.ReleaseAEObject(workspaceFactory);
return featureC
/// 打开FileGeodatabase里的数据要素
/// gdb文件
/// 要素名
public IFeatureClass GetFileGeodatabase(string gdbFile, string featureName)
IFeatureWorkspace featureW
IFeatureClass featureC
workspaceFactory = new FileGDBWorkspaceFactoryClass();
featureWorkspace = workspaceFactory.OpenFromFile(gdbFile, 0) as IFeatureW
featureClass = featureWorkspace.OpenFeatureClass(featureName);
ReleaseAE.ReleaseAEObject(featureWorkspace);
ReleaseAE.ReleaseAEObject(workspaceFactory);
return featureC
/// 打开TIN文件
/// 文件路径
/// 文件名
public ITin GetTinFile(string tinFile, string fileName)
ITinWorkspace pTinW
workspaceFactory = new TinWorkspaceFactoryClass();
pTinWorkspace = workspaceFactory.OpenFromFile(tinFile, 0) as ITinW
pTin = pTinWorkspace.OpenTin(fileName);
ReleaseAE.ReleaseAEObject(pTinWorkspace);
ReleaseAE.ReleaseAEObject(workspaceFactory);
/// 打开CAD文件(featurename要带扩展名)
/// 文件路径
/// 文件名
/// featureClass
//public IFeatureClass GetCADFile(string cadFile, string featureName)
//IFeatureWorkspace featureW
//IFeatureClass featureC
//workspaceFactory = new CadWorkspaceFactoryClass();
//featureWorkspace = workspaceFactory.OpenFromFile(cadFile, 0) as IFeatureW
//featureClass = featureWorkspace.OpenFeatureClass(featureName);
//return featureC
/// 打开数据表格
/// 连接数据库字符串
public ITable GetRDBMS(string connectionString, string tableName)
IFeatureWorkspace featureW
workspaceFactory = new OLEDBWorkspaceFactoryClass();
IPropertySet pPropset = new PropertySetClass();
pPropset.SetProperties("CONNECTSTRING", connectionString);
featureWorkspace = workspaceFactory.Open(pPropset,0) as IFeatureW
pTable = featureWorkspace.OpenTable(tableName);
ReleaseAE.ReleaseAEObject(featureWorkspace);
ReleaseAE.ReleaseAEObject(pPropset);
/// 创建内存工作空间Name
/// 工作空间名称
/// 工作空间Name
public IWorkspaceName CreatMemoryWorkspaceName(string workspacename)
IWorkspaceName workspaceN
workspaceFactory = new InMemoryWorkspaceFactoryClass();
workspaceName = workspaceFactory.Create("d:\\", workspacename, null, 0);
ReleaseAE.ReleaseAEObject(workspaceFactory);
return workspaceN
/// 创建内存工作空间
/// 工作空间名称
/// 工作空间类型IWorkspace
public IWorkspace CreatMemoryWorkspace(string workspacename)
IWorkspaceName workspaceN
workspaceName = CreatMemoryWorkspaceName(workspacename);
name = workspaceName as IN
name.NameString =
workspace = name.Open() as IW
ReleaseAE.ReleaseAEObject(workspaceName);
ReleaseAE.ReleaseAEObject(name);
/// 创建本地磁盘矢量工作空间
public IWorkspace GetShapeWorkspace(string filePath)
workspaceFactory = new ShapefileWorkspaceFactoryClass();
workspace = workspaceFactory.OpenFromFile(filePath, 0);
ReleaseAE.ReleaseAEObject(workspaceFactory);
workspaceFactory =
public IWorkspaceName GetShapeWorkspaceName(string spaceName)
IWorkspaceName workspaceN
workspaceFactory = new ShapefileWorkspaceFactoryClass();
workspaceName = workspaceFactory.Create(Path.GetTempPath(), spaceName, null, 0);
ReleaseAE.ReleaseAEObject(workspaceFactory);
return workspaceN
/// 创建本地磁盘栅格工作空间
public IWorkspace GetRasterWorkspace(string filePath)
workspaceFactory = new RasterWorkspaceFactoryClass();
workspace = workspaceFactory.OpenFromFile(filePath, 0);
ReleaseAE.ReleaseAEObject(workspaceFactory);
免责声明:本站部分内容、图片、文字、视频等来自于互联网,仅供大家学习与交流。相关内容如涉嫌侵犯您的知识产权或其他合法权益,请向本站发送有效通知,我们会及时处理。反馈邮箱&&&&。
学生服务号
在线咨询,奖学金返现,名师点评,等你来互动总共14591条微博动态微博: 昨天&15:13&: 昨天&15:13&: 昨天&08:40&: 前天&10:54&: 3&天前&: 3&天前&: 4&天前&: 4&天前&: 5&天前&: 5&天前&: 6&天前&: 7&天前&: 7&天前&: 7&天前&:
站长推荐 /1
UG NX11.0***包大小:7.1G
下载速度较快,建议在用网不频繁时间段下载,以免影响你的工作。
UG NX11.0关键词:体验、新功能、解决***问题
Powered by