码迷,mamicode.com
首页 > 其他好文 > 详细

ArcGIS 空间查询一例

时间:2017-06-02 14:01:55      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:bsp   cursor   baidu   name   问题   layer   sys   target   poi   

 

ISpatialFilter spatialFilter = new SpatialFilterClass();
spatialFilter.Geometry = Polygon ;//设置用于筛选几何对象
patialFilter.GeometryField = featureLayer.FeatureClass.ShapfieldName; //设置筛选几何字段
spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelWithin;//设置空间几何关系
IFeatureLayer featureLayer = this.axMapControl1.Map.get_Layer(8) as IFeatureLayer;
IFeatureCursor featureCursor = null;
featureCursor = featureLayer.FeatureClass.Search(spatialFilter, false);
IFeature feature = null;

feature = featureCursor.NextFeature();
while (feature != null)
{
string strName = feature.get_Value(feature.Fields.FindField("NAME")).ToString();//你要查询名称

IPoint p=feature.Shape as IPoint;
feature = featureCursor.NextFeature();
}

System.Runtime.InteropServices.Marshal.ReleaseComObject(featureCursor);

 

 

参考原文

ArcGIS C#二次开发范围内元素查询。导航障碍物提示问题

 

ArcGIS 空间查询一例

标签:bsp   cursor   baidu   name   问题   layer   sys   target   poi   

原文地址:http://www.cnblogs.com/arxive/p/6932937.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!