Joining data
Joining data追加的字段来自一个或多个表。ArcGIS提供加入数据的几种方法,这取决于数据的来源和数据的基数。本主题介绍了可用的选项,以及如何决定哪个选项是最好的应用程序。
// Create the query definition.
IQueryDef queryDef = featureWorkspace.CreateQueryDef();// Provide a list of tables to join.
queryDef.Tables = "streets, altname";// Set the subfields and the WhereClause (in this case, the join condition).
queryDef.SubFields = "streets.NAME, streets.TYPE, altname.ST_NAME, altname.ST_TYPE";
queryDef.WhereClause = "streets.OBJECTID = altname.JOINID";// Get a cursor of the results and find the indexes of the fields to display.
using (ComReleaser comReleaser = new ComReleaser())
{ ICursor cursor = queryDef.Evaluate();comReleaser.ManageLifetime(cursor);int streetsNameIndex = cursor.FindField("streets.NAME");int streetsTypeIndex = cursor.FindField("streets.TYPE");int altnameNameIndex = cursor.FindField("altname.ST_NAME");int altnameTypeIndex = cursor.FindField("altname.ST_TYPE");// Use the cursor to step through the results, displaying the names and altnames of each // street.IRow row = null;while ((row = cursor.NextRow()) != null){Console.WriteLine("Street name: {0} {1}. - Alt. name: {2} {3}.", row.get_Value(streetsNameIndex),row.get_Value(streetsTypeIndex), row.get_Value(altnameNameIndex), row.get_Value(altnameTypeIndex));}
}
// Make the new TableQueryName.
IQueryName2 queryName2 = (IQueryName2)new TableQueryNameClass();
queryName2.QueryDef = queryDef;
queryName2.PrimaryKey = "streets.StreetID";
queryName2.CopyLocally = true;// Set the workspace and name of the new QueryTable.
IDatasetName datasetName = (IDatasetName)queryName2;
datasetName.WorkspaceName = workspaceName;
datasetName.Name = "StreetsJoin";// Open the virtual table.
IName name = (IName)queryName2;
ITable table = (ITable)name.Open();
// Build a memory relationship class.
Type memRelClassFactoryType = Type.GetTypeFromProgID("esriGeodatabase.MemoryRelationshipClassFactory");
IMemoryRelationshipClassFactory memRelClassFactory = (IMemoryRelationshipClassFactory)Activator.CreateInstance(memRelClassFactoryType);
IRelationshipClass relationshipClass = memRelClassFactory.Open("ParcelsOwners", parcelsFeatureClass,"PARCEL_ID", (IObjectClass)ownersTable, "PARCEL_ID", "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);
Joining data相关推荐
- 10. Joining Data with dplyr in R
文章目录 1. Joining Tables 1.1 The inner_join verb (video) 1.2 What columns would you join on? 1.3 Joini ...
- hadoop data join
概念: Hadoop有一个叫DataJoin的包为Data Join提供相应的框架.它的Jar包存在于contrib/datajoin/hadoop-*-datajoin. 为区别于其他的data j ...
- r语言中mpg数据_R语言数据筛选整理包dplyr
dplyr软件包是R中功能最强大,最受欢迎的软件包之一.该软件包由最受欢迎的R程序员Hadley Wickham编写,他编写了许多有用的R软件包,如ggplot2,tidyr等.本文包括一些示例和如何 ...
- 机器学习算法如何应用于控制_将机器学习算法应用于NBA MVP数据
机器学习算法如何应用于控制 A step-by-step tutorial in R R中的分步教程 1引言 (1 Introduction) This blog makes up the Machi ...
- sql横着连接起来sql_SQL联接的简要介绍(到目前为止)
sql横着连接起来sql SQL Join是什么意思? (What does a SQL Join mean?) A SQL join describes the process of merging ...
- 面向Tableau开发人员的Python简要介绍(第4部分)
用PYTHON探索数据 (EXPLORING DATA WITH PYTHON) Between data blends, joins, and wrestling with the resultin ...
- 面向Tableau开发人员的Python简要介绍(第3部分)
用PYTHON探索数据 (EXPLORING DATA WITH PYTHON) One of Tableau's biggest advantages is how it lets you swim ...
- redshift 数据仓库_您如何使用Amazon Redshift Spectrum访问“暗数据”
redshift 数据仓库 by Lars Kamp 通过拉斯·坎普 您如何使用Amazon Redshift Spectrum访问"暗数据" (How you can acces ...
- D3 Selections
https://github.com/d3/d3/blob/master/API.md#selections-d3-selection 1.Selecting Elements 方法 描述 d3.se ...
最新文章
- 转 UIAlertView 不显示、屏幕变灰
- vue-cli3 环境设置
- html设置导入字体样式表,HTML CSS@face 导入字体
- linux系统编程之(一) 信号量
- 基于词典和朴素贝叶斯中文情感倾向分析算法
- C++ 读取和写入txt文件
- “Java:詹姆斯?”
- java打印日历至Excel_如何利用Excel打印漂亮的工作日历
- 【antdesign】表单布局和校验
- word去掉自动编号格式但保留原编号内容(宏命令)
- CTO(技术总监)平时都在做些什么?
- 信息安全技术网络安全等级保护基本要求-结构变化
- pikachu SQL 注入(皮卡丘漏洞平台通关系列)
- python函数进阶小结_python函数的进阶
- win7系统ntp时间服务器,win7与内部ntp服务器同步时间出来错误【NTP时间同步服务器】...
- E22-400M22S(SX1268) CubeMX HAL
- 感知器算法(perceptron algorithm)
- C#:实体框架EF(entity framework)
- 编写价格排序程序C语言,C语言程序简单例子
- 英语语法---连接词详解
热门文章
- 树莓派是网盘?nextcloud在树莓派上的应用
- 中国科学院计算机专业职称,中国科学院关于高级工程师职务分级的意见
- 如何教会爸妈用智能手机?方法比耐心重要,get这份手绘板说明书!
- Keil中部分Error Warning解决方法记录
- 中国移动支付线下交易扩大,支付服务角逐趋热
- 计算机视觉(相机标定)-1.1-针孔摄像机透镜
- 第四章 linux字符设备的编写一
- 嫌我的键盘的backspace太小,就尝试了一下改键工具--keyTweak
- unraid虚拟linux系统,UNRAID教程:3分钟用unraid自带的虚拟机安装黑群晖NAS DSM系统很强大!...
- SiT2020:抗冲击抗振动宽温振荡器,1-110MHz之间频率,SOT23-5封装