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 ...
随机推荐
- 最新版powerdesign16.5连接数据库错误解决
由于工作需要,需要将数据库中的表结构逆向生成到powerdesign中,但是连接数据库一直连接不上,Connection test failed报如下错误: 解决方案: 下载ojdbc14.jar,拷 ...
- Java 流(Stream)、文件(File)和IO
Java.io包几乎包含了所有操作输入.输出需要的类.所有这些流类代表了输入源和输出目标. Java.io包中的流支持很多种格式,比如:基本类型.对象.本地化字符集等等. 一个流可以理解为一个数据的序 ...
- Spark存储管理(读书笔记)
Spark存储管理(读书笔记) 转载请注明出处:http://www.cnblogs.com/BYRans/ Spark的存储管理 RDD的存放和管理都是由Spark的存储管理模块实现和管理的.本文从 ...
- WPF 提示框、确认框、确认输入框
1.提示框 分为提示.异常.失败.成功几种类型 方法: /// <summary> /// 弹出提示 /// 标题:提示 /// </summary> /// <para ...
- 005.nginx配置文件
1.替换nginx主配置文件 通过前面的配置,LNMP的环境已经搭建完成,现在我们替换nginx配置文件: [root@huh ~]# cd /usr/local/nginx/conf/[root@h ...
- 淘宝技术牛p博客整理
淘宝的技术牛人的博客http://blog.csdn.net/zdp072/article/details/19574793
- 今天主要推荐一下django学习的网址!
前言:每个月忙碌的头20天后,在上班时间投入到django理论学习的过程中,花了差不多3天时间简单的研究了一下django,着实废了我不少脑细胞. 采用虫师前辈的一张图和话: 如果你把这过程梳理清晰了 ...
- HTML中的div,section,article的区别
刚开始看到标签的就有些疑惑,觉得为什么有那么多相同用途的标签,多方查询资料细细比较之后才发现原来各有千秋,结合自己的想法总结如下: div在HTML早期版本就支持了,section和article是H ...
- 使用Ecplise git commit时出现"There are no stages files"
异常 解决方案 进入Window--Preferences--Team--Git--Committing,反选下图红圈部分: 保存后即可出线我们熟悉的提交代码界面啦:
- java操作Redis
需要使用如下jar包 <!-- https://mvnrepository.com/artifact/redis.clients/jedis --> <dependency> ...