public static Result refreshTINLayer() { //OperateTINLayer layer = new OperateTINLayer(LayerNames.TIN); //layer.ClearLayer(); //if (!layer.constuctTIN()) // return new Result(false, "无TIN"); //OperateTINLayer layer1 = new OperateTINLayer(LayerNames.TIN1); //layer1.ClearLayer(); //if (!layer1.constuctTIN()) // return new Result(false, "无TIN"); //return new Result(true); try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().refreshTINLayer(); if (res.Ok) { return(new Result(true, "Tin图层刷新成功")); } else { return(new Result(false, "Tin图层刷新失败")); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }
public static Result refreshBuildingSmoothLayer() { //OperateSmoothBuildingLayer layer = new OperateSmoothBuildingLayer(); //layer.ClearLayer(); //if (!layer.constuctBuildingVertex()) // return new Result(false, "无建筑物数据"); //return new Result(true); try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().refreshBuildingSmoothLayer(); if (res.Ok) { return(new Result(true, "建筑物底边平滑图层刷新成功")); } else { return(new Result(false, "建筑物底边平滑图层刷新失败")); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }
private Result refreshLayer(DefectType type) { int minXid = 0, minYid = 0, maxXid = 0, maxYid = 0; getGridID(ref minXid, ref minYid, ref maxXid, ref maxYid); try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().refreshDefectLayer(minXid, minYid, maxXid, maxYid, type); if (res.Ok) { return(new Result(true, "网内干扰图层图层刷新成功")); } else { return(new Result(false, "网内干扰图层刷新失败")); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } //OperateDefectLayer operateGrid3d = new OperateDefectLayer(layerName); //operateGrid3d.ClearLayer(); //if (!operateGrid3d.constuctGrid3Ds(minxid, minyid, maxxid, maxyid, type)) // return new Result(false, "数据为空"); //return new Result(true); }
// 刷新区域立体覆盖图层 public Result refresh3DCoverLayer() { int minXid = 0, minYid = 0, maxXid = 0, maxYid = 0; getGridID(ref minXid, ref minYid, ref maxXid, ref maxYid); try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().refresh3DCoverLayer(minXid, minYid, maxXid, maxYid); if (res.Ok) { return(new Result(true, "区域立体覆盖图层刷新成功")); } else { return(new Result(false, "区域立体覆盖图层刷新失败")); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } //OperateCoverGird3DLayer operateGrid = new OperateCoverGird3DLayer(LayerNames.AreaCoverGrid3Ds); //operateGrid.ClearLayer(); //if (!operateGrid.constuctAreaGrid3Ds(minxid, minyid, maxxid, maxyid)) // return new Result(false, "请先对区域内的小区进行覆盖计算"); //return new Result(true); }
public static Result RefreshCell() { //LTE.GIS.OperateCellLayer cellLayer = new LTE.GIS.OperateCellLayer(); //if (!cellLayer.RefreshCellLayer()) // return new Result(false, "小区数据为空"); //return new Result(true); try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().RefreshCell(); if (res.Ok) { Hashtable ht = new Hashtable(); //TODO:最好以地区名最为索引标志,可以通过项目创建时数据库中的地区名称来获得 ht["IndexName"] = "南京"; ht["ShpName"] = res.ShpName; ht["Type"] = "Cell"; ht["DateTime"] = DateTime.Now; IbatisHelper.ExecuteInsert("insShp", ht); return(new Result(true, "小区图层刷新成功")); } else { return(new Result(false, "小区图层刷新失败")); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }
public Result overlaygrass() { DataTable dt1 = DB.IbatisHelper.ExecuteQueryForDataTable("GetFishnetShpState", null); // Ibatis 数据访问,判断用户是否做了渔网生成 if (dt1.Rows[0][0].ToString() == "0") { return(new Result(false, "用户未进行渔网生成")); } // else // { return new Result(true, "用户未进行渔网生成"); } DataTable dt2 = DB.IbatisHelper.ExecuteQueryForDataTable("GetGrass_overlayState", null); // Ibatis 数据访问,判断用户是否做了水面叠加分析,做了则删除它 if (dt2.Rows[0][0].ToString() == "1") //存在水面叠加图层 { try //更新加速场景表,前提条件表 { IbatisHelper.ExecuteDelete("UpdatetbDependTableDuetoGrass_overlay", null); IbatisHelper.ExecuteDelete("deleteAdjcoefficient", null); IbatisHelper.ExecuteUpdate("UpdatetbAccelerateGridSceneDuetoGrass_overlay", null); } catch (Exception ex) { return(new Result(false, ex.ToString())); } } try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().overlaygrass(); if (res.Ok) { //更新tbDependTabled的Grass_overlay IbatisHelper.ExecuteUpdate("UpdatetbDependTableGrass_overlay", null); return(new Result(true, res.Msg)); } else { return(new Result(false, res.Msg)); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }
public Result cluster() { DataTable dt11 = DB.IbatisHelper.ExecuteQueryForDataTable("GetClustertoDBState", null); // Ibatis 数据访问,判断用户是否做了场景划分 if (dt11.Rows[0][0].ToString() == "0") { return(new Result(false, "用户未进行场景划分")); } DataTable dt2 = DB.IbatisHelper.ExecuteQueryForDataTable("GetClusterShpState", null); // Ibatis 数据访问,判断用户是否做了结果图层 if (dt2.Rows[0][0].ToString() == "1") //做了结果图层 { try //更新前提条件表 { IbatisHelper.ExecuteDelete("UpdatetbDependTableDuetoClusterShp", null); IbatisHelper.ExecuteDelete("deleteAdjcoefficient", null); } catch (Exception ex) { return(new Result(false, ex.ToString())); } } try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().cluster(); if (res.Ok) { //更新tbDependTabled的Grass_overlay IbatisHelper.ExecuteUpdate("UpdatetbDependTableClusterShp", null); return(new Result(true, res.Msg)); } else { return(new Result(false, res.Msg)); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }
// 刷新小区立体覆盖图层 public Result refresh3DCover() { //CellInfo cellInfo = new CellInfo(); //cellInfo.SourceName = cellName; //validateCell(ref cellInfo); //if(!AnalysisEntry.Display3DAnalysis(cellInfo)) //{ // return new Result(false, "请先进行小区覆盖计算"); //} //return new Result(true); try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().refresh3DCover(cellName); if (res.Ok) { Hashtable ht = new Hashtable(); ht["IndexName"] = cellName; ht["ShpName"] = res.ShpName; ht["Type"] = "Ground3DCover"; ht["DateTime"] = DateTime.Now; IbatisHelper.ExecuteInsert("insShp", ht); return(new Result(true, "立体覆盖图层刷新成功")); } else { return(new Result(false, "立体覆盖图层刷新失败: " + res.Msg)); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }
/// <summary> /// 根据参数刷新图层 /// </summary> /// <returns></returns> public Result refreshSPLayer() { try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().refreshSPLayer(version); if (res.Ok) { return(new Result(true, "路测图层刷新成功")); } else { return(new Result(false, res.Msg)); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }
public static Result refreshInfLayer() { try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().refreshInfLayer(); if (res.Ok) { return(new Result(true, "网外干扰图层刷新成功")); } else { return(new Result(false, "网外干扰图层刷新失败")); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }
public Result overlaybuilding() { DataTable dt1 = DB.IbatisHelper.ExecuteQueryForDataTable("GetFishnetShpState", null); // Ibatis 数据访问,判断用户是否做了渔网生成 if (dt1.Rows[0][0].ToString() == "0") { return(new Result(false, "用户未进行渔网生成")); } // else // { return new Result(true, "用户未进行渔网生成"); } DataTable dt2 = DB.IbatisHelper.ExecuteQueryForDataTable("GetBuilding_overlayState", null); // Ibatis 数据访问,判断用户是否做了建筑物叠加分析,做了则删除它 if (dt2.Rows[0][0].ToString() == "1") //存在建筑物叠加图层 { /* * string[] de = new string[2];//聚类图层,建筑物叠加图层 * * DataTable dt3 = DB.IbatisHelper.ExecuteQueryForDataTable("GetBuildingOverlayPosition", null); // Ibatis 数据访问,得到建筑物叠加图层文件位置 * de[0] = dt3.Rows[0][0].ToString(); * * DataTable dt4 = DB.IbatisHelper.ExecuteQueryForDataTable("GetClusterPosition", null); // Ibatis 数据访问,得到聚类图层文件位置 * de[1] = dt4.Rows[0][0].ToString(); * * string filepath; * * filepath = de[0];//删除建筑物叠加图层 * try * { * // File.Delete(filepath); * string fileName = System.IO.Path.GetFileName(filepath); * string[] a = fileName.Split('.'); * string name = a[0]; * string b = "\\" + name + ".shp"; * filepath = filepath.Replace(b, ""); * DirectoryInfo Folder = new DirectoryInfo(filepath); * foreach (FileInfo file in Folder.GetFiles()) * { * if (name == file.Name.Substring(0, file.Name.LastIndexOf('.')) || name + ".shp" == file.Name.Substring(0, file.Name.LastIndexOf('.'))) * { * file.Delete(); * } * } * } * catch (Exception ex) * { * return new Result(false, ex.ToString()); * } * * * filepath = de[1];//删除聚类图层 * try * { * // File.Delete(filepath); * string fileName = System.IO.Path.GetFileName(filepath); * string[] a = fileName.Split('.'); * string name = a[0]; * string b = "\\" + name + ".shp"; * filepath = filepath.Replace(b, ""); * DirectoryInfo Folder = new DirectoryInfo(filepath); * foreach (FileInfo file in Folder.GetFiles()) * { * if (name == file.Name.Substring(0, file.Name.LastIndexOf('.')) || name + ".shp" == file.Name.Substring(0, file.Name.LastIndexOf('.'))) * { * file.Delete(); * } * } * name = name + "_label"; * foreach (FileInfo file in Folder.GetFiles()) * { * if (name == file.Name.Substring(0, file.Name.LastIndexOf('.')) || name + ".shp" == file.Name.Substring(0, file.Name.LastIndexOf('.'))) * { * file.Delete(); * } * } * } * catch (Exception ex) * { * return new Result(false, ex.ToString()); * }*/ try//更新加速场景表,前提条件表 { IbatisHelper.ExecuteDelete("UpdatetbDependTableDuetoBuilding_overlay", null); IbatisHelper.ExecuteDelete("deleteAdjcoefficient", null); IbatisHelper.ExecuteUpdate("UpdatetbAccelerateGridSceneDuetoBuilding_overlay", null); } catch (Exception ex) { return(new Result(false, ex.ToString())); } } try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().overlaybuilding(); if (res.Ok) { //更新tbDependTabled的Building_overlay IbatisHelper.ExecuteUpdate("UpdatetbDependTableBuilding_overlay", null); return(new Result(true, res.Msg)); } else { return(new Result(false, res.Msg)); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }
public Result makeFishnet() { DataTable dt1 = DB.IbatisHelper.ExecuteQueryForDataTable("GetGridRangeState", null); // Ibatis 数据访问,判断用户是否提供了网格范围 if (dt1.Rows[0][0].ToString() == "0") { return(new Result(false, "用户未提供区域范围")); } // else // { return new Result(true, "用户提供区域范围"); } DataTable dt2 = DB.IbatisHelper.ExecuteQueryForDataTable("GetFishnetShpState", null); // Ibatis 数据访问,判断用户是否做了渔网图层,做了则删除它 if (dt2.Rows[0][0].ToString() == "1") //存在渔网图层 { /* * string[] de = new string[5];//聚类图层,建筑物叠加图层,水面叠加图层,草地叠加图层,渔网图层及label图层 * DataTable dt3 = DB.IbatisHelper.ExecuteQueryForDataTable("GetGrassOverlayPosition", null); // Ibatis 数据访问,得到草地叠加图层文件位置 * de[0] = dt3.Rows[0][0].ToString(); * * DataTable dt4 = DB.IbatisHelper.ExecuteQueryForDataTable("GetBuildingOverlayPosition", null); // Ibatis 数据访问,得到建筑物叠加图层文件位置 * de[1] = dt4.Rows[0][0].ToString(); * * DataTable dt5 = DB.IbatisHelper.ExecuteQueryForDataTable("GetWaterOverlayPosition", null); // Ibatis 数据访问,得到水面叠加图层文件位置 * de[2] = dt5.Rows[0][0].ToString(); * * DataTable dt6 = DB.IbatisHelper.ExecuteQueryForDataTable("GetClusterPosition", null); // Ibatis 数据访问,得到聚类图层文件位置 * de[3] = dt6.Rows[0][0].ToString(); * * DataTable dt7 = DB.IbatisHelper.ExecuteQueryForDataTable("GetFishnetPosition", null); // Ibatis 数据访问,得到渔网图层文件位置 * de[4] = dt7.Rows[0][0].ToString(); * * string filepath; * for(int i=0;i<3;i++)//删除建筑物叠加图层,水面叠加图层,草地叠加图层 * { * filepath = de[i]; * try * { * // File.Delete(filepath); * string fileName = System.IO.Path.GetFileName(filepath); * string[] a = fileName.Split('.'); * string name = a[0]; * string b = "\\" + name + ".shp"; * filepath = filepath.Replace(b, ""); * DirectoryInfo Folder = new DirectoryInfo(filepath); * foreach (FileInfo file in Folder.GetFiles()) * { * if (name == file.Name.Substring(0, file.Name.LastIndexOf('.')) || name+".shp"== file.Name.Substring(0, file.Name.LastIndexOf('.'))) * { * file.Delete(); * } * } * } * catch (Exception ex) * { * return new Result(false, ex.ToString()); * } * } * for (int i=3;i<5;i++) * { * filepath = de[i];//删除聚类图层,渔网图层及label图层 * try * { * // File.Delete(filepath); * string fileName = System.IO.Path.GetFileName(filepath); * string[] a = fileName.Split('.'); * string name = a[0]; * string b = "\\" + name + ".shp"; * filepath = filepath.Replace(b, ""); * DirectoryInfo Folder = new DirectoryInfo(filepath); * foreach (FileInfo file in Folder.GetFiles()) * { * if (name == file.Name.Substring(0, file.Name.LastIndexOf('.')) || name + ".shp" == file.Name.Substring(0, file.Name.LastIndexOf('.'))) * { * file.Delete(); * } * } * name = name + "_label"; * foreach (FileInfo file in Folder.GetFiles()) * { * if (name == file.Name.Substring(0, file.Name.LastIndexOf('.')) || name + ".shp" == file.Name.Substring(0, file.Name.LastIndexOf('.'))) * { * file.Delete(); * } * } * } * catch (Exception ex) * { * return new Result(false, ex.ToString()); * } * }*/ try//删除加速场景表,重置前提条件表 { IbatisHelper.ExecuteDelete("DeleteFishnet", null); IbatisHelper.ExecuteDelete("deleteAdjcoefficient", null); IbatisHelper.ExecuteUpdate("UpdatetbDependTableDuetoFishnet", null); } catch (Exception ex) { return(new Result(false, ex.ToString())); } } try { GisClient.Result res = GisClient.ServiceApi.getGisLayerService().makeFishnet(); if (res.Ok) { //更新tbDependTabled的FishnetShp IbatisHelper.ExecuteUpdate("UpdatetbDependTableFishnetShp", null); return(new Result(true, res.Msg)); } else { return(new Result(false, res.Msg)); } } catch (Exception e) { return(new Result(false, "远程调用失败" + e)); } finally { ServiceApi.CloseConn(); } }