c# 读取.mdb中的栅格数据

时间:2016-07-31 18:02:07
【文件属性】:

文件名称:c# 读取.mdb中的栅格数据

文件大小:107KB

文件格式:RAR

更新时间:2016-07-31 18:02:07

c# .mdb 栅格数据

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 IFeatureLayer; 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();


【文件预览】:
aetest
----aetest()
--------Form1.cs(38KB)
--------Program.cs(574B)
--------Form1.resx(14KB)
--------Properties()
--------aetest.csproj(9KB)
--------Form1.Designer.cs(17KB)
--------ClsPathFinder.cs(9KB)
--------obj()
--------bin()
----aetest.sln(860B)
----aetest.suo(35KB)

网友评论

  • 没太大作用,郁闷了
  • 不是我想要的,而且不太看得懂,大概是我水平比较低吧