开发工具:
文件大小: 107kb
下载次数: 0
上传时间: 2013-07-12
详细说明: c# 读取.mdb中的栅格数据 string path = @"E:\zxl\npgDB.mdb"; axMapControl1.ActiveView.Clear(); axMapControl1.ActiveView.Refresh(); pFWorkspace = OpenAccessWorkspace(path, pFWorkspace); IFeatureLayer iflayer; iflayer = new FeatureLayerClass(); iflayer.FeatureClass = pFWorkspace.OpenFeatureClass("地标"); axMapControl1.AddLayer(iflayer, 0); IFeatureLayer featureLayer = iflayer; //this.axMapControl1.Map.get_Layer(0) as IFeatu reLayer; IFeatureCursor featureCursor; IFeature feature; IGeometry geometry; IActiveView activeView = this.axMapControl1.ActiveView; ITopologicalOperator topo; featureCursor = featureLayer.FeatureClass.Search(null, false); feature = featureCursor.NextFeature(); ISpatialFilter spatialFilter = new SpatialFilterClass(); IFeatureSelection featureSelection; if (feature != null) { MessageBox.Show("if","tishi"); topo = feature.Shape as ITopologicalOperator; //double bufferLength = ConvertPixelsToMapUnits(activeView, 2); //geometry = topo.Buffer(bufferLength); geometry = topo.Buffer(1000); spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects; spatialFilter.Geometry = geometry; spatialFilter.GeometryField = featureLayer.FeatureClass.ShapeFieldName; spatialFilter.SubFields = "name"; spatialFilter.WhereClause = "name='第一教学楼'"; featureSelection = featureLayer as IFeatureSelection; featureSelection.SelectFeatures(spatialFilter, esriSelectionResultEnum.esriSelectionResultNew, false); ISelectionSet selectionSet = featureSelection.SelectionSet; ICursor cursor; selectionSet.Search(null, true, out cursor); featureCursor = cursor as IFeatureCursor; feature = featureCursor.NextFeature(); while (feature != null) { MessageBox.Show("while", "tishi"); this.axMapControl1.Map.SelectFeature(featureLayer, feature); feature = featureCursor.NextFeature(); } // activeView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null); activeView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, geometry.Envelope); } } private void button13_Click(object sender, EventArgs e) { string path = @"E:\zxl\npgDB.mdb"; axMapControl1.ActiveView.Clear(); axMapControl1.ActiveView.Refresh(); pFWorkspace = OpenAccessWorkspace(path, pFWorkspace); IFeatureLayer iflayer; iflayer = new FeatureLayerClass(); iflayer.FeatureClass = pFWorkspace.OpenFeatureClass("地标"); axMapControl1.AddLayer(iflayer, 0); Filter filter = new Filter(); ISpatialFilter filter1=new SpatialFilterClass(); filter1.WhereClause=""; //filter1. = "CITY_NAME = 'Phoenix'"; //Envelope envelope = new Envelope(-119, 32, -113, 35); //filter1.Geometry = envelope; //DisplayBuffer displaybuffer = new DisplayBuffer(); //displaybuffer.Distance = 200; //displaybuffer.Units = BufferUnits.Miles; //SimpleRenderer bufferrenderer = new SimpleRenderer(); //SimpleFillSymbol sfs = new SimpleFillSymbol(); //sfs.Color = System.Drawing.Color.Yellow; //sfs.Transparency = 50.0; //bufferrenderer.Symbol = sfs; //FeatureLayer bufferlayer = iflayer.CreateBufferLayer(filter, displaybuffer, bufferrenderer, "mybuffer"); //mapview.Layers.Add(bufferlayer); //mapview.Draw(); Geoprocessor gp=new Geoprocessor(); ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.