Beispiel #1
0
        /// <summary>
        /// 经纬度转图幅号
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonLBToTFH_Click(object sender, EventArgs e)
        {
            MapScaleObject obj = this.comboBoxMapScale.SelectedItem as MapScaleObject;

            if (obj != null)
            {
                double L   = 0; double.TryParse(this.textBoxToTFHL.Text.Trim(), out L);
                double B   = 0; double.TryParse(this.textBoxToTFHB.Text.Trim(), out B);
                string tfh = TFHHelper.GetTFH(L, B, obj);
                this.textBoxTFH.Text = tfh;
            }
        }
Beispiel #2
0
        /// <summary>
        /// 图幅号经纬度
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonTFHToLB_Click(object sender, EventArgs e)
        {
            MapScaleObject scaleObj = null;
            double         LTL, LTB, RBL, RBB;
            string         tfh = this.textBoxTFH.Text.Trim();

            TFHHelper.GetLTRBPoints(tfh, out scaleObj, out LTL, out LTB, out RBL, out RBB);
            if (scaleObj != null)
            {
                MessageBox.Show(string.Format("比例尺:{0}  LTL:{1}  LTB:{2}  RBL:{3}  RBB:{4}", scaleObj.Label, LTL.ToString(), LTB.ToString(), RBL.ToString(), RBB.ToString()));
            }
            else
            {
                MessageBox.Show(string.Format("图幅号[{0}]无法解析!", tfh));
            }
        }
Beispiel #3
0
        private void buttonLTBRTFH_Click(object sender, EventArgs e)
        {
            MapScaleObject obj = this.comboBoxLTRBMapScale.SelectedItem as MapScaleObject;

            if (obj != null)
            {
                double ltl, ltb, rbl, rbb;
                double.TryParse(this.textBoxLTL.Text.Trim(), out ltl);
                double.TryParse(this.textBoxLTB.Text.Trim(), out ltb);
                double.TryParse(this.textBoxRBL.Text.Trim(), out rbl);
                double.TryParse(this.textBoxRBB.Text.Trim(), out rbb);
                string ltTFH = TFHHelper.GetTFH(ltl, ltb, obj);
                string rbTFH = TFHHelper.GetTFH(rbl, rbb, obj);
                this.textBoxLTTFH.Text = ltTFH;
                this.textBoxRBTFH.Text = rbTFH;
            }
        }
Beispiel #4
0
        private void buttonLTRBPointToTFHs_Click(object sender, EventArgs e)
        {
            MapScaleObject obj = this.comboBoxLTRBMapScale.SelectedItem as MapScaleObject;

            this.m_AllTFHS = new List <TFHObject>();
            if (obj != null)
            {
                string ltTFH, rbTFH;
                ltTFH = this.textBoxLTTFH.Text.Trim();
                rbTFH = this.textBoxRBTFH.Text.Trim();
                string msg = string.Empty;
                this.m_AllTFHS = TFHHelper.GetTFHList(ltTFH, rbTFH, out msg);
                this.checkedListBoxLTRBTFHs.DataSource    = null;
                this.checkedListBoxLTRBTFHs.DataSource    = this.m_AllTFHS;
                this.checkedListBoxLTRBTFHs.DisplayMember = "TFH";
                this.checkedListBoxLTRBTFHs.ValueMember   = "TFH";
            }
        }