Пример #1
0
        public int GetGridSizeFromShape(Shape shp)
        {
            Waypoint pt1 = new Waypoint {
                Latitude = shp.Point[0].y, Longitude = shp.Point[0].x
            };
            Waypoint pt2 = new Waypoint {
                Latitude = shp.Point[1].y, Longitude = shp.Point[1].x
            };
            double elevChange;

            return((int)Waypoint.ComputeDistance(pt1, pt2, out elevChange));
        }
Пример #2
0
        public static double LengthShapeSimplified()
        {
            double   totalDistance = 0;
            Waypoint wpt1          = null;

            for (int x = 0; x < ShapeSimplified.numPoints; x++)
            {
                if (x > 0)
                {
                    Waypoint wpt2 = new Waypoint {
                        Longitude = ShapeSimplified.Point[x].x, Latitude = ShapeSimplified.Point[x].y, Elevation = 0
                    };
                    double elevChange = 0;
                    totalDistance += Waypoint.ComputeDistance(wpt1, wpt2, out elevChange);
                }
                wpt1 = new Waypoint {
                    Longitude = ShapeSimplified.Point[x].x, Latitude = ShapeSimplified.Point[x].y, Elevation = 0
                };
            }
            return(totalDistance);
        }