예제 #1
0
파일: JzdService.cs 프로젝트: lyon913/BDCDC
        public List <JZX> getJzxListFromJzd(ZDJBXX zdjbxx, List <JZD> jzdList)
        {
            if (jzdList == null || jzdList.Count < 2)
            {
                return(null);
            }
            List <JZX> jzxList = new List <JZX>();

            for (int i = 0; i < jzdList.Count; i++)
            {
                JZD start    = jzdList[i];
                int endIndex = i + 1;
                if (endIndex == jzdList.Count)
                {
                    endIndex = 0;
                }
                JZD end = jzdList[endIndex];

                JZX x = new JZX();
                x.ZDDM = zdjbxx.ZDDM;
                x.QDH  = start.JZDH;
                x.ZDH  = end.JZDH;
                double cd = distance((double)start.X, (double)start.Y, (double)end.X, (double)end.Y);
                x.JZXCD = Decimal.Round((decimal)cd, 2);
                x.JXXZ  = "600001";
                x.JZXLB = "6";
                x.JZXWZ = "2";
                x.ZT    = 0;
                jzxList.Add(x);
            }
            return(jzxList);
        }
예제 #2
0
파일: JzdService.cs 프로젝트: lyon913/BDCDC
        public JZD newJZD()
        {
            JZD d = new JZD();

            d.JZDLX = "1";
            d.JBLX  = "2";
            d.ZT    = 0;

            return(d);
        }
예제 #3
0
        /// <summary>
        /// 界址点对象
        /// </summary>
        /// <param name="SourceXm"></param>
        /// <returns></returns>
        private JZD ConversionJzd(Gis_Jzd SourceXm)
        {
            JZD result = new JZD();

            foreach (PropertyInfo pi in typeof(JZD).GetProperties())
            {
                pi.SetValue(result, SourceXm.GetType().GetProperty(pi.Name.ToString()).GetValue(SourceXm, null), null);
            }
            return(result);
        }
예제 #4
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);
     }
 }
예제 #5
0
        public void ExportZu_QuanJiDiaoChaBiao(JTSYQ jtsyqGroup, string saveDir)
        {
            var        doc      = WordRead.Read(JTSYQCustom.QuanJiDiaoChaBiao);
            List <JZD> jzds     = new List <JZD>();
            int        jzdCount = 0;

            foreach (JTSYQ jtsyq in jtsyqGroup.GroupJTSYQ)
            {
                IList <JZD> temp = jtsyq.JZDS;
                if (Utils.CheckListExists(temp))
                {
                    jzdCount += temp.Count;

                    jzds.AddRange(temp);
                    jzds.Add(temp[0]);
                    JZD jzd = new JZD();
                    jzds.Add(jzd);
                }
                else
                {
                    MessageBox.Show(jtsyq.QLR + ",图上还没有界址点!!!");
                    return;
                }
            }
            jtsyqGroup.JZDCount = jzdCount;
            //最后一个空白不要
            jzds.RemoveAt(jzds.Count - 1);
            int        jzdEndTableIndex = QuanJiDiaoChaBiaoWriteJZDS(doc, jzds);
            List <QZB> qzbs             = new List <QZB>();

            foreach (JTSYQ jtsyq in jtsyqGroup.GroupJTSYQ)
            {
                qzbs.AddRange(jtsyq.QZBS);
            }
            QuanJiDiaoChaBiaoWriteQZBS(doc, jzdEndTableIndex + 1, qzbs);

            // JTSYQCustom.SetContainsFeatureArea(jtsyqGroup);
            XZDM xzdm = jtsyqGroup.XZDM;
            Dictionary <string, XMLObject> xzdmDic = XMLRead.XmlToObjects(JTSYQCustom.XZDM_Reflect, true);

            WordWrite.ReplaceText(doc, xzdmDic, xzdm);
            Dictionary <string, XMLObject> jtsyqDic = XMLRead.XmlToObjects(JTSYQCustom.JTSYQ_Reflect, true);

            WordWrite.ReplaceText(doc, jtsyqDic, jtsyqGroup);
            WordWrite.SaveToFile(doc, saveDir + "/" + System.IO.Path.GetFileName(JTSYQCustom.QuanJiDiaoChaBiao));
        }
예제 #6
0
        /// <summary>
        /// 写入界址
        /// </summary>
        /// <param name="tbl"></param>
        /// <param name="jzds"></param>
        /// <param name="start">界址点下标</param>
        /// <param name="end"></param>
        private void WriteJZDSPage(XWPFTable tbl, List <JZD> jzds, int start, int end)
        {
            bool isNotLast = true;

            if (end >= jzds.Count)
            {
                isNotLast = false;
                end       = jzds.Count;
            }
            int           rowIndex = 3;
            XWPFTableRow  row;
            XWPFTableCell cell;

            while (start < end)
            {
                JZD jzd = jzds[start];
                row  = tbl.GetRow(rowIndex++);
                cell = row.GetCell(0);
                if (jzd.JZDH != 0)
                {
                    WordWrite.SetCellText(cell, "J" + jzd.JZDH);
                    cell = row.GetCell(4);
                    WordWrite.SetCellText(cell, "√");
                }

                if (start != 0 && jzd.JZDH < jzds[start - 1].JZDH)
                {
                    rowIndex++;
                }
                else
                {
                    cell = row.GetCell(4);
                    WordWrite.SetCellText(cell, "√");
                    if (isNotLast || start != jzds.Count - 1)
                    {
                        row  = tbl.GetRow(rowIndex++);
                        cell = row.GetCell(7);
                        WordWrite.SetCellText(cell, "√");
                        cell = row.GetCell(16);
                        WordWrite.SetCellText(cell, "√");
                    }
                }
                start++;
            }
        }
예제 #7
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);
        }
예제 #8
0
 /// <summary>
 /// 界址点对象
 /// </summary>
 /// <param name="SourceXm"></param>
 /// <returns></returns>
 private JZD ConversionJzd(Gis_Jzd SourceXm)
 {
     JZD result = new JZD();
     foreach (PropertyInfo pi in typeof(JZD).GetProperties())
     {
         pi.SetValue(result, SourceXm.GetType().GetProperty(pi.Name.ToString()).GetValue(SourceXm, null), null);
     }
     return result;
 }
예제 #9
0
        private IList <JZD> ExtractJzd(JTSYQ dk, IFeatureLayer dkLayer, IFeatureLayer jzdLayer)
        {
            IFeature         feature         = dk.Feature;
            IPolygon         polygon         = feature.Shape as IPolygon;
            IPointCollection pointCollection = polygon as IPointCollection;
            IList <JZD>      list            = new List <JZD>();

            int    num   = pointCollection.PointCount - 2;
            IPoint point = new PointClass();

            point.X = 0.0;
            point.Y = 0.0;
            IList <JTSYQ> list2  = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(num), dkLayer));
            IList <JTSYQ> list3  = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(0), dkLayer));
            IList <JTSYQ> entity = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(1), dkLayer));

            for (int i = 0; i <= num; i++)
            {
                IPoint point2 = pointCollection.get_Point(i);
                int    num2   = list3.Count <JTSYQ>();
                bool   flag2  = num2 > list2.Count || num2 > entity.Count;
                if (flag2)
                {
                    JZD JZD = new JZD();
                    JZD.JZDIndex = i;
                    JZD.Point    = point2;
                    list.Add(JZD);
                    point = point2;
                }
                else
                {
                    bool flag3 = num2 != 1 && this.DifferentDks(list3, list2);
                    if (flag3)
                    {
                        JZD JZD = new JZD();
                        JZD.JZDIndex = i;
                        JZD.Point    = point2;
                        list.Add(JZD);
                        point = point2;
                    }
                    else
                    {
                        double num3  = ArcGisUtils.CalculateTwoPt(point2, point);
                        bool   flag4 = i == 0;
                        double num4  = -1;

                        if (flag4)
                        {
                            num4 = ArcGisUtils.Angle(point2, pointCollection.get_Point(num), pointCollection.get_Point(1));
                        }
                        else
                        {
                            bool flag5 = i == num;
                            if (flag5)
                            {
                                num4 = ArcGisUtils.Angle(point2, pointCollection.get_Point(i - 1), pointCollection.get_Point(0));
                                double num5  = ArcGisUtils.CalculateTwoPt(point2, pointCollection.get_Point(0));
                                bool   flag6 = num5 < num3;
                                if (flag6)
                                {
                                    num3 = num5;
                                }
                            }
                            else
                            {
                                num4 = ArcGisUtils.Angle(point2, pointCollection.get_Point(i - 1), pointCollection.get_Point(i + 1));
                            }
                        }

                        bool flag7 = num4 < 150;
                        if (flag7)
                        {
                            bool flag8 = num4 <130.0 || num3> 2.0;
                            if (flag8)
                            {
                                //检查与上一个
                                int count = list.Count - 1;
                                if (count >= 0)
                                {
                                    double di = ArcGisUtils.CalculateTwoPt(point2, list[count].Point);
                                    if (di > 1)

                                    {
                                        //有上一个点的话,要大于50距离才增加
                                        JZD JZD = new JZD();
                                        JZD.JZDIndex = i;
                                        JZD.Point    = point2;
                                        list.Add(JZD);
                                        point = point2;
                                    }
                                }
                                else
                                {
                                    JZD JZD = new JZD();
                                    JZD.JZDIndex = i;
                                    JZD.Point    = point2;
                                    list.Add(JZD);
                                    point = point2;
                                }
                            }
                            else
                            {
                                IList <IFeature> featureCursor = ArcGisUtils.CircleSelect(point2, jzdLayer);

                                if (Utils.CheckListExists(featureCursor))
                                {
                                    JZD JZD = new JZD();
                                    JZD.JZDIndex = i;
                                    JZD.Point    = point2;
                                    list.Add(JZD);
                                    point = point2;
                                }
                            }
                        }
                    }
                }
                list2 = list3;
                list3 = entity;
                bool flag10 = i != num;
                if (flag10)
                {
                    entity = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(i + 2), dkLayer));
                }
                else
                {
                    entity = JTSYQCustom.FeaturesToJTSYQ(ArcGisUtils.CircleSelect(pointCollection.get_Point(0), dkLayer));
                }
            }

            return(list);
        }