Beispiel #1
0
        public override void OnClick()
        {
            if (_AppHk.MapControl == null)
            {
                return;
            }

            //获得行政区名称及范围
            IGeometry pGeoZone = null;
            //需要添加获得行政区范围的代码


            //根据行政区获得图幅号 需要添加5000图幅的要素类名称
            string         strMapName = "";//50000图幅要素类名称
            IList <string> lstMapNOs  = GeoUtilities.GeoModule.GetMapNOsByGeometry(_AppHk.MapControl.Map, strMapName, pGeoZone);

            if (lstMapNOs.Count < 1)
            {
                MessageBox.Show("获得图幅为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            //弹出提取框
            GeoUtilities.Gis.Form.frmExportDataByMapNO vfrmExport = new GeoUtilities.Gis.Form.frmExportDataByMapNO(lstMapNOs, false);
            vfrmExport.ShowDialog();
            vfrmExport = null;

            if (this.WriteLog)
            {
                Plugin.LogTable.Writelog(base._Tooltip);
            }
        }
Beispiel #2
0
        //输出图幅号数据到指定位置    ZQ  20110727    add
        private void bttExport_Click(object sender, EventArgs e)
        {
            string[]      strMapNo = GetMapNo().Split(new char[] { ',' });
            List <string> LstMapNo = new List <string>();

            foreach (string MapNo in strMapNo)
            {
                LstMapNo.Add(MapNo);
            }

            this.WindowState = FormWindowState.Minimized;
            GeoUtilities.Gis.Form.frmExportDataByMapNO pfrmExportDataByMapNO = new GeoUtilities.Gis.Form.frmExportDataByMapNO(LstMapNo, false, chkBoxDLG.Checked, chkBoxDEM.Checked, chkBoxDOM.Checked, m_MapControl, m_WS);
            pfrmExportDataByMapNO.ShowDialog();
        }
Beispiel #3
0
        public override void OnClick()
        {
            if (_AppHk.MapControl == null)
            {
                return;
            }

            //获得坐标范围
            IGeometry   pGeoZone = null;
            frmCoorEdit vCoor    = new frmCoorEdit(_AppHk.MapControl);

            if (vCoor.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            pGeoZone = vCoor.Geometry;

            //根据行政区获得图幅号
            string         strMapName = "全国50K范围图";//50000图幅要素类名称
            IList <string> lstMapNOs  = GeoUtilities.GeoModule.GetMapNOsByGeometry(_AppHk.MapControl.Map, strMapName, pGeoZone);

            if (lstMapNOs.Count < 1)
            {
                MessageBox.Show("获得图幅为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            //弹出提取框
            GeoUtilities.Gis.Form.frmExportDataByMapNO vfrmExport = new GeoUtilities.Gis.Form.frmExportDataByMapNO(lstMapNOs, false);
            vfrmExport.ShowDialog();
            vfrmExport = null;

            if (this.WriteLog)
            {
                Plugin.LogTable.Writelog(base._Tooltip);
            }
        }
Beispiel #4
0
        public override void OnClick()
        {//XZQLocation
            if (_hook == null)
            {
                return;
            }
            if (_hook.MainUserControl == null)
            {
                return;
            }

            IGeometry xzqGeo = ModGetData.getExtentByXZQ(m_xzqTree.SelectedNode);

            if (xzqGeo == null)
            {
                SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("提示", "未找到相应的行政区范围!");
                return;
            }
            ///ZQ  20111027 add  判断数据字典是否初始化
            if (SysCommon.ModField._DicFieldName.Count == 0)
            {
                SysCommon.ModField.InitNameDic(Plugin.ModuleCommon.TmpWorkSpace, SysCommon.ModField._DicFieldName, "属性对照表");
            }
            IList <string> listMapNo = new List <string>();
            IEnvelope      pExtent   = xzqGeo.Envelope;

            pExtent.Expand(1.5, 1.5, true);//跟地位效果一样 xisheng 20111104
            (_AppHk.ArcGisMapControl.Map as IActiveView).Extent = pExtent;
            //ZQ    20110914    modify   改变显示方式
            //drawPolygonElement(pGeometry as IPolygon, psGra);
            _AppHk.ArcGisMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewBackground, null, null);
            //end
            //ZQ   20110809   modify   先刷新后闪烁问题
            _AppHk.ArcGisMapControl.ActiveView.ScreenDisplay.UpdateWindow();
            //end
            _AppHk.ArcGisMapControl.FlashShape(xzqGeo, 3, 200, null);
            //这里需要修改NodeKey 的值      ZQ  20110801     Add
            try
            {
                string        strMapNoField = "";
                string        NodeKey       = GetNodeKey("1:50000", out strMapNoField).ToString();//不同比例尺的接图表的ID号
                IFeatureClass pFeatureClass = ModQuery.GetFeatureClassByNodeKey(NodeKey);
                if (strMapNoField == "")
                {
                    return;
                }
                if (pFeatureClass == null)
                {
                    return;
                }
                ISpatialFilter pSpatialFilter = new SpatialFilterClass();
                pSpatialFilter.Geometry   = xzqGeo;
                pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
                IFeatureCursor pFeaCursor = pFeatureClass.Search(pSpatialFilter, false);
                IFeature       pFeature   = pFeaCursor.NextFeature();
                while (pFeature != null)
                {
                    //ZQ   20110807  modify
                    listMapNo.Add((pFeature.get_Value(pFeature.Table.FindField(strMapNoField))).ToString());
                    //end
                    pFeature = pFeaCursor.NextFeature();
                }

                pFeaCursor = null;
                GeoUtilities.Gis.Form.frmExportDataByMapNO pfrmExportDataByMapNO = new GeoUtilities.Gis.Form.frmExportDataByMapNO(listMapNo, true, false, false, false, _AppHk.ArcGisMapControl as IMapControlDefault, _hook.CurWksInfo.Wks);
                pfrmExportDataByMapNO.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
        }