摘要: <select id="Analysis" resultClass="stationGroupInfo" parameterclass="hashtable"> select <dynamic> <!--> 注意这里的$ 如果字符串直接拼接要用$,#默认会在字符串变量前面加引号的 --> <isNotEmpty property="AnalysiStr"> $AnalysiStr$ </isNotEmpty> </dynamic> < 阅读全文
posted @ 2012-09-05 17:32 oftenlin 阅读(4449) 评论(0) 推荐(0) 编辑
摘要: this.xAxisName = '区县名称';this.yAxisName = '站点个数';this.store = new Ext.data.ArrayStore({ fields: ['month', 'hits'] }),this.analysisPanel = new Ext.chart.ColumnChart({ store: this.store, yField: 'hits', title: '站点统计', url: '/JS/Ext3.2.0/resources/char 阅读全文
posted @ 2012-09-05 17:24 oftenlin 阅读(2730) 评论(0) 推荐(0) 编辑
摘要: // 两个radio 只是显示,两个具有互斥性,触发事件时给一个隐藏字段赋值,后台读取隐藏字段,肯定不是最优,望高手拍砖this.cntRadio = new Ext.form.Radio({ id: 'cntRadioId', boxLabel: '数量', inputValue: 'cnt', listeners: { 'check': function() { //alert(this.getValue()); if (this.getValue()) { Ext.getCmp('moneyRadioId') 阅读全文
posted @ 2012-09-05 17:10 oftenlin 阅读(1968) 评论(0) 推荐(0) 编辑
摘要: function ShowStationOnMap(stations) { //清除图中的元素 map.graphics.clear(); // 设置显示中心点及坐标 var location = new esri.geometry.Point(stations[0].longtitude, stations[0].latitude, map.spatialReference) map.centerAndZoom(location, 8); // 逐个添加元素 for (var s = 0; s < stations.length; s++) { var symbol = new ... 阅读全文
posted @ 2012-09-05 17:00 oftenlin 阅读(11659) 评论(0) 推荐(0) 编辑
摘要: /* 参数一:要渲染的图层 参数二:按照哪个属性渲染 参数三:分级的分解点 参数四:各级的颜色*/public void linkClassRender(IFeatureLayer layer, string fieldName, List<int> spds, List<IColor> colors) { // 获取当前图层,并把它设置成IGeoFeatureLayer的实例 IFeatureLayer pFeatLayer = (IFeatureLayer)layer; IGeoFeatureLayer pGeoFeatLayer = (IGeoFeatureLay 阅读全文
posted @ 2012-09-05 16:32 oftenlin 阅读(2583) 评论(0) 推荐(0) 编辑
摘要: /*使用OleDb连接*/using System.Data.OleDb;public int TransferData(string excelFile, string sheetName, string connectionString,int WeekId){ DataSet ds = new DataSet(); string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + excelFile + "';Extended Properties='Excel 8 阅读全文
posted @ 2012-09-05 16:06 oftenlin 阅读(246) 评论(0) 推荐(0) 编辑
摘要: /* 以下代码实现的是矢量数据的更新,删除*//* 注意可以用store,但是效率比较低,每次都写一下文件,不如一次性flush一下*//*首先定义游标,然后.NextFeature() 依次执行,但是注意select产生的游标不能应用于update 和 Insert*//*代码比较乱,包含添加、删除、更新三个方面的操作,没有注释掉的是更新操作,查询之前的文章介绍过*/#region 修改字段的值IDataset dataset = pFlayerClass as IDataset; IWorkspace workspace = dataset.Workspace; IWorkspaceEdi 阅读全文
posted @ 2012-09-05 15:56 oftenlin 阅读(575) 评论(0) 推荐(0) 编辑
摘要: System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();stopwatch.Start(); // 开始监视代码运行时间/*代码放在这里*/stopwatch.Stop(); // 停止监视TimeSpan timespan = stopwatch.Elapsed; // 获取当前实例测量得出的总时间double seconds = timespan.TotalSeconds; // 总秒数MessageBox.Show(seconds.ToString()+"秒"); 阅读全文
posted @ 2012-09-05 15:28 oftenlin 阅读(168) 评论(0) 推荐(0) 编辑
摘要: public void CreateNewLayer(AxMapControl ax, string layerName, esriGeometryType layerType){ // 空间参考系 得到当前地图的空间参考系 ISpatialReference spatialReference = ax.ActiveView.FocusMap.SpatialReference; // 设定保持的路径 string strShapeFolder = @"F:\fuzhou\"; // 设定图层文件名 string strShapeFile = layerName + &quo 阅读全文
posted @ 2012-09-05 15:22 oftenlin 阅读(291) 评论(0) 推荐(0) 编辑
摘要: // 定义圆的中心点IPoint point = new PointClass();point.X = 119.302302426605;point.Y = 26.0989696929962;// 半径double radius = 0.001;// 圆构造器ICircularArc circularArc = new CircularArcClass();IConstructCircularArc constructCircularArc = circularArc as IConstructCircularArc;// 开始画圆constructCircularArc.ConstructC 阅读全文
posted @ 2012-09-05 15:19 oftenlin 阅读(326) 评论(0) 推荐(0) 编辑
摘要: // 思路将feature加入至集合IFeatureCursor pFeatureCursor = pFeatureLayer.Search(null, true);IFeature pFeature = pFeatureCursor.NextFeature();ISymbol symbol = CreateSimpleSymbol(pFeature.Shape.GeometryType);if (pFeature != null){IGeometryCollection pGeometryCollention =new PolygonClass();object missing = Type 阅读全文
posted @ 2012-09-05 15:16 oftenlin 阅读(167) 评论(0) 推荐(0) 编辑
摘要: // 将ILayer转换为IFeaturelayer,为了对图层上的要素进行编辑ILayer pLayer = GetGallery(ActiveGallery);IFeatureLayer pFeatureLyr = pLayer as IFeatureLayer;// 定义一个要素集合,并获取图层的要素集合IFeatureClass pFeatCls = pFeatureLyr.FeatureClass;// 定义一个实现添加要素的接口实例,并该实例作用于当前图层的要素集IFeatureClassWrite fr = (IFeatureClassWrite)pFeatCls;// 定义一个 阅读全文
posted @ 2012-09-05 15:16 oftenlin 阅读(535) 评论(0) 推荐(0) 编辑
摘要: /*查询与某路段的相交路段*/// 矢量数据集IFeatureClass pFeatureClass = pFeatLyr.FeatureClass;// 空间查询器ISpatialFilter pFilter = new SpatialFilterClass();// 查询的空间数据类型 点?线?面?pFilter.Geometry = polyline;pFilter.GeometryField = "Shape";// 空间关系 相交 相接等pFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects 阅读全文
posted @ 2012-09-05 15:15 oftenlin 阅读(295) 评论(0) 推荐(0) 编辑
摘要: /*按某属性值查询,并将查询结果显示在一个新的图层中*/// 将图层声明为矢量图层IFeatureLayer pFeatureLayer = GetGallery(gallery) as IFeatureLayer;// 创建选择集IFeatureSelection pFeatSel;pFeatSel = pFeatureLayer as IFeatureSelection;// 设定选定的颜色Color color = this.SelectedLineColor;pFeatSel.SelectionColor = GetRGB(color.R, color.G, color.B);// 创 阅读全文
posted @ 2012-09-05 15:13 oftenlin 阅读(559) 评论(0) 推荐(0) 编辑
摘要: 矢量数据属性值的查询// 矢量点数据IPoint pt = pFeature.Shape as IPoint;// 得到矢量点的 x,ydouble x = pt.x;double y = pt.y;// 矢量属性数据的查询int fid;for (k = 0; k < pFeature.Table.Fields.FieldCount; k++){ if (pFeature.Table.Fields.get_Field(k).Name == "FID") fid=(int)pFeature.get_Value(k); break;} 阅读全文
posted @ 2012-09-05 15:11 oftenlin 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 图层元素识别,用于点选或者框选// 接受识别数据的数组IArray pIDArray;/// 创建包络区域IEnvelope pEnv;/// 包络区域的四个边界的指定r.bottom = e.y + 5;r.top = e.y - 5;r.left = e.x - 5;r.right = e.x + 5;//也可以自定义画框来识别// pEnv = axMapControl1.TrackRectangle();// 创建识别接口,并将要识别的图层定义为识别接口IIdentify pIdentify;pIdentify = (IIdentify)GetGallery(this.ActiveGa 阅读全文
posted @ 2012-09-05 15:10 oftenlin 阅读(332) 评论(0) 推荐(0) 编辑
摘要: ArcGIS 基本函数(地图操作)获得焦点axMapControl1.Focus();设置中心点axMapControl1.CenterAt(pt);设定比例尺int scale = 1000;axMapControl1.MapScale = scale;得到图层数量int layerCnt = axMapControl1.LayerCount;按照索引得到当前图层ILayer layer = axMapControl1.get_Layer(i);闪烁某个元素IGeometry iGeometry pGeometry= ppt as IGeometry;mapControl.FlashShap 阅读全文
posted @ 2012-09-05 15:09 oftenlin 阅读(3083) 评论(0) 推荐(0) 编辑
摘要: string strPath = "F:\\汇总--路段速度\\";// 路径DirectoryInfo mydir=new DirectoryInfo(strPath); // 得到文件列表FileInfo[] files=mydir.GetFiles();string filePath = mydir + files[i].Name;//以流的形式打开文本文件FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);// 创建readerstreamReader st 阅读全文
posted @ 2012-09-05 15:05 oftenlin 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1.在web.config网页应用程序或者app.config (桌面应用程序)中添加,好像是必须在<configuration> </configuration>下添加 <appSettings> <add key="connstring" value="uid=sa;pwd=123456;database=bjtrc;server=(local)" /> </appSettings>2.添加引用 using System.Configuration;3.利用 string strConn = 阅读全文
posted @ 2012-09-05 15:01 oftenlin 阅读(2592) 评论(0) 推荐(0) 编辑
摘要: /*可能回由于office版本问题造成异常*/protected void ExportExcel(System.Data.DataTable dt,string fileName){ if (dt == null || dt.Rows.Count == 0) return; Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application(); if (xlApp == null) { return; } System.Globalization.Cult... 阅读全文
posted @ 2012-09-05 14:54 oftenlin 阅读(640) 评论(0) 推荐(0) 编辑