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
);
查看全文
相关阅读:
为什么要使用href=”javascript:void(0);”
切图要点
css属性学习
CentOS7使用yum安装RabbitMQ
Linux下,root权限才能启动1024以下端口的程序
Gitlab备份和恢复操作记录
rpm批量卸载所有带有Java的文件
如何使用微软官方工具制作win10启动盘
重装系统时,将MBR分区转为GPT 分区
walle 2.0 上线部署
原文地址:https://www.cnblogs.com/zhangjun1130/p/1406265.html
最新文章
C# 导出XML文件
Ext MVC 增删改 【公司用】
Ext MVC 后台链接数据库查询的方法 【公司用】
筱玛的快乐_牛客网
929. Unique Email Addresses
771. Jewels and Stones
A_B_Good Bye 2018_cf
判断二进制半整数_牛客网
(AB)Codeforces Round #528 (Div. 2, based on Technocup 2019 Elimination Round
CF_2018-2019 Russia Open High School Programming Contest (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
热门文章
Codeforces Round #524 (Div. 2)
Educational Codeforces Round 52 (Rated for Div. 2)
动态规划_01背包_一维数组_记录路径
css3中变形处理
背景与边框的相关样式
盒样式相关
css3文字与字体的相关样式
使用选择器在页面中插入内容
CSS3选择器
项目实训笔记
Copyright © 2011-2022 走看看