C# ArcEngine 添加打开Shp矢量数据

上传人:飞****9 文档编号:131866373 上传时间:2020-05-10 格式:DOC 页数:2 大小:62.43KB
返回 下载 相关 举报
C# ArcEngine 添加打开Shp矢量数据_第1页
第1页 / 共2页
C# ArcEngine 添加打开Shp矢量数据_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《C# ArcEngine 添加打开Shp矢量数据》由会员分享,可在线阅读,更多相关《C# ArcEngine 添加打开Shp矢量数据(2页珍藏版)》请在金锄头文库上搜索。

1、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.Carto;using ESRI.ArcGIS.DataSourcesFile;using ESRI.ArcGIS.Geodatabase;private void 打开矢量数据ToolStripMenuItem

2、_Click(object sender, EventArgs e) OpenFileDialog file = new OpenFileDialog(); file.Filter = Shp文件|*.shp; if ( file.ShowDialog() = DialogResult.OK ) string path = file.FileName; string folder = System.IO.Path.GetDirectoryName(path); string filename = System.IO.Path.GetFileName(path); IWorkspaceFacto

3、ry wsf = new ShapefileWorkspaceFactory(); IWorkspace ws = wsf.OpenFromFile(folder,0); IFeatureWorkspace fws = ws as IFeatureWorkspace; IFeatureClass fc = fws.OpenFeatureClass(filename); IFeatureLayer fl = new FeatureLayer(); fl.FeatureClass = fc; fl.Name = fc.AliasName; axMapControl1.AddLayer(fl); axMapControl1.ActiveView.Refresh(); else return;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > IT计算机/网络 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号