ArcGIS Spatial Query
Creates a spatial query which performs a spatial search for features in the supplied feature class and has the option to also apply an attribute query via a where clause.
///<summary>Creates a spatial query which performs a spatial search for features in the supplied feature class and has the option to also apply an attribute query via a where clause.</summary>
///
///<param name="featureClass">An ESRI.ArcGIS.Geodatabase.IFeatureClass</param>
///<param name="searchGeometry">An ESRI.ArcGIS.Geometry.IGeometry (Only high-level geometries can be used)</param>
///<param name="spatialRelation">An ESRI.ArcGIS.Geodatabase.esriSpatialRelEnum (e.g., esriSpatialRelIntersects)</param>
///<param name="whereClause">A System.String, (e.g., "city_name = 'Redlands'").</param>
///
///<returns>An IFeatureCursor holding the results of the query will be returned.</returns>
///
///<remarks>Call the SpatialQuery method by passing in a reference to the Feature Class, a Geometry used for the search and the spatial operation to be preformed. An exmaple of a spatial opertaion would be intersects (e.g., esriSpatialRelEnum.esriSpatialRelContains). If you would like to return everything found by the spatial operation use "" for the where clause. Optionally a whereclause (e.g. "income > 1000") maybe applied if desired. The SQL syntax used to specify the where clause is the same as that of the underlying database holding the data.</remarks>
public ESRI.ArcGIS.Geodatabase.IFeatureCursor PerformSpatialQuery(ESRI.ArcGIS.Geodatabase.IFeatureClass featureClass, ESRI.ArcGIS.Geometry.IGeometry searchGeometry, ESRI.ArcGIS.Geodatabase.esriSpatialRelEnum spatialRelation, System.String whereClause)
{
// create a spatial query filter
ESRI.ArcGIS.Geodatabase.ISpatialFilter spatialFilter = new ESRI.ArcGIS.Geodatabase.SpatialFilterClass(); // specify the geometry to query with
spatialFilter.Geometry = searchGeometry; // specify what the geometry field is called on the Feature Class that we will be querying against
System.String nameOfShapeField = featureClass.ShapeFieldName;
spatialFilter.GeometryField = nameOfShapeField; // specify the type of spatial operation to use
spatialFilter.SpatialRel = spatialRelation; // create the where statement
spatialFilter.WhereClause = whereClause; // perform the query and use a cursor to hold the results
ESRI.ArcGIS.Geodatabase.IQueryFilter queryFilter = new ESRI.ArcGIS.Geodatabase.QueryFilterClass();
queryFilter = (ESRI.ArcGIS.Geodatabase.IQueryFilter)spatialFilter;
ESRI.ArcGIS.Geodatabase.IFeatureCursor featureCursor = featureClass.Search(queryFilter, false); return featureCursor;
}
ArcGIS Spatial Query的更多相关文章
- Python MongoDB Spatial Query
//引入Pymongo >>> from pymongo import MongoClient,GEO2D // 链接数据库gis >>> db = MongoCl ...
- ArcGIS中的查询
最近身体不适,静下心来看了一下以前收集的电子书.下面是<ArcGIS地理信息系统教程_第5版>(李玉龙)第5章“查询”的读书笔记. 1.查询的常见应用: 选择感兴趣的要素:查找哪些要素满足 ...
- ArcGIS Engine开发前基础知识(1)
ArcGIS二次开发是当前gis领域的一项重要必不可少的技能.下面介绍它的基本功能 一.ArcGIS Engine功能 在使用之前首先安装和部署arcgis sdk,(在这里不在赘述相关知识)可以实现 ...
- ArcGis学习教程免费版在线观看
ArcGis学习教程免费版在线观看 作者:池建 文章来源:清华大学出版社 点击数:150220 更新时间:2013-8-8 摘要:Arcgis学习视频教程根据书籍章节逐步讲解较为详细 ...
- ArcGIS教程:加权叠加
摘要 使用经常使用測量比例叠加多个栅格数据,并依据各栅格数据的重要性分配权重. 插图 插图中,两个输入栅格已又一次分类为 1 至 3 三种公共測量级别.为每一个栅格均分配了一个影响百分比.这些像元值与 ...
- SQL Server 2008空间数据应用系列九:使用空间工具(Spatial Tools)导入ESRI格式地图数据
转自:http://www.cnblogs.com/beniao/archive/2011/03/22/1989310.html 友情提示,您阅读本篇博文的先决条件如下: 1.本文示例基于Micros ...
- ArcGIS学习推荐基础教程摘录
###########-------------------摘录一--------------------------########### ***************************** ...
- 2013Esri全球用户大会之ArcGIS for Desktop
Q1:ArcGIS 10.2 for Desktop中有哪些新特性? 增强的质量和性能 扩展并行处理能力 许多软件质量的改进 优化的文件处理 ...
- ArcGIS教程:创建特征
摘要 创建由输入样本数据和一组栅格波段定义的类的 ASCII 特征文件. 使用方法 · 输出特征文件应使用扩展名 .gsg. · 输入栅格波段和输入栅格或要素样本数据必须具有重叠范围.将仅为公共区域计 ...
随机推荐
- Android Studio配置SVN 以及使用代码管理
一.Android Studio配置SVN Android Studio关联配置SVN非常easy,在Settings里面.找到Version Control->Subversion.在这个页面 ...
- IAR FOR STM8 学习笔记 固件库 GPIO
经过一番挣扎,还是决定使用官方的固件库了.. 从网上下一个STM8S的固件库,记得是FOR IAR的. 找到里面的IAR模板就可以开始用了. 这些都是直接写好的库函数,可以直接调用,但首先得先读懂,先 ...
- JXNU 新生选拔赛
1001 最小的数 Problem Description 定义一种正整数集合K,集合中有N个数,集合中元素Ki(1<=i<=N)是包含i个不同质因子的最小的数.因为Ki可能会很大,所以将 ...
- vue使用marked.js实现markdown转html并提取标题生成目录
html: <template> <div class="wrapper"> <div class="container"> ...
- numpy_basic
一.Numpy是什么 Numerical Python,数值的Python,补充了Python语言所欠缺的数值计算能力. Numpy是其它数据分析及机器学习库的底层库. Numpy完全标准C语言实现, ...
- 微信小程序实现一个简单的表格
wxml <view class="table"> <view class="tr bg-w"> <view class=&quo ...
- C#操作SQLite方法实例详解
用 C# 访问 SQLite 入门(1) CC++C#SQLiteFirefox 用 C# 访问 SQLite 入门 (1) SQLite 在 VS C# 环境下的开发,网上已经有很多教程.我也是从 ...
- UVA 11557 - Code Theft (KMP + HASH)
UVA 11557 - Code Theft 题目链接 题意:给定一些代码文本.然后在给定一个现有文本,找出这个现有文本和前面代码文本,反复连续行最多的这些文本 思路:把每一行hash成一个值.然后对 ...
- 关于android主线程异常NetworkOnMainThread不能訪问网络
今天在学习的过程中遇到了NetworkOnMainThread的异常,关于这个异常问题在android sdk 4.0版本号上,这个问题可能比較常见,查了许些资料大多都是大概解说原因,可是没有解说到详 ...
- Python 极简教程(十一)字典 dict
字典是以大括号标识,以键值对(key:value)的形式,无序,不可重复,可变的集合类型. 字典具有非常高效的读写效率. >>> d = {} # 创建一个空字典 >>& ...