예제 #1
0
        /// <summary>
        /// 线与外圆相交的多边形
        /// </summary>
        /// <param name="features"></param>
        public static void outPolygonOuput(IList <IFeature> features)
        {
            IList <IGeometry> outPolygons = new List <IGeometry>();
            IList <IGeometry> outPolygon  = new List <IGeometry>();

            for (int i = 0; i < features.Count; i++)
            {
                //  intPolygon intP = new Algorithm.Utils.Public.intPolygon();
                //intP.getOutPolygons(features[i]);

                outPolygons = intPolygon.getOutPolygons(features[i]);
                foreach (var polygon in outPolygons)
                {
                    outPolygon.Add(polygon);
                }
            }
            string path1           = @"H:\test\结果\outpolygon实验测试1.shp";
            var    shapefileWriter = new ShapefileWriter(path1, ShapeGeometryType.Polygon);

            foreach (var p in outPolygon)
            {
                shapefileWriter.Write(p);
            }
            string path2 = @"H:\test\结果\outpolygon实验测试1.dbf";

            ShapefileWriter.WriteDummyDbf(path2, outPolygon.Count);
            shapefileWriter.Close();
            Console.WriteLine("生成成功");
            Console.ReadKey();
        }
예제 #2
0
        public static void interBoundaryOuput(IList <IFeature> features)
        {
            IList <IGeometry> interBoundarys = new List <IGeometry>();
            IList <IGeometry> interBoundary  = new List <IGeometry>();

            for (int i = 0; i < features.Count; i++)
            {
                //  intPolygon intP = new Algorithm.Utils.Public.intPolygon();
                //intP.getOutPolygons(features[i]);

                interBoundarys = intPolygon.getInterBoundaryPolygons(features[i]);
                foreach (var polygon in interBoundarys)
                {
                    interBoundary.Add(polygon);
                }
            }
            string path1           = @"H:\test\结果\interBoundary1.shp";
            var    shapefileWriter = new ShapefileWriter(path1, ShapeGeometryType.LineString);

            foreach (var p in interBoundary)
            {
                shapefileWriter.Write(p);
            }
            string path2 = @"H:\test\结果\interBoundary1.dbf";

            ShapefileWriter.WriteDummyDbf(path2, interBoundary.Count);
            shapefileWriter.Close();
            Console.WriteLine("生成成功");
            Console.ReadKey();
        }
예제 #3
0
        public static void linesOuput(IList <IFeature> features)
        {
            IList <ILineString> lines = new List <ILineString>();

            for (int i = 0; i < features.Count; i++)
            {
                foreach (var line in new AngleProperty(features[i]).Lines)
                {
                    lines.Add(line);
                }
            }
            string path1           = @"H:\test\结果\lines实验.shp";
            var    shapefileWriter = new ShapefileWriter(path1, ShapeGeometryType.LineString);

            foreach (var line in lines)
            {
                shapefileWriter.Write(line);
            }

            string path2 = @"H:\test\结果\lines实验.dbf";

            ShapefileWriter.WriteDummyDbf(path2, lines.Count);
            shapefileWriter.Close();
            Console.WriteLine("生成成功");
            Console.ReadKey();
        }
예제 #4
0
        public static void minCircleOutput(IList <IFeature> features)
        {
            IList <ILineString> circles = new List <ILineString>();

            for (int i = 0; i < features.Count; i++)
            {
                ILineString minLine = MinPoints.getMinVector(features[i]);
                ILineString circle  = Circles.getCircle(minLine.Coordinates[0], minLine.Coordinates[1]);
                circles.Add(circle);
            }

            string path1           = @"H:\test\结果\MinCircle1.shp";
            var    shapefileWriter = new ShapefileWriter(path1, ShapeGeometryType.LineString);

            foreach (var circle in circles)
            {
                shapefileWriter.Write(circle);
            }


            string path2 = @"H:\test\结果\MinCircle1.dbf";

            ShapefileWriter.WriteDummyDbf(path2, features.Count);
            shapefileWriter.Close();
            Console.WriteLine("生成成功");
            Console.ReadKey();
        }
예제 #5
0
        public static void minLineOutput(IList <IFeature> features)
        {
            IList <ILineString> minLines = new List <ILineString>();

            for (int i = 0; i < features.Count; i++)
            {
                minLines.Add(MinPoints.getMinVector(features[i]));
            }

            string path1           = @"H:\test\结果\MinLine1.shp";
            var    shapefileWriter = new ShapefileWriter(path1, ShapeGeometryType.LineString);

            foreach (var minLine in minLines)
            {
                shapefileWriter.Write(minLine);
            }


            string path2 = @"H:\test\结果\MinLine1.dbf";

            ShapefileWriter.WriteDummyDbf(path2, features.Count);
            shapefileWriter.Close();
            Console.WriteLine("生成成功");
            Console.ReadKey();
        }