Join Attributes
1.
IWorkspaceFactory2 workspaceFactory = new ShapefileWorkspaceFactoryClass() as IWorkspaceFactory2;
IWorkspace workspace = workspaceFactory.OpenFromFile(@"E:\", );
IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;
IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(“a”);
IFeatureClass featureClass2 = featureWorkspace.OpenFeatureClass( "b");
AddJoin aj = new AddJoin();
aj.in_field = "ID";
aj.in_layer_or_view = featureClass2; // @"E:\jhl\" + Functions.g_ROAD + "_SpatialJoin";
aj.join_field = "FID";
aj.join_table = @"E:\a.shp";
//aj.out_layer_or_view = Functions.g_ROAD + "_SpatialJoin";
aj.join_type = "KEEP_ALL";
Geoprocessor gp = new Geoprocessor();
//gp.OverwriteOutput = true;
gp.Execute(aj, null);
2.
//// Build a memory relationship class.
Type memRelClassFactoryType =Type.GetTypeFromProgID("esriGeodatabase.MemoryRelationshipClassFactory");
IMemoryRelationshipClassFactory memRelClassFactory = (IMemoryRelationshipClassFactory)Activator.CreateInstance(memRelClassFactoryType);
IRelationshipClass relationshipClass = memRelClassFactory.Open("a", featureClass2, "ID", (IObjectClass)featureClass,
"FID", "Is Owned By", "Owns",esriRelCardinality.esriRelCardinalityOneToOne);
// Open the RelQueryTable as a feature class.
Type rqtFactoryType =Type.GetTypeFromProgID("esriGeodatabase.RelQueryTableFactory");
IRelQueryTableFactory rqtFactory = (IRelQueryTableFactory)Activator.CreateInstance(rqtFactoryType);
ITable relQueryTable = (ITable)rqtFactory.Open(relationshipClass, false, null,null, string.Empty, false, false);
3.
// Create the query definition.
IQueryDef queryDef = featureWorkspace.CreateQueryDef();
// Provide a list of tables to join.
queryDef.Tables = "a,b";
queryDef.Tables += "";
// Set the subfields and the WhereClause (in this case, the join condition).
queryDef.SubFields = "*";
queryDef.WhereClause = "a.ID = b.FID + 1";
// Make the new TableQueryName.
IQueryName2 queryName2 = (IQueryName2)new TableQueryNameClass();
queryName2.QueryDef = queryDef;
queryName2.PrimaryKey = "ID";
queryName2.CopyLocally = true;
IDataset workspaceDataset = (IDataset)featureWorkspace;
IWorkspaceName workspaceName = (IWorkspaceName)workspaceDataset.FullName;
// Set the workspace and name of the new QueryTable.
IDatasetName datasetName = (IDatasetName)queryName2;
datasetName.WorkspaceName = workspaceName;
datasetName.Name = "Join";
// Open the virtual table.
IName name = (IName)queryName2;
ITable table = (ITable)name.Open();
Join Attributes的更多相关文章
- Arcgis, ArcEngine, Arcgis Server使用开发汇总 索引
ArcGIS系列软件license及安装: Arcgis SDE10.1 和 Arcgis server10.1的授权文件license tnt_esri.dat Arcgis8.1安装license ...
- HANA SQLScript
数据类型 日期时间类型 DATE(日期) DATE 数据类型由年.月.日信息组成,表示一个日期值. DATA 类型的默认格式为‘YYYY-MM-DD’. YYYY 表示年, MM 表示月而 DD 表示 ...
- HTML解析类 ,让你不使用正则也能轻松获取HTML相关元素 -C# .NET
功能: 1.轻松获取指元素HTML元素. 2.可以根据属性标签进行筛选 3.返回的都是Llist强类型无需转换 用过XElement的都知道 用来解析XML非常的方便,但是对于HTML的格式多样化实在 ...
- Octopus系列之开发过程各个技术点
自定义了页面周期 使用唯一的一个VelocityEngine全局的静态实例,优化了小泥鳅blog中每次请求都要创建VelocityEngine实例对象,减少了对象的开销 通过UA判断请求来自的设备,从 ...
- EMC题2
易安信笔试题分享:1 protected成员函数能被肿么调用2 “has-a” relationship是指的啥,答案有instance, reference, pointer等...3 int, c ...
- cratedb joins 原理(官方文档)
JOINs are essential operations in relational databases. They create a link between rows based on c ...
- Data Management Technology(2) -- Data Model
1.Data Model Model Is the abstraction of real world Reveal the essence of objects, help people to lo ...
- perl使用print输入数据到文件
#!usr/bin/perl use utf8; #引入utf8模块 脚本内的字符串使用utf8作为编码格式 binmode(STDOUT,":encoding(gbk)"); # ...
- Delete,Update与LEFT Join
UPDATE:UPDATE A SET ApproverID=NULL FROM [SH_MaterialApplyBuyBill] A LEFT JOIN [SH_MaterialApplyBuyB ...
随机推荐
- 机器学习实战笔记(Python实现)-00-readme
近期学习机器学习,找到一本不错的教材<机器学习实战>.特此做这份学习笔记,以供日后翻阅. 机器学习算法分为有监督学习和无监督学习.这本书前两部分介绍的是有监督学习,第三部分介绍的是无监督学 ...
- YII2 项目安装步骤及异常记录
项目环境: 操作系统:windows 7 版本管理:git 该项目我是在mac上面创建的,mac上面的环境也是一波三折啊!但我同事的环境是在windows上面,因为是前端同学,所以只好我再次操刀了.. ...
- GacUI学习(一)
GacUI学习(一)之高仿系统记事本(一) 转载请注明来源:http://www.cnblogs.com/lyfh/p/6107215.html GacUI是轮子哥(vczh)精心打造的跨平台C++转 ...
- Redis学习和环境搭建
基本的redis教程,搭建,可以参照下面任一教程: 地址一:http://www.yiibai.com/redis/redis_quick_guide.html 地址二:http://www.runo ...
- (转)java字节流和字符流的区别
转载: http://www.cnblogs.com/dolphin0520/category/361055.html 字节流与和字符流的使用非常相似,两者除了操作代码上的不同之外,是否还有其他的不同 ...
- HTTPS简述
Https是什么? HTTPS是Http Over SSL,简单来说就是HTTP的安全版本,在http之上使用TLS,SSL加密协议. HTTPS实质是在HTTP基础上使用非对称加密相互生成并传递对称 ...
- 洛谷P2412 查单词 [trie树 RMQ]
题目背景 滚粗了的HansBug在收拾旧英语书,然而他发现了什么奇妙的东西. 题目描述 udp2.T3如果遇到相同的字符串,输出后面的 蒟蒻HansBug在一本英语书里面找到了一个单词表,包含N个单词 ...
- iOS状态栏---学习笔记六
一.设置状态栏的颜色. //1.需要在自定义导航的时候,设置顶部视图 - (UIViewController *)childViewControllerForStatusBarStyle{ retur ...
- C语言实现线程池
以前写过一篇关于如何使用多线程推升推送速度(http://www.cnblogs.com/bai-jimmy/p/5177433.html),能够到达5000qps,其实已经可以满足现在的业务,不过在 ...
- Metasploit爆破tcpwrapped服务
转自:http://www.mamicode.com/info-detail-1653722.html 一.利用nmap工具扫描目标主机 1.1 使用nmap命令对目标主机进行扫描. 1.2 在终端中 ...