Esempio n. 1
0
        static void synFromWGS_BaseonAddr08222018()
        {
            DLocalData        dld   = new DLocalData();
            DLocalDataGCJ     gcj   = new DLocalDataGCJ();
            DLocalDataWGS     wgs   = new DLocalDataWGS();
            IList <LocalData> ldwgs = wgs.SELECT_ALL();

            int countName = 0;
            int countTele = 0;

            foreach (LocalData ele in ldwgs)
            {
                LocalData edd = dld.SELECT_BY_ADDR(ele.Address);
                LocalData edg = gcj.SELECT_BY_ADDR(ele.Address);
                if (ele.Name != edd.Name)
                {
                    edd.Name = ele.Name;
                    edg.Name = ele.Name;
                    dld.UPDATE(edd);
                    gcj.UPDATE(edg);
                    countName++;
                }
                if (ele.Tele != edd.Tele)
                {
                    edd.Tele = ele.Tele;
                    edg.Tele = ele.Tele;
                    dld.UPDATE(edd);
                    gcj.UPDATE(edg);
                    countTele++;
                }
            }
            Console.WriteLine();
            Console.WriteLine("Name changes: " + countName);
            Console.WriteLine("Telenum changes: " + countTele);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        static void trimAddr()
        {
            //DLocalDataGCJ dldgcj = new DLocalDataGCJ();
            //LocalData tp = dldgcj.SELECT_BY_ID(266);
            //if (tp.Address.Contains("\r\n"))
            //{
            //    Console.WriteLine("true");
            //}
            //if (tp.Address.Contains("\""))
            //{
            //    Console.WriteLine("true//////");
            //}
            //Console.WriteLine(tp.Address.Replace("\r\n", "").Replace("\"", ""));

            DLocalData        dld = new DLocalData();
            IList <LocalData> ld  = dld.SELECT_ALL();

            for (int i = 0; i < ld.Count; i++)
            {
                if (ld[i].Address.Contains("\r\n"))
                {
                    Console.Write("localdata: " + ld[i].ID + ";");
                    ld[i].Address = ld[i].Address.Replace("\r\n", "").Replace("\"", "");
                    dld.UPDATE(ld[i]);
                }
            }
            Console.WriteLine();

            DLocalDataGCJ     dldgcj = new DLocalDataGCJ();
            IList <LocalData> ldgcj  = dldgcj.SELECT_ALL();

            for (int i = 0; i < ldgcj.Count; i++)
            {
                if (ldgcj[i].Address.Contains("\r\n"))
                {
                    Console.Write("localdata_gcj: " + ldgcj[i].ID + ";");
                    ldgcj[i].Address = ldgcj[i].Address.Replace("\r\n", "").Replace("\"", "");
                    dldgcj.UPDATE(ldgcj[i]);
                }
            }
            Console.WriteLine();

            DLocalDataWGS     dldwgs = new DLocalDataWGS();
            IList <LocalData> ldwgs  = dldwgs.SELECT_ALL();

            for (int i = 0; i < ldwgs.Count; i++)
            {
                if (ldwgs[i].Address.Contains("\r\n"))
                {
                    Console.Write("localdata_wgs: " + ldwgs[i].ID + ";");
                    ldwgs[i].Address = ldwgs[i].Address.Replace("\r\n", "").Replace("\"", "");
                    dldwgs.UPDATE(ldwgs[i]);
                }
            }
            Console.WriteLine();
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        /// <summary>
        /// 拷贝数据库表格并转换坐标
        /// BD09转向WGS84
        /// localdata -> localdatawgs
        /// </summary>
        public void copydata_bd2wgs()
        {
            DLocalData        dld    = new DLocalData();
            DLocalDataWGS     dldwgs = new DLocalDataWGS();
            IList <LocalData> bd     = dld.SELECT_ALL();

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

            foreach (LocalData tmp in bd)
            {
                double[] gcj = BD09toGCJ02(tmp.Lng, tmp.Lat);
                double[] wgs = GCJ02toWGS84(gcj[0], gcj[1]);
                tmp.Lng = wgs[0];
                tmp.Lat = wgs[1];
                int t = dldwgs.INSERT(tmp);
                if (t > 0)
                {
                    count++;
                }
            }
            Console.WriteLine("成功执行了:{0}行。", count);
        }
Esempio n. 5
0
        public int add_localdata(LocalData ld)
        {
            DLocalData dld = new DLocalData();

            return(dld.INSERT(ld));
        }
Esempio n. 6
0
        public int edit_localdata(LocalData ld)
        {
            DLocalData dld = new DLocalData();

            return(dld.UPDATE(ld));
        }
Esempio n. 7
0
        public IList <LocalData> get_local()
        {
            DLocalData dld = new DLocalData();

            return(dld.SELECT_ALL());
        }
Esempio n. 8
0
        public LocalData get_local(int id)
        {
            DLocalData dld = new DLocalData();

            return(dld.SELECT_BY_ID(id));
        }
Esempio n. 9
0
        public IList <LocalData> search_local(string kw, string group)
        {
            DLocalData dld = new DLocalData();

            return(dld.SELECT_BY_KW_GROUP(kw, group));
        }
Esempio n. 10
0
        public IList <LocalData> search_local(string kw)
        {
            DLocalData dld = new DLocalData();

            return(dld.SELECT_BY_KW(kw));
        }
Esempio n. 11
0
        public IList <LocalData> get_local(bool isused)
        {
            DLocalData dld = new DLocalData();

            return(dld.SELECT_BY_ISUSED(1));
        }
Esempio n. 12
0
        public IList <LocalData> get_local(string group)
        {
            DLocalData dld = new DLocalData();

            return(dld.SELECT_BY_GROUP(group));
        }