Beispiel #1
0
        /// <summary>
        /// 拷贝数据库表格并转换坐标
        /// BD09转向GCJ02
        /// localdata -> localdatagcj
        /// </summary>
        public void copydata_bd2gcj()
        {
            DLocalData        dld    = new DLocalData();
            DLocalDataGCJ     dldgcj = new DLocalDataGCJ();
            IList <LocalData> bd     = dld.SELECT_ALL();

            Console.WriteLine("开始转换......");
            int count = 0;

            foreach (LocalData tmp in bd)
            {
                double[] gcj = BD09toGCJ02(tmp.Lng, tmp.Lat);
                tmp.Lng = gcj[0];
                tmp.Lat = gcj[1];
                int t = dldgcj.INSERT(tmp);
                if (t > 0)
                {
                    count++;
                }
            }
            Console.WriteLine("成功执行了:{0}行。", count);
        }
Beispiel #2
0
        public int add_localdata_gcj(LocalData ld)
        {
            DLocalDataGCJ dldgcj = new DLocalDataGCJ();

            return(dldgcj.INSERT(ld));
        }