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的更多相关文章

  1. Python MongoDB Spatial Query

    //引入Pymongo >>> from pymongo import MongoClient,GEO2D // 链接数据库gis >>> db = MongoCl ...

  2. ArcGIS中的查询

    最近身体不适,静下心来看了一下以前收集的电子书.下面是<ArcGIS地理信息系统教程_第5版>(李玉龙)第5章“查询”的读书笔记. 1.查询的常见应用: 选择感兴趣的要素:查找哪些要素满足 ...

  3. ArcGIS Engine开发前基础知识(1)

    ArcGIS二次开发是当前gis领域的一项重要必不可少的技能.下面介绍它的基本功能 一.ArcGIS Engine功能 在使用之前首先安装和部署arcgis sdk,(在这里不在赘述相关知识)可以实现 ...

  4. ArcGis学习教程免费版在线观看

    ArcGis学习教程免费版在线观看 作者:池建    文章来源:清华大学出版社    点击数:150220    更新时间:2013-8-8 摘要:Arcgis学习视频教程根据书籍章节逐步讲解较为详细 ...

  5. ArcGIS教程:加权叠加

    摘要 使用经常使用測量比例叠加多个栅格数据,并依据各栅格数据的重要性分配权重. 插图 插图中,两个输入栅格已又一次分类为 1 至 3 三种公共測量级别.为每一个栅格均分配了一个影响百分比.这些像元值与 ...

  6. SQL Server 2008空间数据应用系列九:使用空间工具(Spatial Tools)导入ESRI格式地图数据

    转自:http://www.cnblogs.com/beniao/archive/2011/03/22/1989310.html 友情提示,您阅读本篇博文的先决条件如下: 1.本文示例基于Micros ...

  7. ArcGIS学习推荐基础教程摘录

    ###########-------------------摘录一--------------------------########### ***************************** ...

  8. 2013Esri全球用户大会之ArcGIS for Desktop

    Q1:ArcGIS 10.2 for Desktop中有哪些新特性?     增强的质量和性能        扩展并行处理能力        许多软件质量的改进        优化的文件处理     ...

  9. ArcGIS教程:创建特征

    摘要 创建由输入样本数据和一组栅格波段定义的类的 ASCII 特征文件. 使用方法 · 输出特征文件应使用扩展名 .gsg. · 输入栅格波段和输入栅格或要素样本数据必须具有重叠范围.将仅为公共区域计 ...

随机推荐

  1. JavaScript--数据结构与算法之散列

    散列:实现散列表的数据后可以快速地实现插入或者删除.但是对于实现查找操作则效率非常的低.散列表的底层是数组实现的,长度是预先设定,可以随时根据需求增加.所有的元素根据和该元素对应的键,保存在特定的位置 ...

  2. JS 在HTML页面显示当前日期

    代码如下: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <t ...

  3. Laravel输出sql语句

    $queries = DB::getQueryLog();

  4. IPv6地址表示方法详解

    IPv6是互联网协议的第六版:最初它在IETF的 IPng选取过程中胜出时称为互联网新一代网际协议(IPng),IPv6是被正式广泛使用的第二版互联网协议. 现有标准IPv4只支持大概40亿(4×10 ...

  5. js20---接口3种方式

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...

  6. Android学习笔记进阶十三获得本地全部照片

    这是Intent的一个用法. 在ActivityAction里面有一个“ACTION_GET_CONTENT”字符串常量,该常量让用户选择特定类型的数据. intent.setType("i ...

  7. linux/unix 基本概念的认识(sha-bang 、PPA)

    PPA:Personal Package Archives : Ubuntu: 比如为安装 emacs,需要首先添加某个PPA: sudo add-apt-repository ppa:cassou/ ...

  8. node --进行后台的环境搭建

    1.下载winscp  --- 输入IP 端口 账号 密码  进入当前的服务器环境 2.下载xshell5 ---- 输入IP 端口  和 winscp 达成连接. 3.把本地代码放置 winscp远 ...

  9. Exploring Micro-frameworks: Spring Boot--转载

    原文地址:http://www.infoq.com/articles/microframeworks1-spring-boot Spring Boot is a brand new framework ...

  10. golang round

    func Round(f float64, n int) float64 {pow10_n := math.Pow10(n)return math.Trunc((f+0.5/pow10_n)*pow1 ...