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
);
查看全文
相关阅读:
java判断一个字符串是否包含某个字符
Java去掉Html标签的方法
如何转换成utf-8格式的,在jsp页面中正常显示换行
a标签设置手型
a标签置灰不可点击
校验手机号码格式
用JQuery 判断某个属性是否存在hasAttr的解决方法
验证手机号码 (包含166和199)
获取短信验证码倒计时
Noisy Channel模型纠正单词拼写错误
原文地址:https://www.cnblogs.com/zhangjun1130/p/1406265.html
最新文章
Ubuntu关闭进入screensaver模式
insserv: warning: script 'busybox-httpd' missing LSB tags and overrides
Ubuntu Core 网络配置
systemd设置静态IP
sudo with no password
apache php upload file
发放春节福利,ASP.NET Core断点续传
ASP.NET Core Web APi获取原始请求内容
SQL Server-聚焦什么时候用OPTION(COMPILE)呢?
SQL Server-聚焦WHERE Column = @Param OR @Param IS NULL有问题?
热门文章
SQL Server-聚焦sp_executesql执行动态SQL查询性能真的比exec好?
SQL Server-聚焦ROW_NUMBER VS TOP N性能
运行Vue在ASP.NET Core应用程序并部署在IIS上
一文为你详细讲解对象映射库【AutoMapper】所支持场景
通过SQL脚本导入数据到不同数据库避免重复导入三种方式
EntityFramework Core饥饿加载忽略导航属性问题
EntityFramework 6.x多个上下文迁移实现分布式事务
基础知识(C#语法、数据库SQL Server)回顾与总结
对接第三方平台JAVA接口问题推送和解决
项目2.0上线,回想过后杂谈总结基础回顾一番
Copyright © 2011-2022 走看看