private void one2Multi(GSOGeoPolyline3D line, int num_width, int num_height, double interval, GSOPipeLineStyle3D style, GSOFeatureDataset layer, string name, GSOFeature oldfeat)
        {
            line = LatLon2Coord_Line(line);

            double width_all  = interval * (num_width - 1);
            double height_all = interval * (num_height - 1);

            line.Clone();
            GSOGeoPolyline3D line_1 = line.Clone() as GSOGeoPolyline3D;

            GSOPoint3d p1 = line[0][0];
            GSOPoint3d p2 = line[0][1];

            double daltaX = p2.X - p1.X;
            double daltaY = p2.Y - p1.Y;

            double agree = Math.Atan(daltaY / daltaX);

            line.MoveXY((-0.5 * width_all - interval) * Math.Sin(agree), (0.5 * width_all + interval) * Math.Cos(agree));

            line.MoveZ(height_all / -2);

            for (int i = 0; i < num_width; i++)
            {
                for (int j = 0; j < num_height; j++)
                {
                    GSOGeoPolyline3D templine = line.Clone() as GSOGeoPolyline3D;

                    templine.MoveXY((i + 1) * interval * Math.Sin(agree), -1 * (i + 1) * interval * Math.Cos(agree));

                    templine = Coord2LatLon_Line(templine);

                    templine.MoveZ(interval * j);

                    GSOFeature feat = layer.CreateFeature();
                    feat.Geometry       = templine;
                    feat.Geometry.Style = style;
                    feat.Name           = name;
                    SetFields(oldfeat, feat);
                    layer.AddFeature(feat);
                }
            }
        }
Example #2
0
        private void one2Multi(GSOGeoPolyline3D line, int num_width, int num_height, double interval, GSOPipeLineStyle3D style, GSOLayer layer,string name)
        {
            line = LatLon2Coord_Line(line);

            double width_all = interval * (num_width-1);
            double height_all = interval * (num_height-1);

            line.Clone();
            GSOGeoPolyline3D line_1 = line.Clone() as GSOGeoPolyline3D;

            GSOPoint3d p1 = line[0][0];
            GSOPoint3d p2 = line[0][1];

            double daltaX = p2.X-p1.X;
            double daltaY = p2.Y-p1.Y;

            double agree = Math.Atan(daltaY/daltaX);

            line.MoveXY((-0.5*width_all-interval)*Math.Sin(agree),(0.5*width_all+interval)*Math.Cos(agree));

            line.MoveZ(height_all / -2);

            for (int i = 0; i < num_width; i++)
            {
                for (int j = 0; j < num_height; j++)
                {
                    GSOGeoPolyline3D templine = line.Clone() as GSOGeoPolyline3D;

                    templine.MoveXY((i + 1) * interval * Math.Sin(agree), -1 * (i + 1) * interval * Math.Cos(agree));

                    templine = Coord2LatLon_Line(templine);

                    templine.MoveZ(interval*j);

                    GSOFeature feat = new GSOFeature();
                    feat.Geometry = templine;
                    feat.Geometry.Style = style;
                    feat.Name = name;
                    layer.AddFeature(feat);
                }
            }
        }