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
);
查看全文
相关阅读:
HDU 5501
CF #324 DIV2 E题
CF #324 DIV2 C题
利用位操作实现加减运算(不用+ -号)
【Leetcode】120. 三角形最小路径和
删除排序链表中的重复元素
【python】二分查找
如何在不添加新数组的情况下移除元素?
三/四 数之和,双指针法,细节很多
【转】字符串相关操作
原文地址:https://www.cnblogs.com/zhangjun1130/p/1406265.html
最新文章
python tuple
取消pycharm 全局搜索
如何用sympy解微分方程
light-GBM
inverted-index的结构
模型选型
D-MAP I-MAP Perfect-MAP
pandas I/O
CF #EDU R1 E
CF #330 D2 E
热门文章
CF #330 C
CF #329 C
CF #329 D
HIHO 16 C
HIHO 16 B
CF #328div2 D
2015 Changchun Regional
CF #327 DIV2 D、E
hiho challenge 15 C题
HDU 5502
Copyright © 2011-2022 走看看