当前位置:网站首页>ArcEngine(一)加载矢量数据
ArcEngine(一)加载矢量数据
2022-08-03 07:28:00 【稻田里展望者】
利用MarControl控件添加矢量数据
private void 加载矢量数据ToolStripMenuItem_Click(object sender, EventArgs e)
{
//打开文件对话框
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Title = "加载shapefile数据";//设置title
openFileDialog.Filter = "(*.shp)|*.shp";//设置过滤模式
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
//设置路径
string fullPath = openFileDialog.FileName;//全部路径
string path = fullPath.Substring(0,fullPath.LastIndexOf("\\"));//截取字符串:除了名称之前的数据
string name = fullPath.Substring(fullPath.LastIndexOf("\\")+1);//一直截取到末尾
//添加图层
MapControl.AddShapeFile(path, name);
//刷新底图
MapControl.Refresh();
MessageBox.Show("文件加载成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
边栏推荐
猜你喜欢
随机推荐
面试介绍项目经验(转)
(十四)51单片机——LCD1602实现滚动效果
薛定谔的对象属性判断
“碳中和”愿景下,什么样的数据中心才是我们需要的?
mongodb的shell脚本
ORB-SLAM2提取特征点
【多线程进阶】--- 常见锁策略,CAS,synchronized底层工作原理,JUC,线程安全的集合类,死锁
Karatsuba大数乘法的Verilog实现
从学生到职场的转变
帆软11版本参数联动为null查询全部
品牌方发行NFT时,应如何考量实用性?
LeetCode 264:丑数
10 分钟彻底理解 Redis 的持久化和主从复制
【第1天】SQL快速入门-基础查询(SQL 小虚竹)
consul理解
神经网络原理及代码实现
分布式数据库数据一致性的原理、与技术实现方案
002-字段不为null
The use of the database table structure document generation tool screw
【着色器实现Glow可控局部发光效果_Shader效果第十三篇】