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
);
查看全文
相关阅读:
浏览器缓存机制
es6笔记(6) Iterator 和 for...of循环
es6笔记(3.1)三个点的“...”的作用
es6笔记(5)Map数据结构
es6笔记(4) Set数据结构
SpringBoot事件监听
SpringBoot入门
五大常用算法之三贪心算法
五种常用算法之二:动态规划算法
五大常用算法之一:分治算法
原文地址:https://www.cnblogs.com/zhangjun1130/p/1406265.html
最新文章
position_relative+absolute 搭配使用,实现绝对定位 放大缩小都不影响其绝对位置
用Python制作酷炫二维码
frp + 远程桌面 远程方式
django 后端JsonResponse返回json数据给前端完美接收
使用daphne部署django channles websocket 项目
Rust特征与泛型区别点
Rust多线程之数据共享
Mybatis 缓存 源码分析
mybatis执行过程分析
springBean的生命周期
热门文章
AutoConfigurationImportSelector到底怎么初始化
Java开发工具与HelloWorld
Java环境搭建
Java 简介
记一次线上事故
一张图搞懂Ajax原理
JavaScript作用域链
前端与HTTP
整理一下原生js的dom操作
CSSOM
Copyright © 2011-2022 走看看