示例#1
0
            /// <summary>
            /// 读取地块
            /// </summary>
            /// <param name="line"></param>
            private void GeometriesRead(String line)
            {
                int count = Methods.getCharCout(line, ',');

                //判断是否为地块信息行
                if (count == 8)
                {
                    if (geometries.Polygons.Count != 0) //地块信息是否为空
                    {
                        geometries.Polygons.Add(polygon);
                        project.Geometries.Add(geometries);//不为空则将该地块添加入批次中
                    }
                    //初始化地块
                    geometries = new Geometries();
                    //初始化多边形
                    polygon = new GeoPolygon();
                    String[] geo = line.Split(',');
                    geometries.Area = Double.Parse(geo[1]); //地块面积
                    geometries.Name = geo[3].ToString();    //地块名称
                }
                //判断是否为坐标点行
                else if (count == 3)
                {
                    GeoPoint point = new GeoPoint();
                    String[] geo   = line.Split(',');
                    point.X = Double.Parse(geo[3]);
                    point.Y = Double.Parse(geo[2]);
                    int circle = Int32.Parse(geo[1]);
                    if (polygon.Circle != circle)             //判断当前圈号是否一致
                    {
                        if (polygon.Points.Count != 0)        //多边形信息是否为空
                        {
                            geometries.Polygons.Add(polygon); //不为空则将该地块加入地块中
                        }
                        polygon        = new GeoPolygon();    //不一致则初始化多边形
                        polygon.Circle = circle;              //多边形圈号赋值
                        polygon.Points.Add(point);
                    }
                    else
                    {
                        polygon.Points.Add(point);
                    }
                }
            }
示例#2
0
        /// <summary>
        /// 获取WKT
        /// </summary>
        /// <param name="geometries">地块</param>
        /// <returns>地块WKT</returns>
        private static string getWkt(Geometries geometries)
        {
            string wkt = "";

            return(wkt);
        }