示例#1
0
        private string Path(Geospacial.Polygon poly)
        {
            sb.Clear();

            AppendPolygon(poly);

            return(sb.ToString());
        }
示例#2
0
        private void AppendPolygon(Geospacial.Polygon poly)
        {
            sb.Append("M ");
            sb.Append(Coord.CoordX(poly.Longitude[0]));
            sb.Append(" ");
            sb.Append(Coord.CoordY(poly.Latitude[0]));

            for (var i = 1; i < poly.Longitude.Length; i++)
            {
                sb.Append(" L ");
                sb.Append(Coord.CoordX(poly.Longitude[i]));
                sb.Append(" ");
                sb.Append(Coord.CoordY(poly.Latitude[i]));
            }

            sb.Append(" Z");
        }
示例#3
0
文件: Polygon.cs 项目: jan-ai/GGNet
        public override void Scale <TX, TY>(Position <TX> ScaleX, Position <TY> ScaleY)
        {
            var oldPath = Path;

            Path = new Geospacial.Polygon()
            {
                Hole      = oldPath.Hole,
                Latitude  = new double[oldPath.Latitude.Length],
                Longitude = new double[oldPath.Longitude.Length]
            };

            for (var i = 0; i < oldPath.Longitude.Length; i++)
            {
                Path.Longitude[i] = ScaleX.Coord(oldPath.Longitude[i]);
                Path.Latitude[i]  = ScaleY.Coord(oldPath.Latitude[i]);
            }
        }
示例#4
0
        public override void Scale <TX, TY>(Position <TX> ScaleX, Position <TY> ScaleY)
        {
            var oldPolygons = Polygons;

            Polygons = new Geospacial.Polygon[oldPolygons.Length];
            for (var p = 0; p < oldPolygons.Length; p++)
            {
                var oldPoly = oldPolygons[p];
                var poly    = new Geospacial.Polygon()
                {
                    Hole      = oldPoly.Hole,
                    Latitude  = new double[oldPoly.Latitude.Length],
                    Longitude = new double[oldPoly.Longitude.Length]
                };

                for (var i = 0; i < oldPoly.Longitude.Length; i++)
                {
                    poly.Longitude[i] = ScaleX.Coord(oldPoly.Longitude[i]);
                    poly.Latitude[i]  = ScaleY.Coord(oldPoly.Latitude[i]);
                }

                Polygons[p] = poly;
            }
        }