Пример #1
0
        public List <Waypoint> ApplyTo(Waypoint waypoint)
        {
            var layout = new List <Waypoint>();

            var xyBase = WgsUtmConverter.LatLonToUTMXY(waypoint.Location, 0);

            foreach (var element in Elements)
            {
                var xy       = xyBase.Shift(element.Offset);
                var location = WgsUtmConverter.UTMXYToLatLon(xy, waypoint.Location.Latitude < 0);
                layout.Add(new Waypoint($"{waypoint.Name}-{element.Name}", location));
            }

            return(layout);
        }
        private bool TrySetLocationFromMeters()
        {
            if (!int.TryParse(X, out int x) || !int.TryParse(Y, out int y) || !int.TryParse(Zone, out int zone))
            {
                return(false);
            }

            if (zone < 1 || zone > 60)
            {
                return(false);
            }

            Location = WgsUtmConverter.UTMXYToLatLon(new GeoLocationXY(zone, x, y, 0), Location.Latitude < 0);

            return(true);
        }