private void NetSubmit(object sender, RoutedEventArgs e) { if (SuccessFlag == true) { if (netWindow != null) { this.netWindow.removeFlash(); ClearRoad(); this.netWindow.roadReslut.Blocks.Clear(); this.netWindow.Close(); netWindow = null; } SuccessFlag = false; CGdbInfo gdb = new CGdbInfo(); gdb.GDBName = this.GDBName; gdb.GDBSvrName = this.GDBSvrName; gdb.Password = this.Password; gdb.User = this.User; CNetAnalyse obj = new CNetAnalyse(); obj.GdbInfo = gdb; obj.NetLayerName = this.NetLayerName; obj.RequestDots = this.pathDots.Substring(0, this.pathDots.Length - 1); obj.BarrierDots = ""; obj.NearDis = 0.002; obj.FlgType = "line"; obj.NetWeight = ",Weight1,Weight1"; obj.AnalysTypeParam = AnalysType.UserMode.ToString(); _spatial = new SpacialAnalyse(this.mapDoc); _spatial.NetAnalyse(obj, new UploadStringCompletedEventHandler(OnSubmit)); } }
/// <summary> /// 进行拓扑分析 /// </summary> private void submit(object sender, RoutedEventArgs e) { this.topRlt.Content = ""; if (_firstFeature == null) { MessageBox.Show(" 进行拓扑分析的要素还未选取完成!");//进行拓扑分析的第一个要素还未选取完成! return; } if (_secondFeature == null) { MessageBox.Show("进行拓扑分析的要素还未选取完成!"); //进行拓扑分析的第一个要素还未选取完成! return; } CRegionRelationAnalyse obj = new CRegionRelationAnalyse(); obj.Reg0 = this._firstFeature.RegGeom[0]; obj.Reg1 = this._secondFeature.RegGeom[0]; string s = this.buffer.Text; obj.NearDis = Convert.ToDouble(s); if (obj.NearDis.ToString() == "") { MessageBox.Show("输入正确的半径!"); return; } this._spatial = new SpacialAnalyse(this.IMSCatalog.ActiveMapDoc); this._spatial.RegionRelationAnalyse(obj, new UploadStringCompletedEventHandler(onSubmit)); }
public void Submit() { if (CommFun.IsNumber(this.buffer.Text)) { if (VectorObj == null) { MessageBox.Show("绑定的矢量图对象为空", "提示", MessageBoxButton.OK); return; } MarkLayer.ManuallyAddMarkObj = null; CGdbInfo gdb = new CGdbInfo(); gdb.GDBName = this.GDBName; gdb.GDBSvrName = this.GDBSvrName; gdb.Password = this.Password; gdb.User = this.User; CNetAnalyse obj = new CNetAnalyse(); obj.GdbInfo = gdb; obj.NetLayerName = this.NetLayerName; obj.RequestDots = this.m_pathDots.Length > 0 ? this.m_pathDots.Substring(0, this.m_pathDots.Length - 1) : this.m_pathDots; obj.BarrierDots = this.m_barrierDots.Length > 0 ? this.m_barrierDots.Substring(0, this.m_barrierDots.Length - 1) : this.m_barrierDots; obj.NearDis = 100; //Convert.ToSingle(this.buffer.Text); obj.FlgType = "line"; obj.NetWeight = ",Weight1,Weight1"; _spatial = new SpacialAnalyse(VectorObj); _spatial.NetAnalyse(obj, new UploadStringCompletedEventHandler(OnSubmit)); } else { MessageBox.Show("请输入合法的分析半径", "提示", MessageBoxButton.OK); } }
/** * 多边形裁剪处理事件 * @param e * */ public void clipLayer() { if (this.IMSCatalog.ActiveLayerObj == null || this.IMSCatalog.ActiveLayerObj.ActiveLayerAccessInfo == null) { return; } GRegion region = new GRegion(); region.Rings = new AnyLine[1]; region.Rings[0] = new AnyLine(); region.Rings[0].Arcs = new Arc[1]; region.Rings[0].Arcs[0] = new Arc(); region.Rings[0].Arcs[0].Dots = dot; this.setClipRegion(region); this.Show(); CLayerAccessInfo layerAccessInfo = new CLayerAccessInfo(); layerAccessInfo.GdbInfo = this.IMSCatalog.ActiveLayerObj.ActiveLayerAccessInfo.GdbInfo; layerAccessInfo.LayerInfoList = new CLayerInfo[1]; int idx = this.IMSCatalog.ActiveLayerObj.ActiveLayerIndex; layerAccessInfo.LayerInfoList[0] = this.IMSCatalog.ActiveLayerObj.ActiveLayerAccessInfo.LayerInfoList[idx]; this._clipLayerAcsInfo = layerAccessInfo; this._serverAddr = this.IMSCatalog.ActiveLayerObj.ServerAddress; this._spatial = new SpacialAnalyse(this.IMSCatalog.ActiveLayerObj); }
/// <summary> /// 获取数据源列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void getGdbSvrList(object sender, RoutedEventArgs e) { this.svrList.Items.Clear(); if (this.vectorObj == null) { MessageBox.Show("没有激活的图层。"); return; } this._spatial = new SpacialAnalyse(this.vectorObj); this._spatial.GetGdbServerList(new UploadStringCompletedEventHandler(onGetSvrList)); }
/// <summary> /// 叠加分析 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void submit(object sender, RoutedEventArgs e) { if (this.vectorObj == null) { MessageBox.Show("没有激活的图层。"); return; } COverlayByLayer obj = new COverlayByLayer(); obj.FClsNameRtn = "overlay"; CGdbInfo gdbInfo = new CGdbInfo(); gdbInfo.GDBName = this.gdbName.SelectedValue.ToString(); gdbInfo.GDBSvrName = this.svrList.SelectedValue.ToString(); gdbInfo.User = this.username.Text; gdbInfo.Password = this.password.Text; obj.GdbInfo = gdbInfo; obj.GdbInfoOverlay = gdbInfo; bool c = Convert.ToBoolean(this.radio_no.IsChecked); if (c) { obj.IsReCalculate = c; } else { obj.IsReCalculate = Convert.ToBoolean(this.radio_yes.IsChecked); } obj.LayerName = this.layer1.SelectedItem.ToString(); obj.OverlayLayerName = this.layer2.SelectedItem.ToString(); bool t; if (t = Convert.ToBoolean(this.radioButton_bing.IsChecked)) { obj.OverlayType = 0; } if (t = Convert.ToBoolean(this.radioButton_cha.IsChecked)) { obj.OverlayType = 6; } if (t = Convert.ToBoolean(this.radioButton_jiao.IsChecked)) { obj.OverlayType = 1; } if (t = Convert.ToBoolean(this.radioButton_jian.IsChecked)) { obj.OverlayType = 2; } obj.Radius = Convert.ToDouble(this.radius.Text); obj.XClsType = this.dataType.SelectionBoxItem.ToString() == "简单要素类" ? XClsType.SFeatureCls : XClsType.FeatureCls; this._spatial = new SpacialAnalyse(this.vectorObj); _spatial.OverlayByLayer(obj, new UploadStringCompletedEventHandler(onSubmit)); this.button_submit.IsEnabled = false; }
/// <summary> /// 连接数据源,获取gdb列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void connect(object sender, RoutedEventArgs e) { if (this.vectorObj == null) { MessageBox.Show("没有激活的图层。"); return; } this.gdbName.Items.Clear(); CGetGdbList obj = new CGetGdbList(); obj.GdbSvrName = this.svrList.SelectedItem.ToString(); obj.GdbSvrUser = this.username.Text; obj.GdbSvrPwds = this.password.Text; this._spatial = new SpacialAnalyse(this.vectorObj); this._spatial.GetGdbList(obj, onConnect); }
private void onTopSpanalyse() { //闪烁第一个要素 this._firstPoly.Flicker(); //闪烁第二个要素 this._secondPoly.Flicker(); //设置拓扑分析类的参数 CRegionRelationAnalyse obj = new CRegionRelationAnalyse(); obj.Reg0 = this._firstFeature.RegGeom[0]; obj.Reg1 = this._secondFeature.RegGeom[0]; obj.NearDis = 0.002; //空间分析类 this._spatial = new SpacialAnalyse(this.iMSCatalog1.ActiveMapDoc); //拓扑分析 this._spatial.RegionRelationAnalyse(obj, onSubmit); }
//设置裁剪分析的参数 private void CircleClip() { if (this.iMSCatalog1.ActiveMapDoc != null) { //删除绘制的图形 this.m_gpLayer.RemoveAll(); //GRegion多区 GRegion region = new GRegion(); //AnyLine任意线 region.Rings = new AnyLine[1]; region.Rings[0] = new AnyLine(); region.Rings[0].Arcs = new Arc[1]; region.Rings[0].Arcs[0] = new Arc(); region.Rings[0].Arcs[0].Dots = new Dot_2D[dot.Length]; region.Rings[0].Arcs[0].Dots = dot; //将圆形区域上的所有的边界点赋值给多区的对象 this._clipRegion = region; // 设置图层的访问信息 this._clipLayerAcsInfo = new CLayerAccessInfo(); this._clipLayerAcsInfo = this.iMSCatalog1.ActiveMapDoc.ActiveLayerAccessInfo; this._serverAddr = this.iMSCatalog1.ActiveMapDoc.ServerAddress; //设置裁剪分析参数 CClipByPolygon clip = new CClipByPolygon(); //设置要裁剪的区 clip.Region = this._clipRegion; CLayerAccessInfo clipLayer = this._clipLayerAcsInfo; clip.GdbInfo = clipLayer.GdbInfo; clip.LayerName = clipLayer.LayerInfoList[0].LayerDataName; clip.XClsType = clipLayer.LayerInfoList[0].LayerType; clip.FClsNameRtn = "clip" + clip.LayerName; clip.Radius = 0.0001; clip.Username = ""; clip.UserIP = ""; clip.ClipFlg = 3; clip.IsReCalculate = false; //空间分析类 this._spatial = new SpacialAnalyse(this.iMSCatalog1.ActiveMapDoc); //裁剪分析 this._spatial.ClipByPolygon(clip, new UploadStringCompletedEventHandler(onSubmit)); } else { MessageBox.Show("矢量文档中没有激活的图层!"); } }
/// <summary> /// 圆裁剪地图文档 /// </summary> /// <param name="?"></param> /// <returns></returns> public void clipDoc() { if (this.IMSCatalog.ActiveMapDoc.ActiveLayerIndex == -1) { MessageBox.Show("矢量文档中没有激活的图层!"); return; } GRegion region = new GRegion(); region.Rings = new AnyLine[1]; region.Rings[0] = new AnyLine(); region.Rings[0].Arcs = new Arc[1]; region.Rings[0].Arcs[0] = new Arc(); region.Rings[0].Arcs[0].Dots = new Dot_2D[dot.Length]; region.Rings[0].Arcs[0].Dots = dot; this.setClipRegion(region); this.Show(); this._clipLayerAcsInfo = this.IMSCatalog.ActiveMapDoc.ActiveLayerAccessInfo; this._serverAddr = this.IMSCatalog.ActiveMapDoc.ServerAddress; this._spatial = new SpacialAnalyse(this.IMSCatalog.ActiveMapDoc); }
private void getLayerList(object sender, RoutedEventArgs e) { if (this.vectorObj == null) { MessageBox.Show("没有激活的图层。"); return; } this.layer1.Items.Clear(); this.layer2.Items.Clear(); CGetXClsList obj = new CGetXClsList(); obj.GdbSvrName = this.svrList.SelectedItem.ToString(); obj.GdbSvrUser = this.username.Text; obj.GdbSvrPwds = this.password.Text; obj.GdbName = this.gdbName.SelectedItem.ToString(); string dataT = this.dataType.SelectionBoxItem.ToString(); obj.XclsType = dataT == "简单要素类" ? XClsType.SFeatureCls : XClsType.FeatureCls; this._spatial = new SpacialAnalyse(this.vectorObj); this._spatial.GetXClsList(obj, onGetLayer); }
private void submit(object sender, RoutedEventArgs e) { if (this.IMSMap == null) { MessageBox.Show("imsmap属性未赋值。"); return; } if ((this.ProjLat_src.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat_src.Text)) || (ProjLat1_src.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat1_src.Text)) || (ProjLat2_src.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat2_src.Text)) || (DLon_src.Text.Length > 0 && !CommFun.IsNumber(this.DLon_src.Text)) || (DLon_des.Text.Length > 0 && !CommFun.IsNumber(this.DLon_des.Text)) || (ProjLat_des.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat_des.Text)) || (ProjLat1_des.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat1_des.Text)) || (ProjLat2_des.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat2_des.Text))) { MessageBox.Show("请输入合法数字!"); return; } param_src = new ProjectParam(); param_des = new ProjectParam(); param_src.ProjLon = Convert.ToDouble(this.DLon_src.Text); this.ProjRate_Scale_src(param_src, 0); this.ProjType_coor_src(param_src, 0); if (param_src.ProjType != EnumType.TYPE_JWD) { this.ProjTypeID_IProjTypeId_src(param_src, 0); this.ProjZoneNO_IZone_src(param_src, 0); this.ProjZoneType_BZoneType_src(param_src, 0); } this.ProjUnit_unit_src(param_src, 0); this.SphereID_ISpheroid_src(param_src, 0); this.ProjAngleUnit_DAngUnit_src(param_src, 0); if (param_src.ProjTypeID == EnumProjType.Lambert || param_src.ProjTypeID == EnumProjType.Albers) { param_src.ProjLat = Convert.ToDouble(this.ProjLat_src.Text); param_src.ProjLat1 = Convert.ToDouble(this.ProjLat1_src.Text); param_src.ProjLat2 = Convert.ToDouble(this.ProjLat2_src.Text); } if (param_src.ProjTypeID == EnumProjType.Polyconic || param_src.ProjTypeID == EnumProjType.Transverse_Mecator) { param_src.ProjLat = Convert.ToDouble(this.ProjLat_src.Text); } param_des.ProjLon = Convert.ToDouble(this.DLon_des.Text); this.ProjRate_Scale_src(param_des, 1); this.ProjType_coor_src(param_des, 1); if (param_des.ProjType != EnumType.TYPE_JWD) { this.ProjTypeID_IProjTypeId_src(param_des, 1); this.ProjZoneNO_IZone_src(param_des, 1); this.ProjZoneType_BZoneType_src(param_des, 1); } this.ProjUnit_unit_src(param_des, 1); this.SphereID_ISpheroid_src(param_des, 1); this.ProjAngleUnit_DAngUnit_src(param_des, 1); if (param_des.ProjTypeID == EnumProjType.Lambert || param_des.ProjTypeID == EnumProjType.Albers) { param_des.ProjLat = Convert.ToDouble(this.ProjLat_des.Text); param_des.ProjLat1 = Convert.ToDouble(this.ProjLat1_des.Text); param_des.ProjLat2 = Convert.ToDouble(this.ProjLat2_des.Text); } if (param_des.ProjTypeID == EnumProjType.Polyconic || param_des.ProjTypeID == EnumProjType.Transverse_Mecator) { param_des.ProjLat = Convert.ToDouble(this.ProjLat_des.Text); } CProjectDots obj = new CProjectDots(); obj.SrcProjParam = param_src; obj.DesProjParm = param_des; Dot_2D dot = new Dot_2D(); dot.x = Convert.ToDouble(this.coorx_src.Text); dot.y = Convert.ToDouble(this.coory_src.Text); obj.InputDots = new Dot_2D[1]; obj.InputDots[0] = new Dot_2D(); obj.InputDots[0] = dot; this._spatial = new SpacialAnalyse(vectorObj); this._spatial.ProjectDots(obj, new UploadStringCompletedEventHandler(onSubmit)); }