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
);
查看全文
相关阅读:
JS: 子项可以来回交换的两个下拉列表
DOM事件
DOM基础2——元素
DOM基础1
JS: 随机点名程序与万年历
G_S男女匹配算法(算法的第一个程序2016.09.19)
Java IO流详尽解析(大神之作)
细讲解JAVA中的IO流
c++运算符的优先级(收好不谢)
java程序——输出当月日历表
原文地址:https://www.cnblogs.com/zhangjun1130/p/1406265.html
最新文章
Linux线程编程之生产者消费者问题
嵌入式系统C编程之堆栈回溯(二)
嵌入式系统C编程之堆栈回溯
巧妙利用访问时间提取和重组代码的实践
嵌入式系统C编程之错误处理
1139 First Contact (30 分)
1138 Postorder Traversal (25 分)
1140 Look-and-say Sequence (20 分)
1141 PAT Ranking of Institutions (25 分)
1142 Maximal Clique (25 分)
热门文章
1143 Lowest Common Ancestor (30 分)
1145 Hashing
1144 The Missing Number (20 分)
1146 Topological Order (25 分)
1147 Heaps (30 分)
PHP时间格式
PHP: isset与empty的区别
学生选课数据库MySQL语句练习题45道
JS: 图片轮播模板——左右移动,点击编码移动,自动轮播
JS: 复选框——ALL与A、B、C(选中ALL同时选中各子项)
Copyright © 2011-2022 走看看