예제 #1
0
파일: JzdService.cs 프로젝트: lyon913/BDCDC
 private void saveJzdList(string zddm, int dcxmId, List <JZD> jzdList, DbContext ctx)
 {
     for (int i = 0; i < jzdList.Count; i++)
     {
         JZD jzd = jzdList[i];
         jzd.SXH      = i + 1;
         jzd.ZDDM     = zddm;
         jzd.QJDCXMID = dcxmId;
         if (jzd.SHAPE == null)
         {
             jzd.SHAPE = ArcgisService.pointToDbGeometry((double)jzd.X, (double)jzd.Y);
         }
         insertOrUpdate(jzd, ctx);
     }
 }
예제 #2
0
파일: JzdService.cs 프로젝트: lyon913/BDCDC
        public List <JZD> getJzdListFromShape(ZDJBXX zdjbxx)
        {
            List <IPoint> pList = ArcgisService.getPolygonPoints(zdjbxx.SHAPE);
            List <JZD>    list  = new List <JZD>();

            for (int i = 0; i < pList.Count; i++)
            {
                IPoint point = pList[i];
                double x     = point.X;
                double y     = point.Y;
                JZD    d     = new JZD();
                d.ZDDM  = zdjbxx.ZDDM;
                d.JZDLX = "1";
                d.JBLX  = "2";
                d.SXH   = i + 1;
                d.JZDH  = "J" + d.SXH;
                d.X     = Decimal.Round(new Decimal(x), 3);
                d.Y     = Decimal.Round(new Decimal(y), 3);
                d.SHAPE = ArcgisService.pointToDbGeometry(x, y);
                d.ZT    = 0;
                list.Add(d);
            }
            return(list);
        }