当前位置:网站首页>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);
}
}
边栏推荐
猜你喜欢
随机推荐
mongodb的shell脚本
Daily practice of PMP | Do not get lost in the exam-8.2 (including agility + multiple choice)
在线开启gtid偶发hang住的问题解决
pyspark df secondary sorting
从学生到职场的转变
【OpenCV】 - 显示图像API之imshow()对不同位深度(数据类型)的图像的处理方法
Shell脚本之一键安装mysql
DeFi明斯基时刻:压力测试与启示
Oracle Rac 集群文件目录迁移
用云机器/虚拟机架设方舟游戏?
请求与响应:响应
Oracle Rac Cluster File Directory Migration
前缀和(区间和,子矩阵的和)
@Async注解的坑,小心
10 分钟彻底理解 Redis 的持久化和主从复制
The use of the database table structure document generation tool screw
【云原生--Kubernetes】Pod重启策略
JS函数获取本月的第一天和最后一天
ORB-SLAM2提取特征点
伦敦银现货市场如何使用多条均线?









