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
);
查看全文
相关阅读:
S3C6410移植uboot2013.01
linux设备驱动中的并发控制
明年我多大?(20060119 16:38:41)(新浪)
冲动&当机立断(20060119 16:58:32)(新浪)
不能老是雜感,老婆說(20060901 13:14:50)(新浪)
最近比较烦(20061014 13:14:48)(新浪)
结婚(20060221 16:31:33)(新浪)
坐井观天的蛙(20060913 14:19:51)(新浪)
酒喝大了(20060105 18:41:55)(新浪)
不可越俎代庖(20060211 21:24:49)(新浪)
原文地址:https://www.cnblogs.com/zhangjun1130/p/1406265.html
最新文章
Session
Forms 认证
Web(6)
让div在页面居中的方法
关于java中的trycatchfinally语句和return
URL传递中文解决方案
提交表单乱码问题 action 中文接收的参数乱码
再次强调我写博客的目的
java编译器异常查看的方法
同样的CSS,放在HTML内和外部文件中,以及放在不同的目录时,效果就不一样了
热门文章
做程序员多年的经验总结
图形验证码的生成和破解
给OK6410配置新内核
tty_operations
tty_alloc_driver
S3C6410移植uboot2010.3(1)成功编译的开始
CTDIY3字符设备的内部实现
vim去行号
宿主机与开发板的文件交流
objdump and readelf
Copyright © 2011-2022 走看看