Example #1
0
 /// <summary>
 /// 转换为GIS坐标
 /// </summary>
 /// <param name="p"> 屏幕上实际坐标</param>
 /// <returns></returns>
 public Point GetGIS842(Point p)
 {
     Point point = new Point();
     point = GetMercator(p);
     Coords.Point cp = new Coords.Point();
     cp.x = point.X;
     cp.y = point.Y;
     cp = Coords.Mercator2WGS84(cp);
     point.X = cp.x + Constants.COOR_X_OFFSET;
     point.Y = cp.y + Constants.COOR_Y_OFFSET;
     return point;
 }
Example #2
0
         //返回插入junction的id
        protected int InsterDB(Cover c)
        {
            if (c == null) return 0;
            //change the coordinate Mercator to WGS84
            Coords.Point p = new Coords.Point();
            p.x = c.Location.X;
            p.y = c.Location.Y;
            p = Coords.Mercator2WGS84(p);
            //store to 
            CJuncInfo info = new CJuncInfo();
            info.X_Coor = p.x + Constants.COOR_X_OFFSET;
            info.Y_Coor = p.y + Constants.COOR_Y_OFFSET;

            info.Junc_Category = c.juncInfo.Junc_Category;

            //数据库操作
            TJuncInfo juncinfo = new TJuncInfo(App._dbpath, App.PassWord);
            TJuncExtInfo juncextinfo = new TJuncExtInfo(App._dbpath, App.PassWord);
            if (!juncinfo.Insert_JuncInfo(ref info)) {
                return 0;
            }
            CJuncExtInfo extinfo = new CJuncExtInfo();
            extinfo.JuncID = info.ID;
            juncextinfo.Insert_JuncExtInfo(ref extinfo);
            return info.ID;
        }