zoukankan
html css js c++ java
Merage
AE+C# 实现MERGE,
代码参考ESRI中国社区,忘了哪个帖子了。。。
代码中路径等直接写上去了
//
合并图层的集合
ILayer pLayer;
IArray pArray;
pArray
=
new
ArrayClass();
for
(
int
i
=
0
; i
<
this
.axMapControl1.LayerCount; i
++
)
{
pLayer
=
this
.axMapControl1.get_Layer(i);
pArray.Add(pLayer);
}
//
定义输出图层的fields表
ITable pTable;
IFeatureLayer pFeatureLayer;
IFeatureClass pFeatureClass;
pLayer
=
this
.axMapControl1.get_Layer(
0
);
pTable
=
(ITable)pLayer;
pFeatureLayer
=
(IFeatureLayer)pLayer;
pFeatureClass
=
pFeatureLayer.FeatureClass;
//
判断图层是否大于2个
if
(
this
.axMapControl1.LayerCount
<
2
)
{
MessageBox.Show(
"
Table QI failed
"
);
return
;
}
//
输出文件类型
IFeatureClassName pFeatureClassName;
IDatasetName pDatasetName;
IWorkspaceName pNewWSName;
pFeatureClassName
=
new
FeatureClassNameClass();
pFeatureClassName.FeatureType
=
esriFeatureType.esriFTSimple;
pFeatureClassName.ShapeFieldName
=
"
Shape
"
;
pFeatureClassName.ShapeType
=
pFeatureClass.ShapeType;
//
输出shapefile的名称和位置
pNewWSName
=
new
WorkspaceNameClass();
pNewWSName.WorkspaceFactoryProgID
=
"
esriDataSourcesFile.ShapefileWorkspaceFactory
"
;
pNewWSName.PathName
=
"
E:\\data
"
;
pDatasetName
=
(IDatasetName)pFeatureClassName;
pDatasetName.Name
=
"
Merge_result
"
;
pDatasetName.WorkspaceName
=
pNewWSName;
//
合并图层
IFeatureClass pOutputFeatClass;
IBasicGeoprocessor pBasicGeop;
pBasicGeop
=
new
BasicGeoprocessorClass();
pOutputFeatClass
=
pBasicGeop.Merge(pArray,pTable,pFeatureClassName);
//
将合并后的图层加载到Map中
IFeatureLayer pOutputFeatLayer;
pOutputFeatLayer
=
new
FeatureLayerClass();
pOutputFeatLayer.FeatureClass
=
pOutputFeatClass;
pOutputFeatLayer.Name
=
pOutputFeatClass.AliasName;
this
.axMapControl1.AddLayer(pOutputFeatLayer
as
ILayer,
0
);
查看全文
相关阅读:
点击鼠标后系统自动生成对应消息
mfc 鼠标、键盘响应事件
VC中键盘键的对应关系
补充知识及数据类型
Python入门
tomcat启动报错
正则表达式
MySQL修改root密码的方法
mysql 压缩包免安装版 安转步骤
springmvc--json--返回json的日期格式问题
原文地址:https://www.cnblogs.com/zhangjun1130/p/1406265.html
最新文章
入园的第一篇--where、where
GTID的主从复制的配置
传统的主从复制的配置
MySQL-5.6版本GTID的主从复制
传统的主从复制的概念和要点
关于mysql主从复制的概述与分类
mysql多实例的配置
mysql安装前的系统准备工作
mysql-5.6.22的安装步骤
【设计模式】之工厂模式
热门文章
【设计模式】之设计模式简介
(3.1)用ictclas4j进行中文分词,并去除停用词
(2.1)windows下Nutch1.7的安装
(1)文本倾向性分析综述
wap支付宝接口的问题
sqlserver Between And的问题
鼠标(画矩形事件)—不怎么样
RNG—随机数产生器
Opencv中Rect类
如何用OpenCV跟踪鼠标操作
Copyright © 2011-2022 走看看