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
);
查看全文
相关阅读:
ObjectiveC 日记①
C# WPF vs WinForm
Ext.Net之 GridPanel Excel导出方法实现
C 温故知新 之 指针:函数指针变量、指针型函数
C 温故知新 之 指针:基本概念&变量的指针和指向变量的指针
C 温故知新 之 指针:数组指针、字符串指针、函数指针
Linq之 推迟查询 VS 立即查询
Windows 下搭建ObjectiveC 开发环境
(转) ObjectiveC 日记② 关于self用法
windows phone 8 开发环境详细图解
原文地址:https://www.cnblogs.com/zhangjun1130/p/1406265.html
最新文章
dudu
尝试安装VS2008正式版成功!!
捅了个漏子,制造了些压力~
程序员的出路在哪?
写程序一定要细心啊!
DotNet程序员是不是最不幸福?
互联网盈利模式
微软新技术
使用zend studio配置Xdebug调试PHP教程
Scenarios that could cause deadlocks in MySQL
热门文章
关于SIP的源码地址
Memcached查看和清理
PHP中error_reporting()函数的用法(修改PHP屏蔽错误)
PHP5环境下Zend Debugger安装配置详解
mysql 存储过程 参数 没有数组的处理方式
查看用户权限与GRANT用法
官方发布新版zend debugger支持zend studio 7.0和php5.3
Ubuntu下Memcache的安装与基本使用
Python最简编码规范
C#运算符重载(操作符重载)
Copyright © 2011-2022 走看看