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. · 输入栅格波段和输入栅格或要素样本数据必须具有重叠范围.将仅为公共区域计 ...
随机推荐
- JNDI学习总结(3)——Tomcat下使用C3P0配置JNDI数据源
一.C3P0下载 C3P0下载地址:http://sourceforge.net/projects/c3p0/files/?source=navbar 下载完成之后得到一个压缩包. 二.使用C3P0配 ...
- 【Material Design视觉设计语言】应用样式设计
作者:郭孝星 微博:郭孝星的新浪微博 邮箱:allenwells@163.com 博客:http://blog.csdn.net/allenwells Github:https://github.co ...
- POJ 1442 Black Box treap求区间第k大
题目来源:POJ 1442 Black Box 题意:输入xi 输出前xi个数的第i大的数 思路:试了下自己的treap模版 #include <cstdio> #include < ...
- 写了个去重复文件的 PHP 脚本,
写了个去重复文件的 PHP 脚本点击打开链接 把各个零散网盘.邮箱和服务器上的文件,三台电脑上的文件收集在新硬盘里,然后清空了网络和电脑上的文件.才发现这个文件不能这里放点,那里存点,到时候不知道在哪 ...
- Android手机间使用socket进行文件互传实例
这是一个Android手机间文件传输的例子,两个手机同时装上此app,然后输入接收端的ip,选择文件,可以多选,点确定,就发送到另一个手机,一个简单快捷文件快传实例.可以直接运用到项目中. 下面是文件 ...
- jquery实现转盘抽奖
jquery实现转盘抽奖 一.总结 一句话总结:这里环形转盘,环形的东西可以化成线性的,然后访问到哪个,给他加上背景为红的样式,用定时器开控制转盘的速度,函数执行的时间间隔越小,就运动的越快. 1.如 ...
- 纯C++实现的HTTP请求封装(POST/GET)
纯C++实现的HTTP请求(POST/GET),支持windows和linux, 进行简单的封装, 方便调用.实现如下: #include "HttpConnect.h" #ifd ...
- Python *的下载、安装和使用
最近正在学习机器学习和深度学习,需要python,大家都知道,它是这些领域的入门语言,不多说,直接上干货!突然发现python比java好玩多了 下面就开始python的安装以及测试,python2. ...
- Android基于xmpp的即时通讯应用
xmpp是一个通信协议.因为这是个开放的协议,为了节俭开发成本,很多即时应用都采用了这个协议.Android上最常用的组合asmack +openfire.Asmack是smack的android版, ...
- 洛谷 P1510 精卫填海
洛谷 P1510 精卫填海 题目描述 [版权说明] 本题为改编题. [问题描述] 发鸠之山,其上多柘木.有鸟焉,其状如乌,文首,白喙,赤足,名曰精卫,其名自詨.是炎帝之少女,名曰女娃.女娃游于东海,溺 ...